Skip Navigation LinkseWAY Home » Support » Developer » Refund Payment

Refunds

You can process refunds for any transactions processed through eWAY either manually, or via XML from your own application.

XML specification and field definitions - describes the eWAY Refund XML document required and the resulting eWAY XML document returned, including field definitions and sample XML documents.
  • Live gateway - https://www.eway.com.au/gateway/xmlpaymentrefund.asp - CHARGED PER TRANS

Linking to eWAY
Below are the specifications for using the eWAY XML Refund solution, including linking requirements and field descriptions.

The following table outlines the maximum string lengths that can be passed to the eWAY XML payment page.
If data of greater length is passed then it is truncated.

eWAY Fields Sent Maximum Field Length (Characters) Required Fields
ewayCustomerID 8 Included
ewayTotalAmount 12 Included
ewayCardExpiryMonth 2 Included
ewayCardExpiryYear 2 Included
ewayOriginalTrxnNumber 16 Included
ewayOption1 255
ewayOption2 255
ewayOption3 255
ewayRefundPassword 20 Included


eWAY Fields Returned Maximum Field Length (Characters) Required Fields
ewayTrxnStatus 6 Included
ewayTrxnNumber 16 Included
ewayTrxnReference 50 Included
ewayTrxnOption1 255 Included
ewayTrxnOption2 255 Included
ewayTrxnOption3 255 Included
ewayAuthCode 6 Included
ewayReturnAmount 12 Included
ewayTrxnError 100 Included


eWAY Field Name Description
ewayCustomerID Your unique eWAY customer ID assigned to you when you join eWAY. eg 11438715
ewayTotalAmount The total amount in cents for the refund, eg $1.00 = 100
ewayOriginalTrxnNumber The eWAY transaction number that is to be refunded
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.
ewayRefundPassword The refund password defined by you - this is NOT the password used to login to the eWAY Business Centre
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 The unique transaction number generated by eWAY
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.

Example XML Layout.
Please do not copy/paste the code behind the following XML example for your code. This will result in malformed code, as it is presented here for display purposes only. Please refer to our sample code for more information.

The following is an example of the XML sent to the eWAY XML payment page.

<ewaygateway>
<ewayCustomerID> 12345678 </ewayCustomerID>
<ewayOriginalTrxnNumber> 09876543210 </ewayOriginalTrxnNumber>
<ewayTotalAmount> 10 </ewayTotalAmount>
<ewayCardExpiryMonth> 04 </ewayCardExpiryMonth>
<ewayCardExpiryYear> 09 </ewayCardExpiryYear>
<ewayOption1></ewayOption1>
<ewayOption2></ewayOption2>
<ewayOption3></ewayOption3>
<ewayRefundPassword> pwabc123 </ewayRefundPassword>
</ewaygateway>

The following is an example of the XML returned after a successful refund.

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