Secure Payments API – Authorize.Net Process Transaction

General

This article covers processing a payment using an Authorize.Net payment processor. If you haven't already, you'll first need to Create an Authorize.net processor, and the response from that request will give you the processor ID you'll need for your endpoint here.

When you want to process a transaction with ANET, you'll send it to this endpoint, substituting {id} with the ID of the specific processor you want to use.

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

The payload body requires the unique Secure Payments token for the card that's being charged. This token is only generated once and cannot be recovered, so if you've lost it you'll need to re-enter the card and create a new payment profile.

Here's a sample JSON payload:

{
"card": {
"token": "YOUR TOKEN"
},
"transaction": {
"amount": 10.00
},
"metadata": {}
}

And the same request in cURL:

curl -X POST --header 'Content-Type: application/json' --header 'Accept:
application/json' --header 'authorization:YOUR AUTHORIZATION' --header
'secret: YOUR SECRET' -d '{ \
"card": { \
"token": "YOUR TOKEN" \
}, \
"transaction": { \
"amount": 10.00 \
}, \
"metadata": {} \
}' 'https://pciwallet.simnang.com/api/processors/anet/process/24'

Here's a sample response:

{
"transaction": {
"amount": 1,
"raw_response": "{\"description\":\"
{}\",\"amount\":\"1.00\",\"purchase_order_number\":\"\",\"transaction_id\":\"400047080
57\",\"address\":\"string\",\"fax\":\"\",\"email\":\"\",\"auth_text\":\"RN1MQF\",\"rea
son_code\":\"1\",\"first_name\":\"string\",\"zip_code\":\"84101\",\"reason_text\":\"Th
is transaction has been
approved.\",\"freight\":\"\",\"phone\":\"\",\"method\":\"CC\",\"avs_response\":\"Y\",\
"city\":\"string\",\"invoice_number\":\"\",\"cavv_response\":\"2\",\"tax_exempt\":\"\"
,\"state\":\"Utah\",\"card_code_response\":\"P\",\"special_instructions\":\"\",\"tax\"
:\"\",\"ship_first_name\":\"\",\"ship_country\":\"\",\"transaction_type\":\"auth_captu
re\",\"response_code\":\"1\",\"md5_hash\":\"EBFDFAE63CC10D3885C5F8A9CD08185E\",\"ship_
state\":\"\",\"requested_amount\":\"\",\"response_subcode\":\"1\",\"account_number\":\
"XXXX9776\",\"split_tender_id\":\"\",\"ship_last_name\":\"\",\"ship_zip_code\":\"\",\"
last_name\":\"\",\"ship_address\":\"\",\"duty\":\"\",\"ship_city\":\"\",\"ship_company
\":\"\",\"country\":\"\",\"balance_on_card\":\"\",\"company\":\"\",\"customer_id\":\"\
",\"card_type\":\"Visa\"}",
"operation": "process",
"operation_success": true,
"created": "2017-6-06 22:31:54",
"token": "TOKEN",
"status": "submitted",
"id": 271,
"sec_code": "",
"raw_http_code": 200,
"processor": "anet",
"metadata": "{}",
"customer_name": "John Q. Customer",
"customer_id": 32
},
"processor": {
"description": "{}",
"amount": "1.00",
"purchase_order_number": "",
"transaction_id": "40004708057",
"address": "string",
"fax": "",
"email": "",
"auth_text": "RN1MQF",
"reason_code": "1",
"first_name": "string",
"zip_code": "84101",
"reason_text": "This transaction has been approved.",
"freight": "",
"phone": "",
"method": "CC",
"avs_response": "Y",
"city": "string",
"invoice_number": "",
"cavv_response": "2",
"tax_exempt": "",
"state": "Utah",
"card_code_response": "P",
"special_instructions": "",
"tax": "",
"ship_first_name": "",
"ship_country": "",
"transaction_type": "auth_capture",
"response_code": "1",
"md5_hash": "EBFDFAE63CC10D3885C5F8A9CD08185E",
"ship_state": "",
"requested_amount": "",
"response_subcode": "1",
"account_number": "XXXX9776",
"split_tender_id": "",
"ship_last_name": "",
"ship_zip_code": "",
"last_name": "",
"ship_address": "",
"duty": "",
"ship_city": "",
"ship_company": "",
"country": "",
"balance_on_card": "",
"company": "",
"customer_id": "",
"card_type": "Visa"
}
}

To try it out yourself, see our ReadMe page: Process ANET Payment


How did we do?


Powered by HelpDocs (opens in a new tab)