Capture an authorisation made with COPYandPAY or SERVER-TO-SERVER
To request clearing for previously authorised funds, use a capture.
To perform a capture, you will need a previous preauthorisation (PA) transaction. To reference this transaction, get its payment id
. Send a POST
request over HTTPS to the /payments/{id}
endpoint.
You can perform a capture of the full or partial amount of the PA, and you can perform multiple partial captures for the same PA.
curl "https://test.oppwa.com/v1/payments/{id}" \
-d "entityId={channelId}" \
-d "amount=4000.00" \
-d "currency=EUR" \
-d "paymentType=CP" \
-d "merchantTransactionId=P188" \
-d "testMode=EXTERNAL" \
-H "Authorization: Bearer {auth_token}"
Here is an example of the first part of the JSON response to a PA transaction made with COPYandPAY. The payment id
is the first attribute in the response.
{
"id":"8ac7a4a09136ba2801913706f2a221bf",
"processingEntityId":{channelId},
"paymentType":"PA",
"paymentBrand":"MASTER",
"amount":"4000.00",
"currency":"EUR",
"descriptor":"3397.4712.1951 ECOMChannel",
"merchantTransactionId":"P155",
"result":{
"cvvResponse":"U",
"code":"000.100.112",
"description":"Request successfully processed in 'Merchant in Connector Test Mode'"
},
Here is an example of a cURL request to capture this payment.
curl "https://test.oppwa.com/v1/payments/8ac7a4a09136ba2801913706f2a221bf" \
-d "entityId={channelId}" \
-d "amount=4000.00" \
-d "currency=EUR" \
-d "paymentType=CP" \
-d "merchantTransactionId=P188" \
-d "testMode=EXTERNAL" \
-H "Authorization: Bearer {auth_token}"
Here is the JSON response to the successful capture request. Note that in the test environment, the value of testMode
of the CP
must be the same as the value of the PA
.
{
"id": "8ac7a4a09136ba2801913734d9e253d8",
"referencedId": "8ac7a4a09136ba2801913706f2a221bf",
"paymentType": "CP",
"amount": "4000.00",
"currency": "EUR",
"descriptor": "7257.6024.8607 ECOMChannel",
"merchantTransactionId": "P188",
"result": {
"code": "000.100.112",
"description": "Request successfully processed in 'Merchant in Connector Test Mode'"
},
"resultDetails": {
"ExtendedDescription": "Successful",
"clearingInstituteName": "SecureTrading Omnipay Demo",
"ConnectorTxID1": "8ac7a0b39134af7f01913734da5f0c39",
"ConnectorTxID3": "885921||true|UMCC635276 ||0809|713| ||RECURRING|80||false|false|false|812||422212885921|00|||1||0809120526|||||||||||||Berlin|",
"ConnectorTxID2": "732104|",
"AcquirerResponse": "0000.0000.0000",
"reconciliationId": "7257.6024.8607",
"clearingCutOff": "2024-08-09 22:15:00.0",
"merchantAccountId": "8ac7a4c890fc748b0190fe70998c0248"
},
"customer": {
"merchantCustomerId": "CUST12"
},
"buildNumber": "174903ec91870d5654938dd40f55da3b35036b23@2024-08-08 12:50:27 +0000",
"timestamp": "2024-08-09 12:54:56+0000",
"ndc": "8ac7a4c890fc748b0190fe6ad56b0241_9ac1d0bb8cdc4136ae0d1dd99e80100f",
"source": "OPP",
"paymentMethod": "CC",
"shortId": "7257.6024.8607"
}
For full details of how to interpret the payment response, see Transaction results.
For the gateway documentation of the Backoffice API, see Gateway Backoffice API documentation.