public static final class RefundService.RefundCreateRequest extends IdempotentPostRequest<Refund>
Request class for RefundService.create()
.
Creates a new refund object.
refund_payment_invalid_state
error if the linked payment isn’t either confirmed
or paid_out
.
total_amount_confirmation_invalid
if the confirmation amount doesn’t match the total amount refunded for the payment. This safeguard is there to prevent two processes from creating refunds without awareness of each other.
number_of_refunds_exceeded
if five or more refunds have already been created against the payment.
Modifier and Type | Class and Description |
---|---|
static class |
RefundService.RefundCreateRequest.Links |
Modifier and Type | Method and Description |
---|---|
RefundService.RefundCreateRequest |
withAmount(java.lang.Integer amount)
Amount in pence/cents/öre.
|
RefundService.RefundCreateRequest |
withHeader(java.lang.String headerName,
java.lang.String headerValue) |
RefundService.RefundCreateRequest |
withIdempotencyKey(java.lang.String idempotencyKey) |
RefundService.RefundCreateRequest |
withLinks(RefundService.RefundCreateRequest.Links links) |
RefundService.RefundCreateRequest |
withLinksMandate(java.util.Map<java.lang.String,java.lang.String> mandate)
private beta ID of the mandate against which the refund is being made.
|
RefundService.RefundCreateRequest |
withLinksPayment(java.lang.String payment)
ID of the payment against which the refund is being made.
|
RefundService.RefundCreateRequest |
withMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Key-value store of custom data.
|
RefundService.RefundCreateRequest |
withMetadata(java.lang.String key,
java.lang.String value)
Key-value store of custom data.
|
RefundService.RefundCreateRequest |
withReference(java.lang.String reference)
An optional refund reference, displayed on your customer’s bank statement.
|
RefundService.RefundCreateRequest |
withTotalAmountConfirmation(java.lang.Integer totalAmountConfirmation)
Total expected refunded amount in pence/cents/öre.
|
execute
executeWrapped
public RefundService.RefundCreateRequest withAmount(java.lang.Integer amount)
Amount in pence/cents/öre.
public RefundService.RefundCreateRequest withLinks(RefundService.RefundCreateRequest.Links links)
public RefundService.RefundCreateRequest withLinksMandate(java.util.Map<java.lang.String,java.lang.String> mandate)
private beta ID of the mandate against which the refund is being made.
public RefundService.RefundCreateRequest withLinksPayment(java.lang.String payment)
ID of the payment against which the refund is being made.
public RefundService.RefundCreateRequest 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 RefundService.RefundCreateRequest 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 RefundService.RefundCreateRequest withReference(java.lang.String reference)
An optional refund reference, displayed on your customer’s bank statement. This can be up to 18 characters long for Bacs or BECS payments, 140 characters for SEPA payments, or 25 characters for Autogiro payments.
public RefundService.RefundCreateRequest withTotalAmountConfirmation(java.lang.Integer totalAmountConfirmation)
Total expected refunded amount in pence/cents/öre. If there are other partial refunds against this payment, this value should be the sum of the existing refunds plus the amount of the refund being created.
Must be supplied if links[payment]
is present.
public RefundService.RefundCreateRequest withIdempotencyKey(java.lang.String idempotencyKey)
public RefundService.RefundCreateRequest withHeader(java.lang.String headerName, java.lang.String headerValue)