Stored Payments (XML)

Stored Payments allows eWAY to store a transaction without processing it until the merchant gives approval via MYeWAY. This can be useful for merchants who are drop-shipping or selling made-to-order goods.
 

Linking to eWAY

Below are the specifications for using Stored Payments, including descriptions of the fields sent to and returned by our payment gateway.

You can download sample code from MYeWAY, along with many other free resources.

Stored Payments

The gateway URL is https://www.eway.com.au/gateway/xmlstored.asp

A transaction request must be sent in XML format, with all the tags included (even if they are empty.) Special characters such as ampersands (&) must be escaped.

Transaction request
Field Name Maximum Length Required?
ewayCustomerID 8
ewayTotalAmount 12
ewayCustomerFirstName 50  
ewayCustomerLastName 50  
ewayCustomerEmail 50  
ewayCustomerAddress 255  
ewayCustomerPostcode 6  
ewayCustomerinvoiceDescription 255  
ewayCustomerInvoiceRef 50  
ewayCardHoldersName 50
ewayCardNumber 20
ewayCardExpiryMonth 2
ewayCardExpiryYear 2
ewayTrxnNumber 16  
ewayOption1 255  
ewayOption2 255  
ewayOption3 255  

Sample XML Sent

A transaction request must be sent to the gateway in UTF-8 XML format. Although not all fields are listed as required, you must ensure that all tags are included in the XML, even if they are empty. Special characters such as ampersands (&) must be escaped.

<ewaygateway>
  <ewayCustomerID> 87654321 </ewayCustomerID>
  <ewayTotalAmount>10</ewayTotalAmount>
  <ewayCustomerFirstName>Andy</ewayCustomerFirstName>
  <ewayCustomerLastName>Person</ewayCustomerLastName>
  <ewayCustomerEmail>andy.person@acme.com.au</ewayCustomerEmail>
  <ewayCustomerAddress>123 Test Street</ewayCustomerAddress>
  <ewayCustomerPostcode>2345</ewayCustomerPostcode>
  <ewayCustomerInvoiceDescription>Red socks</ewayCustomerInvoiceDescription>
  <ewayCustomerInvoiceRef>0123 - abc</ewayCustomerInvoiceRef>
  <ewayCardHoldersName>Andy person</ewayCardHoldersName>
  <ewayCardNumber>4444333322221111</ewayCardNumber>
  <ewayCardExpiryMonth>01</ewayCardExpiryMonth>
  <ewayCardExpiryYear>15</ewayCardExpiryYear>
  <ewayTrxnNumber>987654321</ewayTrxnNumber>
  <ewayOption1></ewayOption1>
  <ewayOption2></ewayOption2>
  <ewayOption3></ewayOption3>
</ewaygateway>

Transaction response
Field Name Maximum Length
ewayTrxnError 100
ewayTrxnStatus 6
ewayTrxnNumber 16
ewayTrxnOption1 255
ewayTrxnOption2 255
ewayTrxnOption3 255
ewayReturnAmount 12
ewayAuthCode 6
ewayTrxnReference 50

Sample XML Received (Valid Transaction)

<ewayResponse>
  <ewayTrxnStatus>True</ewayTrxnStatus>
  <ewayTrxnNumber>1234567</ewayTrxnNumber>
  <ewayTrxnReference>987654321</ewayTrxnReference>
  <ewayTrxnOption1/>
  <ewayTrxnOption2/>
  <ewayTrxnOption3/>
  <ewayAuthCode/>
  <ewayReturnAmount>10</ewayReturnAmount>
  <ewayTrxnError/>
</ewayResponse>

Sent to eWAY
Field name Description
ewayCustomerID Your unique eWAY customer ID assigned to you when you join eWAY. eg 87654321
ewayTotalAmount The total amount in cents for the transaction, eg $1.00 = 100
ewayCustomerFirstName The first name of your customer making a purchase at your site.
ewayCustomerLastName The last name of your customer making a purchase at your site.
ewayCustomerEmail The email address of your customer making a purchase at your site.
ewayCustomerAddress The address of your customer making a purchase at your site including state, city and country.
ewayCustomerPostcode The postcode of your customer making a purchase at your site.
ewayCustomerInvoiceDescription A description of the products or services purchased.
ewayCustomerInvoiceRef A reference to your own invoice system for the purchase.
ewayTrxnReference See 'eWAYTrxnNumber'.
ewayOption1 This value is returned to your website. An additional field for you to pass and receive information from eWAY.
ewayOption2 This value is returned to your website. An additional field for you to pass and receive information from eWAY.
ewayOption3 This value is returned to your website. An additional field for you to pass and receive information from eWAY.
ewayTrxnStatus This value is returned to your website. For a successful transaction "True" is passed and for a failed transaction "False" is passed. This allows you to make your own logging on your website for transaction status.
ewayTrxnNumber This value is returned to your website. You can pass a unique transaction number from your site. You can update and track the status of a transaction when eWAY returns to your site.
NB. This number is returned as 'ewayTrxnReference'. The number returned as 'ewayTrxnNumber', is actually the unique eWAY Transaction number, created by eWAY itself.
ewayAuthCode If the transaction is successful, this is the bank authorisation number. This is also sent in the email receipt.
eWAYReturnAmount Can be used a check that the transaction is processed for the same amount as you request from your website.
ewayTxnError This is the response returned by the bank, and can be related to both successful and failed transactions.