public static final class SubscriptionService.SubscriptionCreateRequest extends IdempotentPostRequest<Subscription>
Request class for SubscriptionService.create()
.
Creates a new subscription object
Modifier and Type | Class and Description |
---|---|
static class |
SubscriptionService.SubscriptionCreateRequest.IntervalUnit |
static class |
SubscriptionService.SubscriptionCreateRequest.Links |
static class |
SubscriptionService.SubscriptionCreateRequest.Month |
Modifier and Type | Method and Description |
---|---|
SubscriptionService.SubscriptionCreateRequest |
withAmount(java.lang.Integer amount)
Amount in pence (GBP), cents (AUD/EUR), öre (SEK), or øre (DKK).
|
SubscriptionService.SubscriptionCreateRequest |
withAppFee(java.lang.Integer appFee)
The amount to be deducted from each payment as an app fee, to be paid to the partner integration which created the subscription, in pence (GBP), cents (AUD/EUR), öre (SEK), or øre (DKK).
|
SubscriptionService.SubscriptionCreateRequest |
withCount(java.lang.Integer count)
The total number of payments that should be taken by this subscription.
|
SubscriptionService.SubscriptionCreateRequest |
withCurrency(java.lang.String currency)
ISO 4217 currency code.
|
SubscriptionService.SubscriptionCreateRequest |
withDayOfMonth(java.lang.Integer dayOfMonth)
As per RFC 2445.
|
SubscriptionService.SubscriptionCreateRequest |
withEndDate(java.lang.String endDate)
Date on or after which no further payments should be created.
|
SubscriptionService.SubscriptionCreateRequest |
withHeader(java.lang.String headerName,
java.lang.String headerValue) |
SubscriptionService.SubscriptionCreateRequest |
withIdempotencyKey(java.lang.String idempotencyKey) |
SubscriptionService.SubscriptionCreateRequest |
withInterval(java.lang.Integer interval)
Number of
interval_units between customer charge dates. |
SubscriptionService.SubscriptionCreateRequest |
withIntervalUnit(SubscriptionService.SubscriptionCreateRequest.IntervalUnit intervalUnit)
The unit of time between customer charge dates.
|
SubscriptionService.SubscriptionCreateRequest |
withLinks(SubscriptionService.SubscriptionCreateRequest.Links links) |
SubscriptionService.SubscriptionCreateRequest |
withLinksMandate(java.lang.String mandate)
ID of the associated mandate which the subscription will create payments against.
|
SubscriptionService.SubscriptionCreateRequest |
withMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Key-value store of custom data.
|
SubscriptionService.SubscriptionCreateRequest |
withMetadata(java.lang.String key,
java.lang.String value)
Key-value store of custom data.
|
SubscriptionService.SubscriptionCreateRequest |
withMonth(SubscriptionService.SubscriptionCreateRequest.Month month)
Name of the month on which to charge a customer.
|
SubscriptionService.SubscriptionCreateRequest |
withName(java.lang.String name)
Optional name for the subscription.
|
SubscriptionService.SubscriptionCreateRequest |
withPaymentReference(java.lang.String paymentReference)
An optional payment reference.
|
SubscriptionService.SubscriptionCreateRequest |
withStartDate(java.lang.String startDate)
The date on which the first payment should be charged.
|
execute
executeWrapped
public SubscriptionService.SubscriptionCreateRequest withAmount(java.lang.Integer amount)
Amount in pence (GBP), cents (AUD/EUR), öre (SEK), or øre (DKK).
public SubscriptionService.SubscriptionCreateRequest withAppFee(java.lang.Integer appFee)
The amount to be deducted from each payment as an app fee, to be paid to the partner integration which created the subscription, in pence (GBP), cents (AUD/EUR), öre (SEK), or øre (DKK).
public SubscriptionService.SubscriptionCreateRequest withCount(java.lang.Integer count)
The total number of payments that should be taken by this subscription.
public SubscriptionService.SubscriptionCreateRequest withCurrency(java.lang.String currency)
ISO 4217 currency code. Currently GBP
, EUR
, SEK
, and DKK
are supported.
public SubscriptionService.SubscriptionCreateRequest withDayOfMonth(java.lang.Integer dayOfMonth)
As per RFC 2445. The day of the month to charge customers on. 1
-28
or -1
to indicate the last day of the month.
public SubscriptionService.SubscriptionCreateRequest withEndDate(java.lang.String endDate)
Date on or after which no further payments should be created. If this field is blank and count
is not specified, the subscription will continue forever.
Deprecated: This field will be removed in a future API version. Use count
to specify a number of payments instead.
public SubscriptionService.SubscriptionCreateRequest withInterval(java.lang.Integer interval)
Number of interval_units
between customer charge dates. Must be greater than or equal to 1
. Must result in at least one charge date per year. Defaults to 1
.
public SubscriptionService.SubscriptionCreateRequest withIntervalUnit(SubscriptionService.SubscriptionCreateRequest.IntervalUnit intervalUnit)
The unit of time between customer charge dates. One of weekly
, monthly
or yearly
.
public SubscriptionService.SubscriptionCreateRequest withLinks(SubscriptionService.SubscriptionCreateRequest.Links links)
public SubscriptionService.SubscriptionCreateRequest withLinksMandate(java.lang.String mandate)
ID of the associated mandate which the subscription will create payments against.
public SubscriptionService.SubscriptionCreateRequest withMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Key-value store of custom data. Up to 3 keys are permitted, with key names up to 50 characters and values up to 500 characters.
public SubscriptionService.SubscriptionCreateRequest withMetadata(java.lang.String key, java.lang.String value)
Key-value store of custom data. Up to 3 keys are permitted, with key names up to 50 characters and values up to 500 characters.
public SubscriptionService.SubscriptionCreateRequest withMonth(SubscriptionService.SubscriptionCreateRequest.Month month)
Name of the month on which to charge a customer. Must be lowercase.
public SubscriptionService.SubscriptionCreateRequest withName(java.lang.String name)
Optional name for the subscription. This will be set as the description on each payment created. Must not exceed 255 characters.
public SubscriptionService.SubscriptionCreateRequest withPaymentReference(java.lang.String paymentReference)
An optional payment reference. This will be set as the reference on each payment created and will appear on your customer’s bank statement. See the documentation for the create payment endpoint for more details.
Restricted: You need your own Service User Number to specify a payment reference for Bacs payments.
public SubscriptionService.SubscriptionCreateRequest withStartDate(java.lang.String startDate)
The date on which the first payment should be charged. Must be within one year of creation and on or after the mandate’s next_possible_charge_date
. When blank, this will be set as the mandate’s next_possible_charge_date
.
public SubscriptionService.SubscriptionCreateRequest withIdempotencyKey(java.lang.String idempotencyKey)
public SubscriptionService.SubscriptionCreateRequest withHeader(java.lang.String headerName, java.lang.String headerValue)