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
9 changes: 9 additions & 0 deletions src/main/java/com/gocardless/GoCardlessClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class GoCardlessClient {
private final CustomerNotificationService customerNotifications;
private final EventService events;
private final ExportService exports;
private final FundsAvailabilityService fundsAvailabilities;
private final InstalmentScheduleService instalmentSchedules;
private final InstitutionService institutions;
private final LogoService logos;
Expand Down Expand Up @@ -196,6 +197,7 @@ private GoCardlessClient(HttpClient httpClient) {
this.customerNotifications = new CustomerNotificationService(httpClient);
this.events = new EventService(httpClient);
this.exports = new ExportService(httpClient);
this.fundsAvailabilities = new FundsAvailabilityService(httpClient);
this.instalmentSchedules = new InstalmentScheduleService(httpClient);
this.institutions = new InstitutionService(httpClient);
this.logos = new LogoService(httpClient);
Expand Down Expand Up @@ -349,6 +351,13 @@ public ExportService exports() {
return exports;
}

/**
* A service class for working with funds availability resources.
*/
public FundsAvailabilityService fundsAvailabilities() {
return fundsAvailabilities;
}

/**
* A service class for working with instalment schedule resources.
*/
Expand Down
92 changes: 83 additions & 9 deletions src/main/java/com/gocardless/resources/BillingRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ private BillingRequest() {
private Links links;
private MandateRequest mandateRequest;
private Map<String, Object> metadata;
private PaymentContextCode paymentContextCode;
private String paymentPurposeCode;
private PaymentRequest paymentRequest;
private PurposeCode purposeCode;
private Resources resources;
Expand Down Expand Up @@ -106,6 +108,27 @@ public Map<String, Object> getMetadata() {
return metadata;
}

/**
* Specifies the context or scenario in which the payment is being made. Defines whether the
* payment is for advance/arrears billing, point of sale transactions, ecommerce, or account
* transfers. This helps banks and payment processors understand the payment scenario and apply
* appropriate processing rules and risk controls.
*/
public PaymentContextCode getPaymentContextCode() {
return paymentContextCode;
}

/**
* Specifies the underlying purpose of the payment. Defines the specific reason or type of
* service/goods the payment relates to, improving straight-through processing and compliance.
* See [VRP Commercial Payment Purpose
* Codes](https://developer.gocardless.com/vrp-commercial-payment-purpose-codes/) for the
* complete list of valid codes.
*/
public String getPaymentPurposeCode() {
return paymentPurposeCode;
}

/**
* Request for a one-off strongly authorised payment
*/
Expand All @@ -114,10 +137,11 @@ public PaymentRequest getPaymentRequest() {
}

/**
* Specifies the high-level purpose of a mandate and/or payment using a set of pre-defined
* categories. Required for the PayTo scheme, optional for all others. Currently `mortgage`,
* `utility`, `loan`, `dependant_support`, `gambling`, `retail`, `salary`, `personal`,
* `government`, `pension`, `tax` and `other` are supported.
* Specifies the high-level purpose/category of a mandate and/or payment using a set of
* pre-defined categories. Provides context on the nature and reason for the payment to
* facilitate processing and compliance. See [Billing Request Purpose
* Codes](https://developer.gocardless.com/billing-request-purpose-codes/) for the complete list
* of valid codes.
*/
public PurposeCode getPurposeCode() {
return purposeCode;
Expand Down Expand Up @@ -148,6 +172,17 @@ public SubscriptionRequest getSubscriptionRequest() {
return subscriptionRequest;
}

public enum PaymentContextCode {
@SerializedName("billing_goods_and_services_in_advance")
BILLING_GOODS_AND_SERVICES_IN_ADVANCE, @SerializedName("billing_goods_and_services_in_arrears")
BILLING_GOODS_AND_SERVICES_IN_ARREARS, @SerializedName("face_to_face_point_of_sale")
FACE_TO_FACE_POINT_OF_SALE, @SerializedName("ecommerce_merchant_initiated_payment")
ECOMMERCE_MERCHANT_INITIATED_PAYMENT, @SerializedName("transfer_to_self")
TRANSFER_TO_SELF, @SerializedName("transfer_to_third_party")
TRANSFER_TO_THIRD_PARTY, @SerializedName("unknown")
UNKNOWN
}

public enum PurposeCode {
@SerializedName("mortgage")
MORTGAGE, @SerializedName("utility")
Expand All @@ -161,11 +196,50 @@ public enum PurposeCode {
GOVERNMENT, @SerializedName("pension")
PENSION, @SerializedName("tax")
TAX, @SerializedName("other")
OTHER, @SerializedName("Epayment")
EPAYMENT, @SerializedName("Commercial")
COMMERCIAL, @SerializedName("OtherPayment")
OTHERPAYMENT, @SerializedName("Trade")
TRADE, @SerializedName("unknown")
OTHER, @SerializedName("bonus_payment")
BONUS_PAYMENT, @SerializedName("cash_management_transfer")
CASH_MANAGEMENT_TRANSFER, @SerializedName("card_bulk_clearing")
CARD_BULK_CLEARING, @SerializedName("credit_card_payment")
CREDIT_CARD_PAYMENT, @SerializedName("trade_settlement_payment")
TRADE_SETTLEMENT_PAYMENT, @SerializedName("debit_card_payment")
DEBIT_CARD_PAYMENT, @SerializedName("dividend")
DIVIDEND, @SerializedName("deliver_against_payment")
DELIVER_AGAINST_PAYMENT, @SerializedName("epayment")
EPAYMENT, @SerializedName("fee_collection_and_interest")
FEE_COLLECTION_AND_INTEREST, @SerializedName("fee_collection")
FEE_COLLECTION, @SerializedName("person_to_person_payment")
PERSON_TO_PERSON_PAYMENT, @SerializedName("government_payment")
GOVERNMENT_PAYMENT, @SerializedName("hedging_transaction")
HEDGING_TRANSACTION, @SerializedName("irrevocable_credit_card_payment")
IRREVOCABLE_CREDIT_CARD_PAYMENT, @SerializedName("irrevocable_debit_card_payment")
IRREVOCABLE_DEBIT_CARD_PAYMENT, @SerializedName("intra_company_payment")
INTRA_COMPANY_PAYMENT, @SerializedName("interest")
INTEREST, @SerializedName("lockbox_transactions")
LOCKBOX_TRANSACTIONS, @SerializedName("commercial")
COMMERCIAL, @SerializedName("consumer")
CONSUMER, @SerializedName("other_payment")
OTHER_PAYMENT, @SerializedName("pension_payment")
PENSION_PAYMENT, @SerializedName("represented")
REPRESENTED, @SerializedName("reimbursement_received_credit_transfer")
REIMBURSEMENT_RECEIVED_CREDIT_TRANSFER, @SerializedName("receive_against_payment")
RECEIVE_AGAINST_PAYMENT, @SerializedName("salary_payment")
SALARY_PAYMENT, @SerializedName("securities")
SECURITIES, @SerializedName("social_security_benefit")
SOCIAL_SECURITY_BENEFIT, @SerializedName("supplier_payment")
SUPPLIER_PAYMENT, @SerializedName("tax_payment")
TAX_PAYMENT, @SerializedName("trade")
TRADE, @SerializedName("treasury_payment")
TREASURY_PAYMENT, @SerializedName("value_added_tax_payment")
VALUE_ADDED_TAX_PAYMENT, @SerializedName("with_holding")
WITH_HOLDING, @SerializedName("cash_management_sweep_account")
CASH_MANAGEMENT_SWEEP_ACCOUNT, @SerializedName("cash_management_top_account")
CASH_MANAGEMENT_TOP_ACCOUNT, @SerializedName("cash_management_zero_balance_account")
CASH_MANAGEMENT_ZERO_BALANCE_ACCOUNT, @SerializedName("crossborder_mi_payments")
CROSSBORDER_MI_PAYMENTS, @SerializedName("foreign_currency_domestic_transfer")
FOREIGN_CURRENCY_DOMESTIC_TRANSFER, @SerializedName("cash_in_pre_credit")
CASH_IN_PRE_CREDIT, @SerializedName("cash_out_notes_coins")
CASH_OUT_NOTES_COINS, @SerializedName("carrier_guarded_wholesale_valuables")
CARRIER_GUARDED_WHOLESALE_VALUABLES, @SerializedName("unknown")
UNKNOWN
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public Boolean getCustomerDetailsCaptured() {
}

/**
* URL that the payer can be taken to if there isn't a way to progress ahead in flow.
* URL that the payer can be taken to if there isn't a way to progress ahead in flow, for
* example if the customer searches for a bank that doesn't exist or isn't supported on the
* scheme.
*/
public String getExitUri() {
return exitUri;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ private BillingRequests() {
private Links links;
private MandateRequest mandateRequest;
private Map<String, Object> metadata;
private PaymentContextCode paymentContextCode;
private String paymentPurposeCode;
private PaymentRequest paymentRequest;
private PurposeCode purposeCode;
private Resources resources;
Expand Down Expand Up @@ -307,6 +309,27 @@ public Map<String, Object> getMetadata() {
return metadata;
}

/**
* Specifies the context or scenario in which the payment is being made. Defines whether the
* payment is for advance/arrears billing, point of sale transactions, ecommerce, or account
* transfers. This helps banks and payment processors understand the payment scenario and
* apply appropriate processing rules and risk controls.
*/
public PaymentContextCode getPaymentContextCode() {
return paymentContextCode;
}

/**
* Specifies the underlying purpose of the payment. Defines the specific reason or type of
* service/goods the payment relates to, improving straight-through processing and
* compliance. See [VRP Commercial Payment Purpose
* Codes](https://developer.gocardless.com/vrp-commercial-payment-purpose-codes/) for the
* complete list of valid codes.
*/
public String getPaymentPurposeCode() {
return paymentPurposeCode;
}

/**
* Request for a one-off strongly authorised payment
*/
Expand All @@ -315,10 +338,11 @@ public PaymentRequest getPaymentRequest() {
}

/**
* Specifies the high-level purpose of a mandate and/or payment using a set of pre-defined
* categories. Required for the PayTo scheme, optional for all others. Currently `mortgage`,
* `utility`, `loan`, `dependant_support`, `gambling`, `retail`, `salary`, `personal`,
* `government`, `pension`, `tax` and `other` are supported.
* Specifies the high-level purpose/category of a mandate and/or payment using a set of
* pre-defined categories. Provides context on the nature and reason for the payment to
* facilitate processing and compliance. See [Billing Request Purpose
* Codes](https://developer.gocardless.com/billing-request-purpose-codes/) for the complete
* list of valid codes.
*/
public PurposeCode getPurposeCode() {
return purposeCode;
Expand Down Expand Up @@ -349,6 +373,17 @@ public SubscriptionRequest getSubscriptionRequest() {
return subscriptionRequest;
}

public enum PaymentContextCode {
@SerializedName("billing_goods_and_services_in_advance")
BILLING_GOODS_AND_SERVICES_IN_ADVANCE, @SerializedName("billing_goods_and_services_in_arrears")
BILLING_GOODS_AND_SERVICES_IN_ARREARS, @SerializedName("face_to_face_point_of_sale")
FACE_TO_FACE_POINT_OF_SALE, @SerializedName("ecommerce_merchant_initiated_payment")
ECOMMERCE_MERCHANT_INITIATED_PAYMENT, @SerializedName("transfer_to_self")
TRANSFER_TO_SELF, @SerializedName("transfer_to_third_party")
TRANSFER_TO_THIRD_PARTY, @SerializedName("unknown")
UNKNOWN
}

public enum PurposeCode {
@SerializedName("mortgage")
MORTGAGE, @SerializedName("utility")
Expand All @@ -362,11 +397,50 @@ public enum PurposeCode {
GOVERNMENT, @SerializedName("pension")
PENSION, @SerializedName("tax")
TAX, @SerializedName("other")
OTHER, @SerializedName("Epayment")
EPAYMENT, @SerializedName("Commercial")
COMMERCIAL, @SerializedName("OtherPayment")
OTHERPAYMENT, @SerializedName("Trade")
TRADE, @SerializedName("unknown")
OTHER, @SerializedName("bonus_payment")
BONUS_PAYMENT, @SerializedName("cash_management_transfer")
CASH_MANAGEMENT_TRANSFER, @SerializedName("card_bulk_clearing")
CARD_BULK_CLEARING, @SerializedName("credit_card_payment")
CREDIT_CARD_PAYMENT, @SerializedName("trade_settlement_payment")
TRADE_SETTLEMENT_PAYMENT, @SerializedName("debit_card_payment")
DEBIT_CARD_PAYMENT, @SerializedName("dividend")
DIVIDEND, @SerializedName("deliver_against_payment")
DELIVER_AGAINST_PAYMENT, @SerializedName("epayment")
EPAYMENT, @SerializedName("fee_collection_and_interest")
FEE_COLLECTION_AND_INTEREST, @SerializedName("fee_collection")
FEE_COLLECTION, @SerializedName("person_to_person_payment")
PERSON_TO_PERSON_PAYMENT, @SerializedName("government_payment")
GOVERNMENT_PAYMENT, @SerializedName("hedging_transaction")
HEDGING_TRANSACTION, @SerializedName("irrevocable_credit_card_payment")
IRREVOCABLE_CREDIT_CARD_PAYMENT, @SerializedName("irrevocable_debit_card_payment")
IRREVOCABLE_DEBIT_CARD_PAYMENT, @SerializedName("intra_company_payment")
INTRA_COMPANY_PAYMENT, @SerializedName("interest")
INTEREST, @SerializedName("lockbox_transactions")
LOCKBOX_TRANSACTIONS, @SerializedName("commercial")
COMMERCIAL, @SerializedName("consumer")
CONSUMER, @SerializedName("other_payment")
OTHER_PAYMENT, @SerializedName("pension_payment")
PENSION_PAYMENT, @SerializedName("represented")
REPRESENTED, @SerializedName("reimbursement_received_credit_transfer")
REIMBURSEMENT_RECEIVED_CREDIT_TRANSFER, @SerializedName("receive_against_payment")
RECEIVE_AGAINST_PAYMENT, @SerializedName("salary_payment")
SALARY_PAYMENT, @SerializedName("securities")
SECURITIES, @SerializedName("social_security_benefit")
SOCIAL_SECURITY_BENEFIT, @SerializedName("supplier_payment")
SUPPLIER_PAYMENT, @SerializedName("tax_payment")
TAX_PAYMENT, @SerializedName("trade")
TRADE, @SerializedName("treasury_payment")
TREASURY_PAYMENT, @SerializedName("value_added_tax_payment")
VALUE_ADDED_TAX_PAYMENT, @SerializedName("with_holding")
WITH_HOLDING, @SerializedName("cash_management_sweep_account")
CASH_MANAGEMENT_SWEEP_ACCOUNT, @SerializedName("cash_management_top_account")
CASH_MANAGEMENT_TOP_ACCOUNT, @SerializedName("cash_management_zero_balance_account")
CASH_MANAGEMENT_ZERO_BALANCE_ACCOUNT, @SerializedName("crossborder_mi_payments")
CROSSBORDER_MI_PAYMENTS, @SerializedName("foreign_currency_domestic_transfer")
FOREIGN_CURRENCY_DOMESTIC_TRANSFER, @SerializedName("cash_in_pre_credit")
CASH_IN_PRE_CREDIT, @SerializedName("cash_out_notes_coins")
CASH_OUT_NOTES_COINS, @SerializedName("carrier_guarded_wholesale_valuables")
CARRIER_GUARDED_WHOLESALE_VALUABLES, @SerializedName("unknown")
UNKNOWN
}

Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/gocardless/resources/FundsAvailability.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.gocardless.resources;

/**
* Represents a funds availability resource returned from the API.
*
* Checks if the payer's current balance is sufficient to cover the amount the merchant wants to
* charge within the consent parameters defined on the mandate.
*/
public class FundsAvailability {
private FundsAvailability() {
// blank to prevent instantiation
}

private Boolean available;

/**
* Indicates if the amount is available
*/
public Boolean getAvailable() {
return available;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ public BillingRequestFlowCreateRequest withCustomerDetailsCaptured(
}

/**
* URL that the payer can be taken to if there isn't a way to progress ahead in flow.
* URL that the payer can be taken to if there isn't a way to progress ahead in flow, for
* example if the customer searches for a bank that doesn't exist or isn't supported on the
* scheme.
*/
public BillingRequestFlowCreateRequest withExitUri(String exitUri) {
this.exitUri = exitUri;
Expand Down
Loading