public static final class SubscriptionService.SubscriptionUpdateRequest extends PutRequest<Subscription>
Request class for SubscriptionService.update(java.lang.String)
.
Updates a subscription object.
This fails with:
validation_failed
if invalid data is provided when attempting to update a subscription.
subscription_not_active
if the subscription is no longer active.
subscription_already_ended
if the subscription has taken all payments.
mandate_payments_require_approval
if the amount is being changed and the mandate requires approval.
number_of_subscription_amendments_exceeded
error if the subscription amount has already been changed 10 times.
forbidden
if the amount is being changed, and the subscription was created by an app and you are not authenticated as that app, or if the subscription was not created by an app and you are authenticated as an app
resource_created_by_another_app
if the app fee is being changed, and the subscription was created by an app other than the app you are authenticated as
Modifier and Type | Method and Description |
---|---|
SubscriptionService.SubscriptionUpdateRequest |
withAmount(java.lang.Integer amount)
Amount in pence (GBP), cents (AUD/EUR), öre (SEK), or øre (DKK).
|
SubscriptionService.SubscriptionUpdateRequest |
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.SubscriptionUpdateRequest |
withHeader(java.lang.String headerName,
java.lang.String headerValue) |
SubscriptionService.SubscriptionUpdateRequest |
withMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Key-value store of custom data.
|
SubscriptionService.SubscriptionUpdateRequest |
withMetadata(java.lang.String key,
java.lang.String value)
Key-value store of custom data.
|
SubscriptionService.SubscriptionUpdateRequest |
withName(java.lang.String name)
Optional name for the subscription.
|
SubscriptionService.SubscriptionUpdateRequest |
withPaymentReference(java.lang.String paymentReference)
An optional payment reference.
|
execute, executeWrapped
public SubscriptionService.SubscriptionUpdateRequest withAmount(java.lang.Integer amount)
Amount in pence (GBP), cents (AUD/EUR), öre (SEK), or øre (DKK).
public SubscriptionService.SubscriptionUpdateRequest 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.SubscriptionUpdateRequest 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.SubscriptionUpdateRequest 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.SubscriptionUpdateRequest 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.SubscriptionUpdateRequest 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.SubscriptionUpdateRequest withHeader(java.lang.String headerName, java.lang.String headerValue)