Captures
Using a Payment ID
Using the payment_id
and authorization
values returned from a previous 2-pass payment (Pre-Auth, Authorization), capture requests are submitted as POST requests to the /payments/payment_id/capture
path.
For example, let's assume we've created a 2-Pass payment and received a payment_id
of 1a57e58b-25e5-412d-93fb-fc7b2f5c48d1
and an authorization
of EP273834
in the response. Then, to complete the payment by capturing the authorization, we'd send the request to /payments/1a57e58b-25e5-412d-93fb-fc7b2f5c48d1/capture
, as follows:
POST /payments/1a57e58b-25e5-412d-93fb-fc7b2f5c48d1/capture
{
"amount": 100,
"authorization": "EP273834",
"terminal": {"gateway_id": "YOUR_GW_ID"}
}
Without a Payment ID
Using a payment_id
is preferable and a much simpler process. However, if you do not know the payment_id
, you can still capture a payment though you will also need access to the original payment method. You will also still need the original authorization
value.
Since you do not know the payment_id
, you use "open" in place of the payment_id
in the path, and it becomes /payments/open/capture
.
Then, you need to specify both the authorization
value and the payment_method
in the request body:
POST /payments/open/capture
{
"amount": 100,
"authorization": "EP525635",
"terminal": {"gateway_id": "YOUR_GW_ID"},
"payment_method": {
"credit_card": {
"cardholder": "Bob Jones",
"number": "4111111111111111",
"expiry_month": "02",
"expiry_year": "2026"
}
}
}
Updated over 3 years ago