PayPal
You can capture the authorized amount in a single API request as depicted in the payment flow below.
Send an API Capture Request
The previously authorized transaction is identified by the "uniqueReference". Set at most the same amount as initially authorized under the "modifiedAmount" parameter in the API method 1.29 Capture.
Capture Request
Path:
POST {baseURL}/payment/{uniqueReference}/capture
POST {baseURL}/payment/zdPGHjinWUmwEe82uIA-eA/capture
Header:
Content-Type: application/json
Accept-Language: en-US
X-Auth-Token: eyJhbGciOiJSUzI1NiI{abbreviated}RW5kVG9rZW4=
{
"partnerReference": "DEV-SVR001-DE_CUSTID-DYTTXCPK9B_CARTID-6TYF3XT4FC_KN3P5AX2IR",
"modifiedAmount": 3.99,
"modifiedAmountCurrCode": "EUR",
"localDate": "2018-10-28",
"localTime": "124741",
}
Receive an API Capture Response
In the last step, the payment platform sends an API response with the status of the payment to your server.
Capture Response
Status Code:
200 (OK)
Header:
Content-Type: application/json
Accept-Language: en-US
{
"initiatorAccno": "1679541175",
"accno": "1679797975",
"uniqueReference": "zdPGHjinWUmwEe82uIA-eA",
"modifiedAmount": 3.99,
"modifiedAmountCurrCode": "EUR",
"processedAmount": 3.99,
"processedCurrCode": "EUR",
"custom1": "WVWZZZ3BZWE689725",
"statusCode": "CAPTURED",
"statusReason": "completed",
"paymentProviderResponse": {
"id": "53U741926L047370R",
"create_time": "2018-10-28T11:47:37Z",
"update_time": "2018-10-28T11:47:43Z",
"amount": {
"total": "3.99",
"currency": "EUR"
},
"is_final_capture": true,
"state": "completed",
"reason_code": "None",
"parent_payment": "PAY-75U79999CW5902937LPK2COQ",
"transaction_fee": {
"value": "0.49",
"currency": "EUR"
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/capture/53U741926L047370R",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/capture/53U741926L047370R/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/authorization/5FM71539D33965344",
"rel": "authorization",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-75U79999CW5902937LPK2COQ",
"rel": "parent_payment",
"method": "GET"
}
]
},
"partnerReference": "DEV-SVR001-DE_CUSTID-DYTTXCPK9B_CARTID-6TYF3XT4FC_KN3P5AX2IR",
"localDate": "2018-10-28",
"localTime": "124741",
"sysDate": "2018-10-28",
"sysTime": "114743",
"responseCode": "0000",
"responseDescription": "Successful execution",
"additionalInformation": {
"requestId": "aff2728481a181dc36daedc14055b516"
}
}
In the case of a successful completed Guest Payment the status code should return "CAPTURED" (see example above).
With that, the payment process is completed.