Payments
The full list of request body parameters and possible outcomes can be found here.
Most operations support the option to pass an idempotencyKey
.
#
Request a payment or payoutSend a payment or payout.
RequestCardSource source = RequestCardSource.builder().build(); // other sources are also supportedPaymentRequest request = PaymentRequest.builder().source(source).build();PaymentResponse response = api.paymentsClient().requestPayment(request).get();
PayoutRequest request = PayoutRequest.destination(PaymentRequestCardDestination.builder().build()).build();PayoutResponse response = api.paymentsClient().requestPayout(request).get();
#
Get payment detailsReturns the details of the payment with the specified identifier string.
PaymentResponse response = api.paymentsClient().getPayment(id).get();
#
Get payment actionsReturns all the actions associated with a payment ordered by processing date in descending order (latest first).
List<PaymentAction> response = api.paymentsClient().getPaymentActions(paymentId).get();
#
Capture a paymentCaptures a payment if supported by the payment method.
CaptureRequest captureRequest = CaptureRequest.builder() .reference() .metadata() .build();
CaptureResponse response = api.paymentsClient().capturePayment(paymentId, captureRequest).get();
#
Refund a paymentRefunds a payment if supported by the payment method.
RefundRequest refundRequest = RefundRequest.builder() .reference(UUID.randomUUID().toString()) .build();
RefundResponse response = api.paymentsClient().refundPayment(paymentId, refundRequest).get();
#
Void a paymentVoids a payment if supported by the payment method.
VoidRequest voidRequest = VoidRequest.builder() .reference(UUID.randomUUID().toString()) .build();
VoidResponse response = api.paymentsClient().voidPayment(paymentId, voidRequest).get();