Skip to content
Open
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
52 changes: 38 additions & 14 deletions src/main/java/com/gocardless/resources/BillingRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ private InstalmentsWithDate() {
/**
* Amount, in the lowest denomination for the currency (e.g. pence in GBP, cents in
* EUR).
*
* For Variable Recurring Payments (VRP), this must not exceed the mandate's
* `max_amount_per_payment` constraint.
*/
public Integer getAmount() {
return amount;
Expand Down Expand Up @@ -1045,24 +1048,32 @@ public String getEndDate() {
}

/**
* The maximum amount that can be charged for a single payment. Required for PayTo and
* VRP.
* The maximum amount that can be charged for a single payment in the lowest
* denomination for the currency (e.g. pence in GBP, cents in EUR). _Note:_ Required for
* PayTo and VRP.
*/
public Integer getMaxAmountPerPayment() {
return maxAmountPerPayment;
}

/**
* A constraint where you can specify info (free text string) about how payments are
* calculated. _Note:_ This is only supported for ACH and PAD schemes.
* calculated. For use when payments vary and cannot be expressed as a fixed amount and
* frequency. _Note:_ This is only supported for ACH and PAD schemes.
*
*/
public String getPaymentMethod() {
return paymentMethod;
}

/**
* List of periodic limits and constraints which apply to them
* Caps on the total amount and/or number of payments that can be collected within a
* repeating period (e.g. no more than a set amount per month), as opposed to
* `max_amount_per_payment` which caps a single payment.
*
* _Note:_ Required for VRP, where exactly one periodic limit must be provided. Optional
* for PayTo.
*
*/
public List<PeriodicLimit> getPeriodicLimits() {
return periodicLimits;
Expand Down Expand Up @@ -1095,14 +1106,21 @@ private PeriodicLimit() {
private Period period;

/**
* The alignment of the period.
* The alignment of the period. Defaults to `creation_date` if not specified.
*
* `calendar` - the period follows fixed calendar boundaries, the same for every
* mandate: `week` runs Monday to Sunday, `month` runs from the 1st to the last day
* of the calendar month, and `year` runs from 1 January to 31 December. If the
* mandate starts partway through a period, the limit for that first period is
* reduced proportionally to the days remaining (e.g. a monthly limit starting on
* the 15th gives roughly half the limit for that first month).
*
* `calendar` - this will finish on the end of the current period. For example this
* will expire on the Monday for the current week or the January for the next year.
* `creation_date` - the period follows the mandate's own start date rather than the
* calendar. For example, if the mandate starts on the 15th, each monthly period
* runs from the 15th to the 14th of the following month. The first period is a full
* period, not reduced proportionally.
*
* `creation_date` - this will finish on the next instance of the current period.
* For example Monthly it will expire on the same day of the next month, or yearly
* the same day of the next year.
* _Note:_ Has no effect when period is `flexible`.
*
*/
public Alignment getAlignment() {
Expand All @@ -1111,7 +1129,8 @@ public Alignment getAlignment() {

/**
* The maximum number of payments that can be collected in this periodic limit.
* _Note:_ This is only supported for the PayTo scheme, where it is required.
*
* _Note:_ Only supported for the PayTo scheme, where it is optional.
*
*/
public Integer getMaxPayments() {
Expand All @@ -1120,16 +1139,21 @@ public Integer getMaxPayments() {

/**
* The maximum total amount that can be charged for all payments in this periodic
* limit. Required for VRP.
* limit, in the lowest denomination for the currency (e.g. pence in GBP, cents in
* EUR).
*
* _Note:_ Required for VRP. This is not permitted for the PayTo scheme.
*
*/
public Integer getMaxTotalAmount() {
return maxTotalAmount;
}

/**
* The repeating period for this mandate. Defaults to flexible for PayTo if not
* specified.
* The repeating period for this mandate. Required whenever a periodic limit is
* provided (for both VRP and PayTo). If periodic_limits is omitted entirely for
* PayTo, this defaults to flexible.
*
*/
public Period getPeriod() {
return period;
Expand Down
85 changes: 38 additions & 47 deletions src/main/java/com/gocardless/resources/BillingRequestTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private BillingRequestTemplate() {
private String mandateRequestDescription;
private Map<String, String> mandateRequestMetadata;
private String mandateRequestScheme;
private MandateRequestVerify mandateRequestVerify;
private String mandateRequestVerify;
private Map<String, String> metadata;
private String name;
private String paymentRequestAmount;
Expand Down Expand Up @@ -108,29 +108,9 @@ public String getMandateRequestScheme() {
}

/**
* Verification preference for the mandate. One of:
* <ul>
* <li>`minimum`: only verify if absolutely required, such as when part of scheme rules</li>
* <li>`recommended`: in addition to `minimum`, use the GoCardless payment intelligence solution
* to decide if a payer should be verified</li>
* <li>`when_available`: if verification mechanisms are available, use them</li>
* <li>`always`: as `when_available`, but fail to create the Billing Request if a mechanism
* isn't available</li>
* </ul>
*
* By default, all Billing Requests use the `recommended` verification preference. It uses
* GoCardless payment intelligence solution to determine if a payer is fraudulent or not. The
* verification mechanism is based on the response and the payer may be asked to verify
* themselves. If the feature is not available, `recommended` behaves like `minimum`.
*
* If you never wish to take advantage of our reduced risk products and Verified Mandates as
* they are released in new schemes, please use the `minimum` verification preference.
*
* See [Billing Requests: Creating Verified
* Mandates](https://developer.gocardless.com/getting-started/billing-requests/verified-mandates/)
* for more information.
* Verification preference for the mandate.
*/
public MandateRequestVerify getMandateRequestVerify() {
public String getMandateRequestVerify() {
return mandateRequestVerify;
}

Expand Down Expand Up @@ -210,15 +190,6 @@ public String getUpdatedAt() {
return updatedAt;
}

public enum MandateRequestVerify {
@SerializedName("minimum")
MINIMUM, @SerializedName("recommended")
RECOMMENDED, @SerializedName("when_available")
WHEN_AVAILABLE, @SerializedName("always")
ALWAYS, @SerializedName("unknown")
UNKNOWN
}

/**
* Represents a mandate request constraint resource returned from the API.
*
Expand Down Expand Up @@ -249,23 +220,31 @@ public String getEndDate() {
}

/**
* The maximum amount that can be charged for a single payment. Required for PayTo and VRP.
* The maximum amount that can be charged for a single payment in the lowest denomination
* for the currency (e.g. pence in GBP, cents in EUR). _Note:_ Required for PayTo and VRP.
*/
public Integer getMaxAmountPerPayment() {
return maxAmountPerPayment;
}

/**
* A constraint where you can specify info (free text string) about how payments are
* calculated. _Note:_ This is only supported for ACH and PAD schemes.
* calculated. For use when payments vary and cannot be expressed as a fixed amount and
* frequency. _Note:_ This is only supported for ACH and PAD schemes.
*
*/
public String getPaymentMethod() {
return paymentMethod;
}

/**
* List of periodic limits and constraints which apply to them
* Caps on the total amount and/or number of payments that can be collected within a
* repeating period (e.g. no more than a set amount per month), as opposed to
* `max_amount_per_payment` which caps a single payment.
*
* _Note:_ Required for VRP, where exactly one periodic limit must be provided. Optional for
* PayTo.
*
*/
public List<PeriodicLimit> getPeriodicLimits() {
return periodicLimits;
Expand Down Expand Up @@ -298,41 +277,53 @@ private PeriodicLimit() {
private Period period;

/**
* The alignment of the period.
* The alignment of the period. Defaults to `creation_date` if not specified.
*
* `calendar` - the period follows fixed calendar boundaries, the same for every
* mandate: `week` runs Monday to Sunday, `month` runs from the 1st to the last day of
* the calendar month, and `year` runs from 1 January to 31 December. If the mandate
* starts partway through a period, the limit for that first period is reduced
* proportionally to the days remaining (e.g. a monthly limit starting on the 15th gives
* roughly half the limit for that first month).
*
* `calendar` - this will finish on the end of the current period. For example this will
* expire on the Monday for the current week or the January for the next year.
* `creation_date` - the period follows the mandate's own start date rather than the
* calendar. For example, if the mandate starts on the 15th, each monthly period runs
* from the 15th to the 14th of the following month. The first period is a full period,
* not reduced proportionally.
*
* `creation_date` - this will finish on the next instance of the current period. For
* example Monthly it will expire on the same day of the next month, or yearly the same
* day of the next year.
* _Note:_ Has no effect when period is `flexible`.
*
*/
public Alignment getAlignment() {
return alignment;
}

/**
* The maximum number of payments that can be collected in this periodic limit. _Note:_
* This is only supported for the PayTo scheme, where it is required.
* The maximum number of payments that can be collected in this periodic limit.
*
* _Note:_ Only supported for the PayTo scheme, where it is optional.
*
*/
public Integer getMaxPayments() {
return maxPayments;
}

/**
* The maximum total amount that can be charged for all payments in this periodic limit.
* Required for VRP.
* The maximum total amount that can be charged for all payments in this periodic limit,
* in the lowest denomination for the currency (e.g. pence in GBP, cents in EUR).
*
* _Note:_ Required for VRP. This is not permitted for the PayTo scheme.
*
*/
public Integer getMaxTotalAmount() {
return maxTotalAmount;
}

/**
* The repeating period for this mandate. Defaults to flexible for PayTo if not
* specified.
* The repeating period for this mandate. Required whenever a periodic limit is provided
* (for both VRP and PayTo). If periodic_limits is omitted entirely for PayTo, this
* defaults to flexible.
*
*/
public Period getPeriod() {
return period;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,9 @@ private InstalmentsWithDate() {
/**
* Amount, in the lowest denomination for the currency (e.g. pence in GBP, cents in
* EUR).
*
* For Variable Recurring Payments (VRP), this must not exceed the mandate's
* `max_amount_per_payment` constraint.
*/
public Integer getAmount() {
return amount;
Expand Down Expand Up @@ -1253,24 +1256,32 @@ public String getEndDate() {
}

/**
* The maximum amount that can be charged for a single payment. Required for PayTo
* and VRP.
* The maximum amount that can be charged for a single payment in the lowest
* denomination for the currency (e.g. pence in GBP, cents in EUR). _Note:_ Required
* for PayTo and VRP.
*/
public Integer getMaxAmountPerPayment() {
return maxAmountPerPayment;
}

/**
* A constraint where you can specify info (free text string) about how payments are
* calculated. _Note:_ This is only supported for ACH and PAD schemes.
* calculated. For use when payments vary and cannot be expressed as a fixed amount
* and frequency. _Note:_ This is only supported for ACH and PAD schemes.
*
*/
public String getPaymentMethod() {
return paymentMethod;
}

/**
* List of periodic limits and constraints which apply to them
* Caps on the total amount and/or number of payments that can be collected within a
* repeating period (e.g. no more than a set amount per month), as opposed to
* `max_amount_per_payment` which caps a single payment.
*
* _Note:_ Required for VRP, where exactly one periodic limit must be provided.
* Optional for PayTo.
*
*/
public List<PeriodicLimit> getPeriodicLimits() {
return periodicLimits;
Expand Down Expand Up @@ -1303,15 +1314,21 @@ private PeriodicLimit() {
private Period period;

/**
* The alignment of the period.
* The alignment of the period. Defaults to `creation_date` if not specified.
*
* `calendar` - the period follows fixed calendar boundaries, the same for every
* mandate: `week` runs Monday to Sunday, `month` runs from the 1st to the last
* day of the calendar month, and `year` runs from 1 January to 31 December. If
* the mandate starts partway through a period, the limit for that first period
* is reduced proportionally to the days remaining (e.g. a monthly limit
* starting on the 15th gives roughly half the limit for that first month).
*
* `calendar` - this will finish on the end of the current period. For example
* this will expire on the Monday for the current week or the January for the
* next year.
* `creation_date` - the period follows the mandate's own start date rather than
* the calendar. For example, if the mandate starts on the 15th, each monthly
* period runs from the 15th to the 14th of the following month. The first
* period is a full period, not reduced proportionally.
*
* `creation_date` - this will finish on the next instance of the current
* period. For example Monthly it will expire on the same day of the next month,
* or yearly the same day of the next year.
* _Note:_ Has no effect when period is `flexible`.
*
*/
public Alignment getAlignment() {
Expand All @@ -1320,7 +1337,8 @@ public Alignment getAlignment() {

/**
* The maximum number of payments that can be collected in this periodic limit.
* _Note:_ This is only supported for the PayTo scheme, where it is required.
*
* _Note:_ Only supported for the PayTo scheme, where it is optional.
*
*/
public Integer getMaxPayments() {
Expand All @@ -1329,16 +1347,21 @@ public Integer getMaxPayments() {

/**
* The maximum total amount that can be charged for all payments in this
* periodic limit. Required for VRP.
* periodic limit, in the lowest denomination for the currency (e.g. pence in
* GBP, cents in EUR).
*
* _Note:_ Required for VRP. This is not permitted for the PayTo scheme.
*
*/
public Integer getMaxTotalAmount() {
return maxTotalAmount;
}

/**
* The repeating period for this mandate. Defaults to flexible for PayTo if not
* specified.
* The repeating period for this mandate. Required whenever a periodic limit is
* provided (for both VRP and PayTo). If periodic_limits is omitted entirely for
* PayTo, this defaults to flexible.
*
*/
public Period getPeriod() {
return period;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/gocardless/resources/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
* creation is an asynchronous process, so it can take some time between an action occurring and its
* corresponding event getting included in API responses. See [here](#event-types) for a complete
* list of event types.
* <p class="notice">
* <strong>Important</strong>: Events older than 18 months will be archived and no longer accessible
* via the API or exports. Archival will begin no sooner than 1 August 2026 in sandbox environments,
* and no sooner than 1 October 2026 in live environments. Events within the 18-month window are
* unaffected. If you need archived data, contact GoCardless support.
* </p>
*/
public class Event {
private Event() {
Expand Down
Loading