Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/main/java/com/gocardless/GoCardlessClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class GoCardlessClient {
private final MandatePdfService mandatePdfs;
private final NegativeBalanceLimitService negativeBalanceLimits;
private final OutboundPaymentService outboundPayments;
private final OutboundPaymentImportService outboundPaymentImports;
private final OutboundPaymentImportEntryService outboundPaymentImportEntries;
private final PayerAuthorisationService payerAuthorisations;
private final PayerThemeService payerThemes;
private final PaymentService payments;
Expand Down Expand Up @@ -153,8 +155,8 @@ public Builder withMaxNoOfRetries(int maxNoOfRetries) {
* Configures the fixed wait strategy time the client should wait before retrying a failed
* request
*
* @param maxNoOfRetries The amount of time to wait before retrying a failed request in
* milli seconds
* @param waitBetweenRetriesInMilliSeconds The amount of time to wait before retrying a
* failed request in milliseconds
*/
public Builder withWaitBetweenRetriesInMilliSeconds(long waitBetweenRetriesInMilliSeconds) {
this.waitBetweenRetriesInMilliSeconds = waitBetweenRetriesInMilliSeconds;
Expand Down Expand Up @@ -207,6 +209,8 @@ private GoCardlessClient(HttpClient httpClient) {
this.mandatePdfs = new MandatePdfService(httpClient);
this.negativeBalanceLimits = new NegativeBalanceLimitService(httpClient);
this.outboundPayments = new OutboundPaymentService(httpClient);
this.outboundPaymentImports = new OutboundPaymentImportService(httpClient);
this.outboundPaymentImportEntries = new OutboundPaymentImportEntryService(httpClient);
this.payerAuthorisations = new PayerAuthorisationService(httpClient);
this.payerThemes = new PayerThemeService(httpClient);
this.payments = new PaymentService(httpClient);
Expand Down Expand Up @@ -421,6 +425,20 @@ public OutboundPaymentService outboundPayments() {
return outboundPayments;
}

/**
* A service class for working with outbound payment import resources.
*/
public OutboundPaymentImportService outboundPaymentImports() {
return outboundPaymentImports;
}

/**
* A service class for working with outbound payment import entry resources.
*/
public OutboundPaymentImportEntryService outboundPaymentImportEntries() {
return outboundPaymentImportEntries;
}

/**
* A service class for working with payer authorisation resources.
*/
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/gocardless/resources/BillingRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,7 @@ public AuthorisationType getAuthorisationType() {

public enum Adapter {
@SerializedName("open_banking_gateway_pis")
OPEN_BANKING_GATEWAY_PIS, @SerializedName("plaid_ais")
PLAID_AIS, @SerializedName("open_banking_gateway_ais")
OPEN_BANKING_GATEWAY_PIS, @SerializedName("open_banking_gateway_ais")
OPEN_BANKING_GATEWAY_AIS, @SerializedName("bankid_ais")
BANKID_AIS, @SerializedName("bank_pay_recurring")
BANK_PAY_RECURRING, @SerializedName("unknown")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,7 @@ public AuthorisationType getAuthorisationType() {

public enum Adapter {
@SerializedName("open_banking_gateway_pis")
OPEN_BANKING_GATEWAY_PIS, @SerializedName("plaid_ais")
PLAID_AIS, @SerializedName("open_banking_gateway_ais")
OPEN_BANKING_GATEWAY_PIS, @SerializedName("open_banking_gateway_ais")
OPEN_BANKING_GATEWAY_AIS, @SerializedName("bankid_ais")
BANKID_AIS, @SerializedName("bank_pay_recurring")
BANK_PAY_RECURRING, @SerializedName("unknown")
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/gocardless/resources/Export.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ private Export() {
private String createdAt;
private String currency;
private String downloadUrl;
private String errorMessage;
private ExportType exportType;
private String id;

Expand All @@ -39,6 +40,13 @@ public String getDownloadUrl() {
return downloadUrl;
}

/**
* Error message if the export encountered an error during processing.
*/
public String getErrorMessage() {
return errorMessage;
}

/**
* The type of the export
*/
Expand Down
231 changes: 231 additions & 0 deletions src/main/java/com/gocardless/resources/OutboundPaymentImport.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
package com.gocardless.resources;

import com.google.gson.annotations.SerializedName;

/**
* Represents a outbound payment import resource returned from the API.
*
* Outbound Payment Imports allow you to create multiple payments via a single API call.
*
* The Workflow: 1. Create the outbound payment import. 2. Retrieve an authorisation link from the
* response. 3. Redirect the user to the link to authorise the import. 4. Once the user authorises
* the import, the individual outbound payments are automatically submitted.
*
* Import entries are not processed as actual payments until they are reviewed and authorised in
* GoCardless Dashboard. Upon approval, a unique outbound payment is generated for every entry in
* the import.
*
* <p class="notice">
* Outbound Payment Imports are capped at 1000 entries. If you expect to exceed this limit, please
* create multiple smaller imports.
* </p>
*/
public class OutboundPaymentImport {
private OutboundPaymentImport() {
// blank to prevent instantiation
}

private Integer amountSum;
private String authorisationUrl;
private String createdAt;
private Currency currency;
private EntryCounts entryCounts;
private String id;
private Links links;
private Status status;

/**
* The sum of all import entry amounts, in the lowest denomination for the currency (e.g. pence
* in GBP, cents in EUR).
*/
public Integer getAmountSum() {
return amountSum;
}

/**
* The link to the GoCardless dashboard to review and authorise the import
*/
public String getAuthorisationUrl() {
return authorisationUrl;
}

/**
* Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created.
*/
public String getCreatedAt() {
return createdAt;
}

/**
* [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency. Currently only "GBP"
* is supported.
*/
public Currency getCurrency() {
return currency;
}

public EntryCounts getEntryCounts() {
return entryCounts;
}

/**
* Unique identifier, beginning with "IM".
*/
public String getId() {
return id;
}

public Links getLinks() {
return links;
}

/**
* The status of the outbound payment import.
* <ul>
* <li>`created`: The initial state of a new import.</li>
* <li>`validating`: Import validation in progress.</li>
* <li>`invalid`: Import validation failed.</li>
* <li>`valid`: Import validation succeeded.</li>
* <li>`processing`: Authorisation received; payments are being generated.</li>
* <li>`processed`: All entries have been successfully converted into outbound payments.</li>
* <li>`cancelled`: The import was cancelled by a user or automatically expired by the
* system.</li>
* </ul>
*/
public Status getStatus() {
return status;
}

public enum Currency {
@SerializedName("GBP")
GBP, @SerializedName("unknown")
UNKNOWN
}

public enum Status {
@SerializedName("created")
CREATED, @SerializedName("validating")
VALIDATING, @SerializedName("valid")
VALID, @SerializedName("invalid")
INVALID, @SerializedName("processing")
PROCESSING, @SerializedName("processed")
PROCESSED, @SerializedName("cancelled")
CANCELLED, @SerializedName("unknown")
UNKNOWN
}

/**
* Represents a entry count resource returned from the API.
*
*
*/
public static class EntryCounts {
private EntryCounts() {
// blank to prevent instantiation
}

private Integer failedToProcess;
private Integer invalid;
private Integer processed;
private Integer total;
private Integer valid;
private Integer verified;
private Integer verifiedWithFullMatch;
private Integer verifiedWithNoMatch;
private Integer verifiedWithPartialMatch;
private Integer verifiedWithUnableToMatch;

/**
* Count of entries that encountered a terminal error during the outbound payment generation
* process.
*/
public Integer getFailedToProcess() {
return failedToProcess;
}

/**
* Count of entries that failed validation checks.
*/
public Integer getInvalid() {
return invalid;
}

/**
* Count of entries successfully converted into outbound payments after the import was
* authorised.
*/
public Integer getProcessed() {
return processed;
}

/**
* The total number of entries included in the import.
*/
public Integer getTotal() {
return total;
}

/**
* Count of entries that passed validation checks.
*/
public Integer getValid() {
return valid;
}

/**
* Total count of entries checked against bank account holder verification services (e.g.,
* CoP).
*/
public Integer getVerified() {
return verified;
}

/**
* Count of entries where the account holder name was a direct match.
*/
public Integer getVerifiedWithFullMatch() {
return verifiedWithFullMatch;
}

/**
* Count of entries where the account holder name did not match the records.
*/
public Integer getVerifiedWithNoMatch() {
return verifiedWithNoMatch;
}

/**
* Count of entries where the account holder name was a close match.
*/
public Integer getVerifiedWithPartialMatch() {
return verifiedWithPartialMatch;
}

/**
* Count of entries where the verification service could not return a definitive result.
*/
public Integer getVerifiedWithUnableToMatch() {
return verifiedWithUnableToMatch;
}
}

/**
* Represents a link resource returned from the API.
*
*
*/
public static class Links {
private Links() {
// blank to prevent instantiation
}

private String creditor;

/**
* ID of the creditor who sends the outbound payments from the import.
*/
public String getCreditor() {
return creditor;
}
}
}
Loading