Skip to content

Instantly share code, notes, and snippets.

@JayMc
Created December 11, 2014 00:11
Show Gist options
  • Save JayMc/aee5f598e99c2309dc34 to your computer and use it in GitHub Desktop.
Save JayMc/aee5f598e99c2309dc34 to your computer and use it in GitHub Desktop.
eWay Process payment with TokenCustomerID
//header required
/*
Authorization Basic:<base64encoded(<APIkey>:<password>)>
Content-Type application/json
charset utf-8
*/
//POST to: https://api.sandbox.ewaypayments.com/DirectPayment.json
//payload
{
"Customer": {
"TokenCustomerID": 911941111111,
},
"Payment": {
"TotalAmount": 1
},
"Method": "ProcessPayment",
"TransactionType": "MOTO"
}
//returns
{
"AuthorisationCode": "111111",
"ResponseCode": "00",
"ResponseMessage": "A2000",
"TransactionID": 11111111,
"TransactionStatus": true,
"TransactionCaptured": true,
"TransactionType": "MOTO",
"BeagleScore": 0,
"Verification": {
"CVN": 0,
"Address": 0,
"Email": 0,
"Mobile": 0,
"Phone": 0
},
"FraudAction": "0",
"Customer": {
"CardDetails": {
"Number": "444433XXXXXX1111",
"Name": "John Smith",
"ExpiryMonth": "02",
"ExpiryYear": "17",
"StartMonth": "",
"StartYear": "",
"IssueNumber": ""
},
"TokenCustomerID": 911941111111,
"Reference": "",
"Title": "Mr.",
"FirstName": "John",
"LastName": "Smith",
"CompanyName": "",
"JobDescription": "",
"Street1": "",
"Street2": "",
"City": "",
"State": "",
"PostalCode": "",
"Country": "au",
"Email": "",
"Phone": "",
"Mobile": "",
"Comments": "",
"Fax": "",
"Url": ""
},
"Payment": {
"TotalAmount": 1,
"InvoiceNumber": "",
"InvoiceDescription": "",
"InvoiceReference": "",
"CurrencyCode": "AUD"
},
"Errors": null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment