Skip to main content

capture Method

Overview

The capture method finalizes an authorized payment by transferring reserved funds.

Purpose

ScenarioBenefit
E-commerce fulfillmentCharge when orders ship

Request Fields

FieldTypeRequiredDescription
merchantTransactionIdStringYesYour transaction reference
connectorTransactionIdStringYesConnector's transaction ID
amountMoneyNoAmount to capture

Response Fields

FieldTypeDescription
statusPaymentStatusCAPTURED, FAILED
capturedAmountLongAmount captured

Example

Map<String, Object> request = new HashMap<>();
request.put("merchantTransactionId", "txn_001");
request.put("connectorTransactionId", "pi_xxx");
request.put("amount", Map.of("minorAmount", 1000, "currency", "USD"));

Map<String, Object> response = paymentClient.capture(request);

Next Steps