Skip to content

Instantly share code, notes, and snippets.

@JayMc
Last active August 29, 2015 14:11
Show Gist options
  • Save JayMc/cbc4d42688520afef82c to your computer and use it in GitHub Desktop.
Save JayMc/cbc4d42688520afef82c to your computer and use it in GitHub Desktop.
eWay create 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": {
"Title": "Mr.",
"FirstName": "John",
"LastName": "Smith",
"Country": "au",
"CardDetails": {
"Name": "John Smith",
"Number": "<encrypt number result>",
"CVN": "(optional) <encrypt cvn result>"
"ExpiryMonth": "02",
"ExpiryYear": "17",
"StartMonth" : "",
"StartYear" : "",
}
},
"Payment": {
"TotalAmount": 0
},
"Method": "CreateTokenCustomer",
"TransactionType": "MOTO"
}
//returns
{
"AuthorisationCode": null,
"ResponseCode": "00",
"ResponseMessage": "A2000",
"TransactionID": null,
"TransactionStatus": false,
"TransactionCaptured": false,
"TransactionType": "MOTO",
"BeagleScore": null,
"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": null,
"StartYear": null,
"IssueNumber": null
},
"TokenCustomerID": 914091111111,
"Reference": "",
"Title": "Mr.",
"FirstName": "John",
"LastName": "Smith",
"CompanyName": "",
"JobDescription": "",
"Street1": "",
"Street2": "",
"City": "",
"State": "",
"PostalCode": "",
"Country": "au",
"Email": "",
"Phone": "",
"Mobile": "",
"Comments": "",
"Fax": "",
"Url": ""
},
"Payment": {
"TotalAmount": 0,
"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