Secure Payments API – VersaPay Process Payment

General

This article covers processing a payment using VersaPay. First, you'll need to Create a VersaPay Payment Processor.

Send a POST request to this endpoint:

POST https://pciwallet.simnang.com/api/processors/versa/process/{id}

Where {id} is the ID of the specific processor you want to use.

Here's a sample JSON payload:

{
"transaction": {
"amount_in_cents": 100,
"transaction_type": "direct_debit",
"first_name": "Sample",
"last_name": "Customer",
"business_name": "Sample Company LLC"
},
"checking-account": {
"token": "CUSTOMER CHECKING TOKEN"
},
"metadata": {}
}

And the same payload as a cURL request:

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'authorization: YOUR AUTH' --header 'secret: YOUR SECRET' -d '{ \
"transaction": { \
"amount_in_cents": 100, \
"transaction_type": "direct_debit", \
"first_name": "Sample", \
"last_name": "Customer", \
"business_name": "Sample Company LLC" \
}, \
"checking-account": { \
"token": "CUSTOMER CHECKING TOKEN" \
}, \
"metadata": {} \
}' 'https://pciwallet.simnang.com/api/processors/versa/process/73'

Response:

{
"transaction": {
"amount": 1.00,
"raw_response": "{\"to_fund\":\"VersaPay Balance\",\"amount_in_cents\":1002,\"link_url\":null,\"email\":null,\"to_account\":\"Autopal\",\"process_on\":null,\"created_by_user\":\"USER\",\"from_account\":\"XLane Motors\",\"type\":\"transaction\",\"state\":\"in_progress\",\"transaction_type\":\"direct_debit\",\"token\":\"1D4265NKMJTG\",\"auto_withdraw\":false,\"unique_reference\":null,\"transaction_reference\":null,\"from_fund_token\":\"BA6SFU92P5KG\",\"auto_withdrawal_token\":null,\"message\":null}",
"operation": "process",
"operation_success": true,
"created": "2017-6-09 17:46:31",
"token": "TOKEN",
"status": "submitted",
"id": 279,
"sec_code": "WEB",
"raw_http_code": 200,
"processor": "versapay",
"metadata": "{}",
"customer_name": "",
"customer_id": null
},
"processor": {
"to_fund": "VersaPay Balance",
"amount_in_cents": 1002,
"link_url": null,
"email": null,
"to_account": "Autopal",
"process_on": null,
"created_by_user": "USER",
"from_account": "XLane Motors",
"type": "transaction",
"state": "in_progress",
"transaction_type": "direct_debit",
"token": "1D4265NKMJTG",
"auto_withdraw": false,
"unique_reference": null,
"transaction_reference": null,
"from_fund_token": "BA6SFU92P5KG",
"auto_withdrawal_token": null,
"message": null
}
}

To try it out yourself, see our ReadMe article on the subject: Process VersaPay Pmt


How did we do?


Powered by HelpDocs (opens in a new tab)