Use this API to capture a previously authorized amount. Call this API in the following form:

curl -v https://<instance>.salesforce.com/services/apexrest/fw1/v2/payments \
     -H 'Authorization: Bearer <access token>' \
     -H 'Content-Type: application/json' \
     -X POST \
     -d '{<arguments>}'

To get an access token, read here: Authentication

 

EXAMPLE REQUEST

curl -v https://na14.salesforce.com/services/apexrest/fw1/v2/payments \
     -H 'Authorization: Bearer 00Dx0000000exxV!AXXXXXfcKqHB0czbxxxxxHkyo9gt41BxxxhWPxxZzaXxXxbAJxx9Ov4Hno..mu1Xi5XXXX8MWHVD81JVr6ShxxxxxorGv6Uy' \ 
     -H 'Content-Type: application/json' \ 
     -X POST \ 
     -d '{"trans_type":"Capture",
          "payment_id":"aXxA000XXXxxyXR"}'

EXAMPLE RESPONSE

{"type":null,
 "status":null,
 "salesforce_payment_id":null,
 "processor_transaction_id":null,
 "processor":null,
 "payment_date":null,
 "message":"Payment has been auto-captured.",
 "is_successful":false,
 "cvv2_match":null,
 "avs_code":null,
 "amount_currency":null,
 "amount":null}

is_successful (true/false) indicates if the payment was successfully captured or not. Any error message will be listed in message.

COMPLETE LIST OF ARGUMENTS

  • trans_type – required, valid value is Capture
  • payment_id – required, the ID  of the payment record in Salesforce
  • amount_to_capture – optional, enter amount if different from previously authorized amount