NAV Navigation Menu
eWAY
cURL (JSON) SOAP PHP Java .NET Node.js Ruby

Introduction

Combining all the most popular payment solutions in a single package, eWAY’s Rapid API includes fraud prevention, hosted payments, transparent redirect, and direct connection to help developers create secure, perfectly rendered payment pages on all devices.

This API reference outlines the expected requests and responses to use eWAY’s Rapid API.

Getting started

# Below in this column are example requests and responses of connecting to the 
# eWAY Rapid REST API using JSON.
#
# The requests are written as cURL commands that can be copied into a terminal.
<!--
The examples in this column demonstrate requests and responses when connecting to the eWAY Rapid API SOAP gateway.
-->
// Below in this column are examples of making requests and handling responses to
// eWAY's Rapid API using the eWAY Rapid PHP SDK.
//
// See the Rapid SDKs section for instructions on installing the eWAY Rapid PHP SDK
// Below in this column are examples of making requests and handling responses to
// eWAY's Rapid API using the eWAY Rapid Java SDK.
//
// See the Rapid SDKs section for instructions on installing the eWAY Rapid Java SDK
// Below in this column are examples of making requests and handling responses to
// eWAY's Rapid API using the eWAY Rapid .NET SDK.
//
// See the Rapid SDKs section for instructions on installing the eWAY Rapid .NET SDK
// Below in this column are examples of making requests and handling responses to
// eWAY's Rapid API using the eWAY Rapid Node.js SDK.
//
// See the Rapid SDKs section for instructions on installing the eWAY Rapid Node.js SDK
# Below in this column are examples of making requests and handling responses to
# eWAY's Rapid API using the eWAY Rapid Ruby Gem.
#
# See the Rapid SDKs section for instructions on installing the eWAY Rapid Ruby Gem

Rapid API provides a number of ways of connecting and formatting requests, so you can choose what works best for your platform.

This reference focusses on REST using JSON and SOAP in examples. The other interfaces follow the same structure and the endpoints are provided for each.

To process a transaction, Rapid API provides a choice of five methods (as well as the pre-coded Pay Now button). Choosing which one will depend on the system and features required.

Once you’ve worked out what is best for you, be sure to read through the rest of this Getting Started section and Authentication before diving in!

Transaction types

Each transaction request to eWAY Rapid API needs to include the Transaction Type in the TransactionType field. This should be one of:

Purchase: This is the default transaction type and refers to a standard eCommerce transaction using CVN and 3D Secure if available.

MOTO: Allows a merchant to process transactions through their system on behalf of the customer. Used in situations such as manual orders through a shopping cart admin area when taking a payment over the phone.

Recurring: When using an automated billing system you must flag transactions as recurring. This means that the CVN is not required to process the transaction. Note that usually the merchants bank requires that they have already processed a fully authorised transaction with CVN for that credit card for a recurring transaction to be approved.

Payment Methods

A transaction request should also contain a Method which determines the action being taken with the request.

When using a Rapid SDK library, setting this field isn’t required as it is determined by the method called.

This field should be one of:

ProcessPayment: This method allows merchants to process a standard payment.

Authorise: This transaction type will hold an amount on the customer’s card without charging it until a Capture request is sent. More details are available in the Pre-Auth documentation. Currently only available for Australian, New Zealand, Singapore, Malaysian & Hong Kong merchants.

When using an eWAY Rapid SDK this is automatically set when the Capture field is set to false.

TokenPayment: This method allows merchants to process payments using Token customers they have stored with eWAY. Merchants can either load an existing token customer by passing in their TokenCustomerID in the initial request, or create a new Token customer by leaving the TokenCustomerID field blank (Transparent Redirect and Responsive Shared Page only).

Any values passed in the Customer part of the initial request will be used to either create or update the Token customer, depending on the TokenCustomerID value.

When loading an existing Token customer, the customer’s details will be returned by eWAY, including the masked credit card details. The masked card can be sent back to eWAY when the payment is processed if the customer wants to process the payment using the card on file.

When using an eWAY Rapid SDK, if a TokenCustomerID is used for the transaction, or if SaveCustomer is set to true, this method is used.

CreateTokenCustomer: This method allows merchants to create token customers without processing a payment.

When using an eWAY Rapid SDK this is automatically set when creating a customer.

UpdateTokenCustomer: This method allows merchants to update existing token customers without processing a payment.

When using an eWAY Rapid SDK this is automatically set when updating a customer.

Payment types

In addition to card transactions, Rapid supports payments through the digital wallets PayPal, MasterCard MasterPass, Visa Checkout and AMEX Express Checkout.

Credit Card: A standard transaction through the various card networks (Visa, MasterCard, American Express, Diners, JCB)

PayPal: After sending the payment details through eWAY, transfers the customer to the PayPal website to process a PayPal payment. The transactions will display in eWAY’s reporting as PayPal transactions. Supported through Transparent Redirect and Responsive Shared Page. For more details, see the PayPal section.

MasterCard MasterPass: After sending the payment details through eWAY, transfers the customer to the MasterPass website to process a MasterPass payment. Supported through Transparent Redirect and Responsive Shared Page. For more details, see the MasterPass section.

Visa Checkout: After the payment details are sent through eWAY, the customer is presented with a Visa Checkout window to enter their details. Supported through Direct Connection, Transparent Redirect and Responsive Shared Page. For more details, see the Visa Checkout section.

AMEX Express Checkout: After the payment details are sent through eWAY, the customer is presented with an AMEX Express Checkout window to enter their details. Supported through Direct Connection, Transparent Redirect and Responsive Shared Page. For more details, see the AMEX Express Checkout section.

Errors

foreach ($response->getErrors() as $error) {
    echo "Error message: ".\Eway\Rapid::getMessage($error)."<br>";
}
for (String errorcode: response.getErrors()) {
    System.out.println("Error Message: " + RapidSDK.userDisplayMessage(errorcode, "en"));
}
foreach (string errorCode in response.Errors)
{
    Console.WriteLine("Error message: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
}
reason.getErrors().forEach(function(error) {
    console.log("Error Messages: " + rapid.getMessage(error, "en"));
});
response.errors.each { |e| puts "Response message: " + EwayRapid::RapidClient.user_display_message(e) }

If there is a problem with a request to eWAY, there are two possible responses that should be handled by the connecting system

If you are using an eWAY Rapid SDK, the errors will usually be returned in an Errors field or property. A function is provided to assist with translating the error code to human friendly text.

Authentication

All requests to eWAY’s Rapid API need to be authenticated using basic authentication. This uses the eWAY API Key and Password in the username and password fields respectively.

This authentication is sent in the HTTP header, most frameworks and libraries provide a way to set these. The eWAY SDKs accept the API key & password along with the endpoint (sandbox or production) when they are initialised.

# Sample Basic Authentication with cURL
curl --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    https://api.sandbox.ewaypayments.com/Transaction/
<?php

$apiKey = '60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR';
$apiPassword = 'API-P4ss';
$apiEndpoint = \Eway\Rapid\Client::MODE_SANDBOX; // Use \Eway\Rapid\Client::MODE_PRODUCTION when you go live
$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);
String apiKey = "60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR";
String password = "API-P4ss";
String rapidEndpoint = "Sandbox"; // Use "Production" when you go live

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);
string apiKey = "60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR";
string password = "API-P4ss";
string rapidEndpoint = "Sandbox"; // Use "Production" when you go live

IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);
var rapid = require('eway-rapid');

var apiKey   = '60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR',
    password = 'API-P4ss',
    rapidEndpoint = 'Sandbox'; // Use 'Production' when you go live

var client = rapid.createClient(apiKey, password, rapidEndpoint);
require 'eway_rapid'

api_key = '60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR'
password = 'API-P4ss'
endpoint = 'Sandbox' # Use 'Production' when you go live

client = EwayRapid::RapidClient.new(api_key, password, endpoint)

Creating an eWAY Sandbox API key

1. Log in to your eWAY Partner Portal account - if you don’t have an account, sign up for free!

2. Navigate to Resources > Sandbox/Testing and click on ‘Request Sandbox’. Note: Skip this step if you already have a Sandbox account

3. Navigate to the Sandbox using the link below for your country

4. Go to My Account > API Key

5. Your Rapid API Key will be displayed in the API Key field

6. Click Generate Password to create a password for the key. A password can only be viewed once after it has been generated - if you forget it a new one can be generated by clicking Generate Password again (the old one will no longer work).

More detailed instructions for managing your eWAY Rapid API credentials are available in this eWAY Community article

Versions

Sample of setting the version

curl --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --request GET \
    --header "X-EWAY-APIVERSION: 40" \
    https://api.sandbox.ewaypayments.com/Transaction/11259580
SOAP does not support Rapid Versions at this time
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);
$client->setVersion(40);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);
ewayClient.SetVersion(40);

Major changes to Rapid API (such as adding or removing fields) are made to new versions of Rapid API in order to prevent these changes from breaking existing integrations. Versioning of Rapid API is supported for all endpoints except for SOAP at this time.

To access an specific version of Rapid API, an additional header must be sent with the request to eWAY: X-EWAY-APIVERSION: <number>. See the “cURL(JSON)” tab for an example. Some eWAY SDKs support setting the version in the client, check the appropriate tab for an example.

Available Versions

Version Number Changes
31 Original Rapid API version - default if no header is used.
40 Provides additional fields to Transaction Query
  • TransactionDateTime
  • FraudAction
  • TransactionCaptured
  • TransactionType
  • CurrencyCode
  • Source
  • MaxRefund
  • OriginalTransactionId
and Transparent Redirect
  • AmexECEncryptedData

Rapid SDKs

To make development even faster and easier, eWAY provides Software Development Kits for popular languages - including PHP, Java, .NET (C#) and Node.js. These provide native structures and functions to do the heavy lifting for you.

All eWAY SDKs are free, MIT licensed and open source. Sample code for supported eWAY Rapid methods can be found by using the tabs on the top right of this page. Bug reports, suggestions and improvements are welcome via either the relevant SDK’s GitHub page or the eWAY Community!

PHP

$ composer require eway/eway-rapid-php

The eWAY Rapid PHP library requires PHP 5.4.0 or greater, with the curl, json and openssl extensions.

<?php
require('vendor/autoload.php');

It can be quickly installed using Composer, a PHP package manager. Once installed, simply include the Composer autoloader to access the library’s functions.

Examples for most functions can be found by clicking the “PHP” tab at the top right of this page.

GitHub Logo The source code can be viewed, forked, pushed and pulled on GitHub: https://github.com/eWAYPayment/eway-rapid-php

Java

<dependency>
  <groupId>com.ewaypayments</groupId>
  <artifactId>eway-rapid-java</artifactId>
  <version>LATEST</version>
</dependency>

To use the eWAY Rapid Java library add the dependency to your Maven project’s pom.xml - this will add the library to your project, along with the required dependencies.

Examples for most functions can be found by clicking the “Java” tab at the top right of this page.

GitHub Logo The source code can be viewed, forked, pushed and pulled on GitHub: https://github.com/eWAYPayment/eway-rapid-java

.NET

PM> Install-Package eWAY.Rapid

The eWAY Rapid C# .NET package is available in NuGet - it can be added using Visual Studio’s package manager. Simply search for “eWAY” and add the package to your project. Alternatively you can use the Package Manager Console and run Install-Package eWAY.Rapid. NuGet will automatically include the required dependencies.

Examples for most functions can be found by clicking the “.NET” tab at the top right of this page.

GitHub Logo The source code can be viewed, forked, pushed and pulled on GitHub: https://github.com/eWAYPayment/eway-rapid-net

Node.js

npm install eway-rapid

The eWAY Rapid Node.js module can be easily installed using npm, the Node.js Package Manager. It can be installed in your project either via the command line (as shown on the right) or by adding "eway-rapid" directly to your project’s package.json.

Examples for most functions can be found by clicking the “Node.js” tab at the top right of this page.

GitHub Logo The source code can be viewed, forked, pushed and pulled on GitHub: https://github.com/eWAYPayment/eway-rapid-node

Ruby

gem install eway_rapid

The eWAY Rapid Ruby Gem can be easily installed using RubyGems, the Ruby Package Manager. It can be installed in your project either via the command line (as shown on the right) or by adding gem 'eway_rapid' directly to your project’s Gemfile.

Examples for most functions can be found by clicking the “Ruby” tab at the top right of this page.

GitHub Logo The source code can be viewed, forked, pushed and pulled on GitHub: https://github.com/eWAYPayment/eway-rapid-ruby

iOS

The eWAY Rapid iOS Mobile SDK can be easily installed using CocoaPods, a dependency manager for Swift and Objective-C Cocoa projects. It can be installed in your project by adding the following line to your iOS project’s Podfile:

pod 'eWAYPaymentsSDK'

Then run the following in a terminal window

pod install

This API reference focusses on the server side API functions, for details of using the iOS SDK, please see our eWAY iOS SDK Getting Started guide.

Android

The eWAY Rapid Android Mobile SDK can be easily installed using Gradle, a dependency manager for Java projects. It can be installed in two steps:

  1. Add the repository to the project’s build gradle file under all projects:

repositories {
jcenter()
maven { url "http://dl.bintray.com/webactive/maven" }
}

  1. Then add the dependency to the dependencies section of app’s build gradle:

dependencies {
...
compile "com.eway.payment:android-sdk:1.+"
}

This API reference focusses on the server side API functions, for details of using the Android SDK, please see our eWAY Android SDK Getting Started guide.

API Reference

Transparent Redirect

If you want the superior user experience of keeping customers on your website as well as the security of keeping card data off your own systems, eWAY’s Transparent Redirect is the way to go.

Since the payment form is displayed on the site, it is important that an SSL is used to secure the page and provide reassurance to customers, increasing your basket conversion.

Implementing Transparent Redirect is a three step process:

  1. Pass the customer and transaction details to eWAY to generate an Access Code.
  2. Display a payment form on your site using the Access Code and URL provided by eWAY - this form submits directly to eWAY’s secure servers. After processing the transaction, the customer is directed (transparently!) straight back to the nominated Redirect URL.
  3. Once the transaction has been processed, request the results from eWAY using the Access Code.

Step 1: Create a new access code

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.ewaypayments.com/AccessCodes
HTTP POST (XML) https://api.ewaypayments.com/CreateAccessCode.xml
HTTP POST (JSON) https://api.ewaypayments.com/CreateAccessCode.json
RPC (XML) https://api.ewaypayments.com/xml-rpc
RPC (JSON) https://api.ewaypayments.com/json-rpc

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.sandbox.ewaypayments.com/AccessCodes
HTTP POST (XML) https://api.sandbox.ewaypayments.com/CreateAccessCode.xml
HTTP POST (JSON) https://api.sandbox.ewaypayments.com/CreateAccessCode.json
RPC (XML) https://api.sandbox.ewaypayments.com/xml-rpc
RPC (JSON) https://api.sandbox.ewaypayments.com/json-rpc

Basic Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
        "Payment": {
           "TotalAmount": 100
        },
        "RedirectUrl": "http://www.eway.com.au",
        "Method": "ProcessPayment",
        "TransactionType": "Purchase"
        }' \
    https://api.sandbox.ewaypayments.com/AccessCodes
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <CreateAccessCode xmlns="https://api.ewaypayments.com/">
            <request>
                <Payment>
                    <TotalAmount>1000</TotalAmount>
                </Payment>
                <RedirectUrl>http://www.eway.com.au</RedirectUrl>
                <TransactionType>Purchase</TransactionType>
                <Method>ProcessPayment</Method>
            </request>
        </CreateAccessCode>
    </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'Payment' => [
        'TotalAmount' => 1000,
    ],
    'RedirectUrl' => 'http://www.eway.com.au',
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::TRANSPARENT_REDIRECT, $transaction);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction();

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);

transaction.setPaymentDetails(paymentDetails);
transaction.setRedirectURL("http://www.eway.com.au");
transaction.setTransactionType(TransactionType.Purchase);

CreateTransactionResponse response = client.create(PaymentMethod.TransparentRedirect, transaction);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction()
{
    PaymentDetails = new PaymentDetails()
    {
        TotalAmount = 1000
    },
    RedirectURL = "http://www.eway.com.au",
    TransactionType = TransactionTypes.Purchase
};

CreateTransactionResponse response = ewayClient.Create(PaymentMethod.TransparentRedirect, transaction);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.TRANSPARENT_REDIRECT, {
    "Payment": {
       "TotalAmount": 100
    },
    "RedirectUrl": "http://www.eway.com.au",
    "TransactionType": "Purchase"
}).then(function (response) {

});

client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new
payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
transaction.payment_details = payment_details
transaction.redirect_url = 'http://www.eway.com.au'
transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::TRANSPARENT_REDIRECT, transaction)

Complete Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{ 
        "Customer": { 
           "Reference": "A12345", 
           "Title": "Mr.", 
           "FirstName": "John", 
           "LastName": "Smith", 
           "CompanyName": "Demo Shop 123", 
           "JobDescription": "Developer", 
           "Street1": "Level 5", 
           "Street2": "369 Queen Street", 
           "City": "Sydney", 
           "State": "NSW", 
           "PostalCode": "2000", 
           "Country": "au", 
           "Phone": "09 889 0986", 
           "Mobile": "09 889 6542",
           "Email": "demo@example.org",
           "Url": "http://www.ewaypayments.com"
        }, 
        "ShippingAddress": {
           "ShippingMethod": "NextDay",
           "FirstName": "John",
           "LastName": "Smith",
           "Street1": "Level 5", 
           "Street2": "369 Queen Street", 
           "City": "Sydney", 
           "State": "NSW", 
           "Country": "au", 
           "PostalCode": "2000",
           "Phone": "09 889 0986" 
        }, 
        "Items": [ 
         { 
           "SKU": "12345678901234567890", 
           "Description": "Item Description 1",
           "Quantity": 1,
           "UnitCost": 400,
           "Tax": 100,
           "Total": 500
         }, 
         { 
           "SKU": "123456789012", 
           "Description": "Item Description 2", 
           "Quantity": 1,
           "UnitCost": 400,
           "Tax": 100,
           "Total": 500
         }
        ], 
        "Options": [ 
         { 
           "Value": "Option1" 
         }, 
         { 
           "Value": "Option2" 
         }
        ], 
        "Payment": { 
           "TotalAmount": 1000, 
           "InvoiceNumber": "Inv 21540", 
           "InvoiceDescription": "Individual Invoice Description", 
           "InvoiceReference": "513456",
           "CurrencyCode": "AUD"
        }, 
        "RedirectUrl": "http://www.eway.com.au", 
        "Method": "ProcessPayment", 
        "DeviceID": "D1234", 
        "CustomerIP": "127.0.0.1", 
        "PartnerID": "ID", 
        "TransactionType": "Purchase"
        }' \
    https://api.sandbox.ewaypayments.com/AccessCodes
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <CreateAccessCode xmlns="https://api.ewaypayments.com/">
            <request>
                <Customer>
                    <Reference>A12345</Reference>
                    <Title>Mr.</Title>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <CompanyName>Demo Shop 123</CompanyName>
                    <JobDescription>Developer</JobDescription>
                    <Street1>Level 5</Street1>
                    <Street2>369 Queen Street</Street2>
                    <City>Sydney</City>
                    <State>NSW</State>
                    <PostalCode>2000</PostalCode>
                    <Country>au</Country>
                    <Email>demo@example.org</Email>
                    <Phone>0289712345</Phone>
                    <Mobile>0289712345</Mobile>
                    <Comments>Customer comments</Comments>
                    <Fax>0289712345</Fax>
                    <Url>http://www.ewaypayments.com</Url>
                </Customer>
                <ShippingAddress>
                    <ShippingMethod>NextDay</ShippingMethod>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <Street1>Level 5</Street1>
                    <Street2>369 Queen Street</Street2>
                    <City>Sydney</City>
                    <State>NSW</State>
                    <PostalCode>2000</PostalCode>
                    <Country>au</Country>
                    <Email>demo@example.org</Email>
                    <Phone>0289712345</Phone>
                    <Fax>0289712345</Fax>
                </ShippingAddress>
                <Items>
                    <LineItem>
                        <SKU>12345678901234567890</SKU>
                        <Description>Item Description 1</Description>
                        <Quantity>1</Quantity>
                        <UnitCost>400</UnitCost>
                        <Tax>100</Tax>
                        <Total>500</Total>
                    </LineItem>
                    <LineItem>
                        <SKU>123456789012</SKU>
                        <Description>Item Description 2</Description>
                        <Quantity>1</Quantity>
                        <UnitCost>400</UnitCost>
                        <Tax>100</Tax>
                        <Total>500</Total>
                    </LineItem>
                </Items>
                <Options>
                    <Option>
                        <Value>Option1</Value>
                    </Option>
                    <Option>
                        <Value>Option2</Value>
                    </Option>
                </Options>
                <Payment>
                    <TotalAmount>1000</TotalAmount>
                    <InvoiceNumber>Inv 21540</InvoiceNumber>
                    <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
                    <InvoiceReference>Individual Invoice Description</InvoiceReference>
                    <CurrencyCode>AUD</CurrencyCode>
                </Payment>
                <RedirectUrl>http://www.eway.com.au</RedirectUrl>
                <CustomerIP>127.0.0.1</CustomerIP>
                <TransactionType>Purchase</TransactionType>
                <Method>ProcessPayment</Method>
                <DeviceID>D1234</DeviceID>
            </request>
        </CreateAccessCode>
    </soap:Body>
</soap:Envelope>

<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'Customer' => [
        'Reference' => 'A12345',
        'Title' => 'Mr.',
        'FirstName' => 'John',
        'LastName' => 'Smith',
        'CompanyName' => 'Demo Shop 123',
        'JobDescription' => 'PHP Developer',
        'Street1' => 'Level 5',
        'Street2' => '369 Queen Street',
        'City' => 'Sydney',
        'State' => 'NSW',
        'PostalCode' => '2000',
        'Country' => 'au',
        'Phone' => '09 889 0986',
        'Mobile' => '09 889 6542',
        'Email' => 'demo@example.org',
        "Url" => "http://www.ewaypayments.com",
    ],
    'ShippingAddress' => [
        'ShippingMethod' => \Eway\Rapid\Enum\ShippingMethod::NEXT_DAY,
        'FirstName' => 'John',
        'LastName' => 'Smith',
        'Street1' => 'Level 5',
        'Street2' => '369 Queen Street',
        'City' => 'Sydney',
        'State' => 'NSW',
        'Country' => 'au',
        'PostalCode' => '2000',
        'Phone' => '09 889 0986',
    ],
    'Items' => [
        [
            'SKU' => '12345678901234567890',
            'Description' => 'Item Description 1',
            'Quantity' => 1,
            'UnitCost' => 400,
            'Tax' => 100,
            // Total is calculated automatically
        ],
        [
            'SKU' => '123456789012',
            'Description' => 'Item Description 2',
            'Quantity' => 1,
            'UnitCost' => 400,
            'Tax' => 100,
        ],
    ],
    'Options' => [
        [
            'Value' => 'Option1',
        ],
        [
            'Value' => 'Option2',
        ],
    ],
    'Payment' => [
        'TotalAmount' => 1000,
        'InvoiceNumber' => 'Inv 21540',
        'InvoiceDescription' => 'Individual Invoice Description',
        'InvoiceReference' => '513456',
        'CurrencyCode' => 'AUD',
    ],
    'RedirectUrl' => 'http://www.eway.com.au',
    'DeviceID' => 'D1234',
    'CustomerIP' => '127.0.0.1',
    'PartnerID' => 'ID',
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
    'Capture' => true,
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::TRANSPARENT_REDIRECT, $transaction);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction();

Customer customer = new Customer();
customer.setReference("A12345");
customer.setTitle("Mr.");
customer.setFirstName("John");
customer.setLastName("Smith");
customer.setCompanyName("eWay");
customer.setJobDescription("Java Developer");
customer.setPhone("09 889 0986");
customer.setMobile("09 889 6542");
customer.setUrl("http://ewaypayments.com");
customer.setCustomerDeviceIP("127.0.0.1");
customer.setEmail("demo@example.org");

Address address = new Address();
address.setStreet1("Level 5");
address.setStreet2("369 Queen Street");
address.setCity("Sydney");
address.setState("NSW");
address.setCountry("au");
address.setPostalCode("2000");
customer.setAddress(address);
transaction.setCustomer(customer);

ShippingDetails shippingDetail = new ShippingDetails();
shippingDetail.setFirstName("John");
shippingDetail.setLastName("Smith");
shippingDetail.setPhone("09 889 0986");
shippingDetail.setShippingMethod(ShippingMethod.LowCost);

Address shipAddress = new Address();
shipAddress.setStreet1("Level 5");
shipAddress.setStreet2("369 Queen Street");
shipAddress.setCity("Sydney");
shipAddress.setState("NSW");
shipAddress.setCountry("au");
shipAddress.setPostalCode("2000");
shippingDetail.setShippingAddress(shipAddress);
transaction.setShippingDetails(shippingDetail);

List<LineItem> items = new ArrayList<>();
LineItem item1 = new LineItem();
item1.setSku("12345678901234567890");
item1.setDescription("Item Description 1");
item1.setQuantity(1);
item1.setUnitCost(400);
item1.setTotalTax(100);
item1.setTotal(500);
items.add(item1);

LineItem item2 = new LineItem();
item2.setSku("123456789012");
item2.setDescription("Item Description 2");
item2.setQuantity(1);
item2.setUnitCost(400);
item2.setTotalTax(100);
item2.setTotal(500);
items.add(item2);

transaction.setLineItems(items);

List<String> options = new ArrayList<>();
options.add("Option1");
options.add("Option2");
transaction.setOptions(options);

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);
paymentDetails.setCurrencyCode("AUD");
paymentDetails.setInvoiceDescription("Individual Invoice Description");
paymentDetails.setInvoiceNumber("Inv 21540");
paymentDetails.setInvoiceReference("513456");
transaction.setPaymentDetails(paymentDetails);

transaction.setPartnerID("ID");
transaction.setCapture(true);
transaction.setRedirectURL("http://www.eway.com.au");
transaction.setDeviceID("D1234");
transaction.setTransactionType(TransactionType.Purchase);
transaction.setSaveCustomer(false);

CreateTransactionResponse response = client.create(PaymentMethod.TransparentRedirect, transaction);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction()
{
    Customer = new Customer()
    {
        Reference = "A12345",
        Title = "Mr.",
        FirstName = "John",
        LastName = "Smith",
        CompanyName = "Demo Shop 123",
        JobDescription = "C# Developer",
        Phone = "09 889 0986",
        Mobile = "09 889 6542",
        Url = "http://www.ewaypayments.com",
        Address = new Address()
        {
            Street1 = "Level 5",
            Street2 = "369 Queen Street",
            City = "Sydney",
            State = "NSW",
            Country = "au",
            PostalCode = "2000",
        }
    },
    ShippingDetails = new ShippingDetails()
    {
        FirstName = "John",
        LastName = "Smith",
        Phone = "09 889 0986",
        ShippingAddress = new Address()
        {
            Street1 = "Level 5",
            Street2 = "369 Queen Street",
            City = "Sydney",
            State = "NSW",
            Country = "au",
            PostalCode = "2000"
        },
        ShippingMethod = ShippingMethod.NextDay,
    },
    LineItems = new[] 
    {
        new LineItem()
        {
            SKU = "12345678901234567890", 
            Description = "Item Description 1",
            Quantity = 1,
            UnitCost = 400
        },
        new LineItem()
        {
            SKU = "123456789012", 
            Description = "Item Description 2",
            Quantity = 1,
            UnitCost = 400,
        }
    }.ToList(),
    Options = new[] 
    {
        "Option1", 
        "Option2" 
    }.ToList(),
    PaymentDetails = new PaymentDetails()
    {
        TotalAmount = 1000,
        InvoiceNumber = "Inv 21540",
        InvoiceDescription = "Individual Invoice Description",
        InvoiceReference = "513456",
        CurrencyCode = "AUD"
    },
    RedirectURL = "http://www.eway.com.au",
    DeviceID = "D1234",
    PartnerID = "ID",
    CustomerIP = "127.0.0.1",
    Capture = true,
    SaveCustomer = false,
    TransactionType = TransactionTypes.Purchase
};

CreateTransactionResponse response = ewayClient.Create(PaymentMethod.TransparentRedirect, transaction);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.TRANSPARENT_REDIRECT,{
    "Customer": {
       "Reference": "A12345",
       "Title": "Mr.",
       "FirstName": "John",
       "LastName": "Smith",
       "CompanyName": "Demo Shop 123",
       "JobDescription": "Developer",
       "Street1": "Level 5",
       "Street2": "369 Queen Street",
       "City": "Sydney",
       "State": "NSW",
       "PostalCode": "2000",
       "Country": "au",
       "Phone": "09 889 0986",
       "Mobile": "09 889 6542",
       "Email": "demo@example.org",
       "Url": "http://www.ewaypayments.com"
    },
    "ShippingAddress": {
       "ShippingMethod": "NextDay",
       "FirstName": "John",
       "LastName": "Smith",
       "Street1": "Level 5",
       "Street2": "369 Queen Street",
       "City": "Sydney",
       "State": "NSW",
       "Country": "au",
       "PostalCode": "2000",
       "Phone": "09 889 0986"
    },
    "Items": [
     {
       "SKU": "12345678901234567890",
       "Description": "Item Description 1",
       "Quantity": 1,
       "UnitCost": 400,
       "Tax": 100,
       "Total": 500
     },
     {
       "SKU": "123456789012",
       "Description": "Item Description 2",
       "Quantity": 1,
       "UnitCost": 400,
       "Tax": 100,
       "Total": 500
     }
    ],
    "Options": [
     {
       "Value": "Option1"
     },
     {
       "Value": "Option2"
     }
    ],
    "Payment": {
       "TotalAmount": 1000,
       "InvoiceNumber": "Inv 21540",
       "InvoiceDescription": "Individual Invoice Description",
       "InvoiceReference": "513456",
       "CurrencyCode": "AUD"
    },
    "RedirectUrl": "http://www.eway.com.au",
    "DeviceID": "D1234",
    "CustomerIP": "127.0.0.1",
    "PartnerID": "ID",
    "TransactionType": "Purchase",
    "Capture": true
}).then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new

customer = EwayRapid::Models::Customer.new
customer.reference = 'A12345'
customer.title = 'Mr.'
customer.first_name = 'John'
customer.last_name = 'Smith'
customer.company_name = 'Company'
customer.job_description = 'Ruby Developer'
customer.phone = '09 889 0986'
customer.mobile = '09 889 0986'
customer.fax = '09 654 1234'
customer.url = 'http://www.ewaypayments.com'
customer.comments = 'customer comment'
customer.customer_device_ip = '127.0.0.1'
customer.email = 'demo@example.org'

address = EwayRapid::Models::Address.new
address.street1 = 'Level 5'
address.street2 = '369 Queen Street'
address.city = 'Sydney'
address.state = 'NSW'
address.country = 'AU'
address.postal_code = '2000'
customer.address = address

transaction.customer = customer

shipping_details = EwayRapid::Models::ShippingDetails.new
shipping_address = EwayRapid::Models::Address.new
shipping_address.street1 = 'Level 5'
shipping_address.street2 = '369 Queen Street'
shipping_address.city = 'Sydney'
shipping_address.state = 'NSW'
shipping_address.country = 'AU'
shipping_address.postal_code = '2000'
shipping_details.shipping_address = shipping_address
shipping_details.first_name = 'John'
shipping_details.last_name = 'Smith'
shipping_details.phone = '09 889 0986'
shipping_details.shipping_method = EwayRapid::Enums::ShippingMethod::LOW_COST
transaction.shipping_details = shipping_details

line_item = EwayRapid::Models::LineItem.new
line_item.sku = '12345678901234567890'
line_item.description = 'Item Description 1'
line_item.quantity = 1
line_item.unit_cost = 400
line_item.tax = 100
line_item.total = 500

line_item1 = EwayRapid::Models::LineItem.new
line_item1.sku = '12345678901234567890'
line_item1.description = 'Item Description 1'
line_item1.quantity = 1
line_item1.unit_cost = 400
line_item1.tax = 100
line_item1.total = 500

line_item2 = EwayRapid::Models::LineItem.new
line_item2.sku = '123456789012'
line_item2.description = 'Item Description 2'
line_item2.quantity = 1
line_item2.unit_cost = 400
line_item2.tax = 100
line_item2.total = 500

line_items = []
line_items.push(line_item1)
line_items.push(line_item2)
transaction.line_items = line_items

options = []
options.push('Option1')
options.push('Option2')
transaction.options = options

payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
payment_details.invoice_number = 'Inv 21540'
payment_details.invoice_description = 'Individual Invoice Description'
payment_details.invoice_reference = '513456'
payment_details.currency_code = 'AUD'
transaction.payment_details = payment_details

transaction.redirect_url = 'http://www.eway.com.au'
transaction.device_id = 'D1234'
transaction.partner_id = 'ID'
transaction.capture = true
transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::TRANSPARENT_REDIRECT, transaction)

To request an Access Code, make a server-side call to the CreateAccessCode method of Rapid API. The service will respond with an Access Code, a Form Action URL and the customer data.

If the request involves an existing Token customer, their details will be returned in the response including the masked credit card number.

If Token Payments are not in use for this transaction, the returned customer data will be an echo of the data in the request.

Field Name Field Type Max Length Data Type Description
RedirectUrl R 512 string The web address the customer is redirected to with the result of the action.
Note that the eWAY AccessCode is appended as a query string parameter to the RedirectUrl – existing query string parameters are preserved.
CustomerIP O 50 string The customer’s IP address.
When this field is present along with the Customer Country field, any transaction will be processed using Beagle Fraud Alerts
Method R 20 string The action to perform with this request (see Payment Methods for more information).
One of: ProcessPayment, CreateTokenCustomer, UpdateTokenCustomer, TokenPayment, Authorise
TransactionType R Int enum The type of transaction you’re performing (see Transaction Types). Values: Purchase, MOTO, Recurring
DeviceID O 50 string The identification name/number for the device or application used to process the transaction.
PartnerID O 50 string The partner ID generated from an eWAY partner agreement.
CheckoutPayment O 6 boolean Setting this to “true” will process a PayPal Checkout payment.
CheckoutUrl O 512 string When CheckoutPayment is set to “true” you must specify a CheckoutURL for the customer to be returned to after logging in to their PayPal account.
Capture O 6 boolean Rapid SDK Libraries Only Set to true to capture funds immediately (default), set to false to perform an authorisation and only hold funds.
SaveCustomer O 6 boolean Rapid SDK Libraries Only Set to true to create a token customer when the transaction is complete

Field types: R – Required, O – Optional

Payment

This set of fields contains the details of the payment being processed. This section is required when the Method field is set to ProcessPayment or TokenPayment.

Field Name Field Type Max Length Data Type Description
TotalAmount R 10 int The amount of the transaction in the lowest denomination for the currency (e.g. a $27.00 transaction would have a TotalAmount value of ‘2700’).
The value of this field must be 0 for the CreateTokenCustomer and UpdateTokenCustomer methods. This field is required when the Action is ProcessPayment or TokenPayment.
InvoiceNumber O 12 string The merchant’s invoice number for this transaction.
InvoiceDescription O 64 string A short description of the purchase that the customer is making.
InvoiceReference O 50 string The merchant’s reference number for this transaction.
CurrencyCode O 3 string The ISO 4217 3 character code that represents the currency that this transaction is to be processed in. If no value for this field is provided, the merchant’s default currency is used. This should be in uppercase.
e.g. Australian Dollars = AUD

Customer

This set of fields contains the details of the customer.

Field Name Field Type Max Length Data Type Description
TokenCustomerID C 16 long An eWAY-issued ID that represents the Token customer to be loaded for this action.
Required for UpdateTokenCustomer method
Reference O 50 string The merchant’s reference for this customer.
Title† C 5 string The customer’s title, empty string allowed, which will default to Mr.
One of: Mr., Ms., Mrs., Miss, Dr., Sir., Prof.
FirstName† C 50 string The customer’s first name.
LastName† C 50 string The customer’s last name
CompanyName O 50 string The customer’s company name.
JobDescription O 50 string The customer’s job description / title.
Street1 O 50 string The customer’s street address.
Street2 O 50 string The customer’s street address.
City O 50 string The customer’s city / town / suburb.
State O 50 string The customer’s state / county.
PostalCode O 30 string The customer’s post / zip code.
Country† C 2 string The customer’s country. This should be the two letter ISO 3166-1 alpha-2 code. This field must be lower case.
e.g. Australia = au
Email O 50 string The customer’s email address, which must be correctly formatted if present.
Phone O 32 string The customer’s phone number.
Mobile O 32 string The customer’s mobile phone number.
Comments O 255 string Any comments the merchant wishes to add about the customer.
Fax O 32 string The customer’s fax number.
Url O 512 string The customer’s website, which must be correctly formatted if present.

Field Types: O – Optional, C – Conditionally Required

† When creating a new Token customer, all conditional fields(†)are required

Shipping Address

The ShippingAddress section is optional. It is used by Beagle Fraud Alerts (Enterprise) to calculate a risk score for this transaction.

Field Name Field Type Max Length Data Type Description
ShippingMethod C 16 long The method used to ship the customer’s order.
One of: Unknown, LowCost, DesignatedByCustomer, International, Military, NextDay, StorePickup, TwoDayService, ThreeDayService, Other
FirstName O 50 string The first name of the person the order is shipped to.
LastName O 50 string The last name of the person the order is shipped to.
Street1 O 50 string The street address the order is shipped to.
Street2 O 50 string The street address of the shipping location.
City O 50 string The customer’s shipping city / town / suburb.
State O 50 string The customer’s shipping state / county.
PostalCode O 30 string The customer’s shipping post / zip code.
Country† C 2 string The customer’s shipping country. This should be the two letter ISO 3166-1 alpha-2 code. This field must be lower case.
e.g. Australia = au
Email O 50 string The customer’s shipping email address, which must be correctly formatted if present.
Phone O 32 string The phone number of the person the order is shipped to.
Fax O 32 string The fax number of the shipping location.

Items

The Items section is optional. If provided, it should contain a list of line items purchased by the customer, up to a maximum of 99 items. It is used by Beagle Fraud Alerts (Enterprise) to calculate a risk score for this transaction, and by the Responsive Shared page and PayPal to display the order to the customer.

Items have the following fields:

Field Name Field Type Max Length Data Type Description
SKU O 12 string The stock keeping unit or name used to identify this line item.
Description O 26 string A brief description of the product.
Quantity O 6 int The purchased quantity.
UnitCost O 8 int The pre-tax cost per unit of the product in the lowest denomination
(e.g. 500 for $5.00)
Tax O 8 int The tax amount that applies to this line item in the lowest denomination
(e.g. 500 for $5.00)
Total O 8 int The total amount charged for this line item in the lowest denomination
(e.g. 500 for $5.00)

Options

This section is optional. Anything appearing in this section is not displayed to the customer, but it is returned to the merchant in the result. Up to 99 options can be defined. Each option has just one field:

Field Name Field Type Max Length Data Type Description
Value O 254 string This field is not displayed to the customer but is returned in the result. Anything can be used here, which can be useful for tracking transactions. Additional characters are truncated at 254

Example Response

{
    "AccessCode": "A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto",
    "Customer": {
        "TokenCustomerID": null,
        "Reference": "A12345",
        "Title": "Mr.",
        "FirstName": "John",
        "LastName": "Smith",
        "CompanyName": "Demo Shop 123",
        "JobDescription": "Developer",
        "Street1": "Level 5",
        "Street2": "369 Queen Street",
        "City": "Sydney",
        "State": "NSW",
        "PostalCode": "2000",
        "Country": "au",
        "Email": "",
        "Phone": "09 889 0986",
        "Mobile": "09 889 6542",
        "Comments": "",
        "Fax": "",
        "Url": "",
        "CardNumber": "",
        "CardStartMonth": "",
        "CardStartYear": "",
        "CardIssueNumber": "",
        "CardName": "",
        "CardExpiryMonth": "",
        "CardExpiryYear": "",
        "IsActive": false
    },
    "Payment": {
        "TotalAmount": 1000,
        "InvoiceNumber": "Inv 21540",
        "InvoiceDescription": "Individual Invoice Description",
        "InvoiceReference": "513456",
        "CurrencyCode": "AUD"
    },
    "FormActionURL": "https://secure-au.sandbox.ewaypayments.com/AccessCode/A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto",
    "CompleteCheckoutURL": null,
    "Errors": null
}

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <CreateAccessCodeResponse xmlns="https://api.ewaypayments.com/">
         <CreateAccessCodeResult>
            <AccessCode>A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto</AccessCode>
            <Customer>
               <TokenCustomerID xsi:nil="true"/>
               <Reference>A12345</Reference>
               <Title>Mr.</Title>
               <FirstName>John</FirstName>
               <LastName>Smith</LastName>
               <CompanyName>Demo Shop 123</CompanyName>
               <JobDescription>Developer</JobDescription>
               <Street1>Level 5</Street1>
               <Street2>369 Queen Street</Street2>
               <City>Sydney</City>
               <State>NSW</State>
               <PostalCode>2000</PostalCode>
               <Country>au</Country>
               <Email>demo@example.org</Email>
               <Phone>0289712345</Phone>
               <Mobile>0289712345</Mobile>
               <Comments>Customer comments</Comments>
               <Fax>0289712345</Fax>
               <Url>http://www.ewaypayments.com</Url>
               <CardNumber/>
               <CardStartMonth/>
               <CardStartYear/>
               <CardIssueNumber/>
               <CardName/>
               <CardExpiryMonth/>
               <CardExpiryYear/>
               <IsActive>false</IsActive>
            </Customer>
            <Payment>
               <TotalAmount>1000</TotalAmount>
               <InvoiceNumber>Inv 21540</InvoiceNumber>
               <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
               <InvoiceReference>Individual Invoice Description</InvoiceReference>
               <CurrencyCode>AUD</CurrencyCode>
            </Payment>
            <FormActionURL>https://secure-au.sandbox.ewaypayments.com/Process</FormActionURL>
         </CreateAccessCodeResult>
      </CreateAccessCodeResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available $response properties

if (!$response->getErrors()) {
    $accessCode = $response->AccessCode;
    $formUrl = $response->FormActionURL;
} else {
    foreach ($response->getErrors() as $error) {
        echo "Error: ".\Eway\Rapid::getMessage($error)."<br>";
    }
}

// See the JSON tab for all the available response properties

if (response.getErrors().isEmpty()) {
    String accessCode = response.getAccessCode();
    String formUrl = response.getFormActionUrl();
} else {
    for (String errorcode: response.getErrors()) {
        System.out.println("Response Messages: " + RapidSDK.userDisplayMessage(errorcode, "en"));
    };
}
// See the JSON tab for all the available response properties

if (response.Errors == null)
{
    string accessCode = response.AccessCode;
    string formUrl = response.FormActionUrl;
}
else
{
    foreach (string errorCode in response.Errors)
    {
        Console.WriteLine("Response Messages: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
    }
}
// See the JSON tab for all the available response properties

.then(function (response) {
    if (response.getErrors().length == 0) {
        var accessCode = response.get('AccessCode');
        var formUrl = response.get('FormActionURL');
    } else {
        response.getErrors().forEach(function(error) {
            console.log("Response Messages: " + rapid.getMessage(error, "en"));
        });
    }
})
.catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});
# See the JSON tab for all the available response properties

if response.errors.empty?
  access_code = response.access_code
  form_url = response.form_action_url
else
  response.errors.each { |e| puts "Response message: "+ EwayRapid::RapidClient.user_display_message(e) }
end

Response

The response received from eWAY will contain the Access Code that should be used for all further requests associated with this transaction.

The response will also contain the FormActionURL. This is the URL that the form should be posted to in Step 2 of the process.

Depending on the Method being used for this request, some additional information will be returned in the response.

If processing a payment, the response will also include an echo of the payment information submitted in the request.

If using an existing Token customer, the customer’s masked card data will be included in the response. This enables existing Token customers to elect to pay without having to enter their card details again, with the exception of the CVN, which cannot be stored.

Response field descriptions

Field Name Max Length Data Type Description
AccessCode 512 string A unique access code that is used to identify this transaction with Rapid API. This code will need to be present for all future requests associated with this transaction.
FormActionURL 512 string The URL that the form should be POSTed to in Step 2
TotalAmount 10 int The amount of the transaction in the lowest denomination, as passed in the original request.
e.g. $25.00 = 2500
InvoiceNumber 16 string The merchant’s invoice number for this transaction.
InvoiceDescription 64 string A description of the purchase that the customer is making.
InvoiceReference 50 string The merchant’s reference number for this transaction.
CurrencyCode 3 string The ISO 4217 3 character code that represents the currency that this transaction is to be processed in. If no value for this field is provided, the merchant’s default currency is used.
TokenCustomerID 16 long The token customer’s unique Token Customer ID. Only returned if included in the request with TokenPayment and UpdateTokenCustomer methods
Reference 50 string The merchant’s reference for this customer.
Title 5 string The customer’s title empty string allowed.
FirstName 50 string The customer’s first name.
LastName 50 string The customer’s last name.
CompanyName 50 string The customer’s company name.
JobDescription 50 string The customer’s job description / title.
Street1 50 string The customer’s street address.
Street2 50 string The customer’s street address.
City 50 string The customer’s city / town / suburb.
State 50 string The customer’s state / county.
PostalCode 50 string The customer’s post / zip code.
Country 2 string The customer’s country, formatted as a two letter ISO 3166-1 alpha-2 code.
Email 50 string The customer’s email address, which must be correctly formatted if present.
Phone 32 string The customer’s phone number.
Mobile 32 string The customer’s mobile phone number.
Comments 255 string Any comments the merchant wishes to add about the customer.
Fax 32 string The customer’s fax number.
Url 512 string The customer’s website.
CardNumber 50 string The Token customer’s masked credit card number.
CardName 50 string The Token customer’s card holder name.
CardExpiryMonth 2 string The Token customer’s card expiry month.
CardExpiryYear 2 string The Token customer’s card expiry year.
CardStartMonth* 2 string The Token customer’s card valid from month.
CardStartYear* 2 string The Token customer’s card valid from year.
CardIssueNumber* 2 string The Token customer’s card issue number.
AmexECEncryptedData 512 string v40+ (see versions) A token used to configure AMEX Express Checkout

*Applies to UK only

Step 2: Customer submits card details direct to eWAY

Once the merchant receives the Access Code response, the customer must be redirected to a secure page that contains an HTML form. eWAY will only accept data from forms that use the POST method. Any data posted from a form that has the method attribute set to GET will be rejected.

This request does not require the “Authorization” HTTP header, authentication is instead performed using the Access Code.

The form’s action attribute must be set to the URL returned in the FormActionURL of the response returned in Step 1.

The merchant’s form will need to contain the following input fields:

Example HTML form

<form method="POST" action="<<FormActionURL Goes Here>>" id="payment_form">
  <input type="hidden" name="EWAY_ACCESSCODE" value="<<AccessCode Goes Here>>" />
  <input type="hidden" name="EWAY_PAYMENTTYPE" value="Credit Card" />
  Card Name: <input type="text" name="EWAY_CARDNAME" />
  Card Number: <input type="text" name="EWAY_CARDNUMBER" />
  Card Expiry Month: <input type="text" name="EWAY_CARDEXPIRYMONTH" />
  Card Expiry Year: <input type="text" name="EWAY_CARDEXPIRYYEAR" />
  Card Start Date: <input type="text" name="EWAY_CARDSTARTMONTH" />
  Card Start Year: <input type="text" name="EWAY_CARDSTARTYEAR" />
  Card Issue Number: <input type="text" name="EWAY_CARDISSUENUMBER" />
  Card CVN: <input type="text" name="EWAY_CARDCVN" />
  <input type="submit" value="Process" text="Process" />
</form> 
Field Name Field Type Description
EWAY_ACCESSCODE R The Access Code returned in Step 1. The Access Code is case sensitive.
EWAY_PAYMENTTYPE O The type of payment you are processing. If this value is not present the payment is assumed to be a credit card payment and all values necessary to perform a credit card transaction are required.
One of: Credit Card, PayPal, MasterPass, VisaCheckout
EWAY_CARDNAME C The name of the card holder.
Not required if PaymentType is not Credit Card.
EWAY_CARDNUMBER C The card number that is to be processed for this transaction.
Not required if PaymentType is not Credit Card.
EWAY_CARDEXPIRYMONTH C The month that the card expires.
Not required if PaymentType is not Credit Card.
EWAY_CARDEXPIRYYEAR C The year that the card expires.
Not required if PaymentType is not Credit Card.
EWAY_CARDSTARTMONTH* O The month that the card is valid from.
Not required if PaymentType is not Credit Card.
EWAY_CARDSTARTYEAR* O The year that the card is valid from.
Not required if PaymentType is not Credit Card.
EWAY_CARDISSUENUMBER* O The card’s issue number
Not required if PaymentType is not Credit Card.
EWAY_CARDCVN C The Card Verification Number.
Only required when TransactionType is Purchase or not sent.
EWAY_ISREFERENCETRANSACTION O Indicates if this payment should be stored by PayPal for future use as a reference transaction. This field is Boolean.
EWAY_BILLINGAGREEMENTID O Indicates the billing agreement id to use for this transaction.
EWAY_NEWSHIPPINGTOTAL O If you have used PayPal Checkout you may submit a new shipping total based off the customer’s PayPal address.
VISA_CHECKOUT_CALLID† C Used to pass the Visa Checkout Call ID when implementing Visa Checkout
VISA_CHECKOUT_EVENTTYPE O Used to inform Visa if the Visa Checkout Call ID will be used.
One of Capture or Cancel (defaults to Capture)
VISA_CHECKOUT_RESPONSE O If supplied then should be the response from the Visa Checkout lightbox in JSON format.

Field Types: R – Required, O – Optional, C – Conditionally Required

*Applies to UK only

Required when using Visa Checkout

Once the customer has entered their card details, the form is submitted directly to eWAY.

What happens next depends on the Method selected by the merchant in the initial request.

In all cases, the customer’s browser will then be redirected to the URL specified in the RedirectURL field of the initial request.

AJAX with JSONP

Example Script

<script type="text/javascript">
  // Add the submit handler
  var form = document.getElementById("payment_form");
  if (form.addEventListener) {
    //Modern browsers
    form.addEventListener("submit", ewayAjax, false);  
  } else if (form.attachEvent) {
    //Old IE
    form.attachEvent('onsubmit', ewayAjax);            
  }

  function ewayAjax(e) {
    // call eWAY to process the request 
    eWAY.process(
      document.getElementById("payment_form"), 
      { 
        autoRedirect: false, 
        onComplete: function (data) { 
          // this is a callback to hook into when the requests completes 
          alert('The JSONP request has completed.'); 
          if (data.Is3DSecure) { 
            window.location.replace(data.RedirectUrl); 
          } 
        }, 
        onError: function (e) { 
          // this is a callback you can hook into when an error occurs 
          alert('There was an error processing the request'); 
        }, 
        onTimeout: function (e) { 
          // this is a callback you can hook into when the request times out
          alert('The request has timed out.'); 
        } 
      }
    );
    // Stop the form from submitting
    e.preventDefault();
  }
</script>

Transparent Redirect can be incorporated into an AJAX page using the JSONP submission script. To utilise JSONP, load the scripts into the page as follows:

<script type="text/javascript" src="https://api.ewaypayments.com/JSONP/v3/js"></script>

Then, to use JSONP in the form submission process a call to the method eWAY.process() is required. This should be called when the submit button is pressed, overriding the form’s default submission.

eWAY.process() takes two parameters:

Available Options and Callbacks

autoRedirect: Whether the page should redirect automatically to the returned RedirectUrl once the callback function has completed. The default value for this is true.

onComplete: The callback to run when the request completes successfully. In this callback, a data object is available that has the following properties: RedirectUrl, Is3DSecure, AccessCode

Note: When Is3Dsecure is set to true, the customer must be redirected to the RedirectUrl or they will not be able to successfully complete the transaction.

onError: The callback to run when an error occurs.

onTimeout: The callback to run when a timeout occurs. The timeout length is 90 seconds.

When an error or timeout occurs, the form should not be resubmitted. Instead, the merchant should proceed to step 3 and retrieve the results as a transaction may have occurred.

Step 3: Request the Results

Once the customer has been redirected to the final page, request the results from eWAY by calling the GetAccessCodeResult method of the Rapid API web service.

The final page will have the Access Code for the transaction appended RedirectUrl as the query string (as ?AccessCode=).

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.ewaypayments.com/AccessCode/{AccessCode}
HTTP POST (XML) https://api.ewaypayments.com/GetAccessCodeResult.xml
HTTP POST (JSON) https://api.ewaypayments.com/GetAccessCodeResult.json
RPC (XML) https://api.ewaypayments.com/xml-rpc
RPC (JSON) https://api.ewaypayments.com/json-rpc

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.sandbox.ewaypayments.com/AccessCode/{AccessCode}
HTTP POST (XML) https://api.sandbox.ewaypayments.com/GetAccessCodeResult.xml
HTTP POST (JSON) https://api.sandbox.ewaypayments.com/GetAccessCodeResult.json
RPC (XML) https://api.sandbox.ewaypayments.com/xml-rpc
RPC (JSON) https://api.sandbox.ewaypayments.com/json-rpc

Example request

curl --request GET \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    https://api.sandbox.ewaypayments.com/AccessCode/A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <GetAccessCodeResult xmlns="https://api.ewaypayments.com/">
         <request>
            <AccessCode>A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto</AccessCode>
         </request>
      </GetAccessCodeResult>
   </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$response = $client->queryTransaction('A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto');
RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

QueryTransactionResponse response = client.queryTransaction("A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto");
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

QueryTransactionResponse response = ewayClient.QueryTransaction("A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto");
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.queryTransaction("A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto")
.then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

response = client.query_transaction_by_access_code('A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto')

Request Field Descriptions

Field Name Field Type Max Length Data Type Description
AccessCode R 512 string The Access Code

Field Types: R – Required

If a transaction has been processed, the response received from eWAY will contain all relevant details such as the bank authorisation code and a unique number that identifies the transaction in eWAY’s database (TransactionID).

If a Token customer was involved, the ID that eWAY uses to identify that customer will also be returned.

All responses will contain a response code and response message that represents the result of the action performed.

If applicable, the response will also contain information about the payment that has been processed, as well as the results of any Beagle risk analysis that was performed.

Example response

{
  "AccessCode": "A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto",
  "AuthorisationCode": "849311",
  "ResponseCode": "00",
  "ResponseMessage": "A2000",
  "InvoiceNumber": "Inv 21540",
  "InvoiceReference": "513456",
  "TotalAmount": 1000,
  "TransactionID": 11237905,
  "TransactionStatus": true,
  "TokenCustomerID": null,
  "BeagleScore": 0,
  "Options": [{
    "Value": "Option1"
  }, {
    "Value": "Option2"
  }],
  "Verification": {
    "CVN": 0,
    "Address": 0,
    "Email": 0,
    "Mobile": 0,
    "Phone": 0
  },
  "BeagleVerification": {
    "Email": 0,
    "Phone": 0
  },
  "Errors": null
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <GetAccessCodeResultResponse xmlns="https://api.ewaypayments.com/">
         <GetAccessCodeResultResult>
            <AccessCode>A10012yIV2-MEEfkk7b7oYZqtulwNHv2dAFLv7T2guZEpjwBMHJoU-KxQihXVV10unFYbOUJ9Ob58oALLxn88_rzWDJhyq1-qW_hZ-xYjS3kdsCSNLtFHVESfDRVPWZqisLto</AccessCode>
            <AuthorisationCode>849311</AuthorisationCode>
            <ResponseCode>00</ResponseCode>
            <ResponseMessage>A2000</ResponseMessage>
            <InvoiceNumber>Inv 21540</InvoiceNumber>
            <InvoiceReference>513456</InvoiceReference>
            <TotalAmount>1000</TotalAmount>
            <TransactionID>11237905</TransactionID>
            <TransactionStatus>true</TransactionStatus>
            <TokenCustomerID xsi:nil="true"/>
            <BeagleScore>0</BeagleScore>
            <Options>
               <Option>
                  <Value>Option1</Value>
               </Option>
               <Option>
                  <Value>Option2</Value>
               </Option>
            </Options>
            <Verification>
               <CVN>Unchecked</CVN>
               <Address>Unchecked</Address>
               <Email>Unchecked</Email>
               <Mobile>Unchecked</Mobile>
               <Phone>Unchecked</Phone>
            </Verification>
            <BeagleVerification>
               <Email>NotVerified</Email>
               <Phone>NotVerified</Phone>
            </BeagleVerification>
         </GetAccessCodeResultResult>
      </GetAccessCodeResultResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available properties

$transactionResponse = $response->Transactions[0];

if ($transactionResponse->TransactionStatus) {
    echo 'Payment successful! ID: '.$transactionResponse->TransactionID;
} else {
    $errors = split(', ', $transactionResponse->ResponseMessage);
    foreach ($errors as $error) {
        echo "Payment failed: ".\Eway\Rapid::getMessage($error)."<br>";
    }
}

// See the JSON tab for all the available properties

if (response.getTransactionStatus().isStatus()) {
    System.out.println("Payment successful! ID: " + response.getTransactionStatus().getTransactionID());
} else {
    String[] errorcodes = response.getTransactionStatus().getProcessingDetails().getResponseMessage().split(",");
    for (String errorcode: errorcodes) {
        System.out.println("Response Messages: " + RapidSDK.userDisplayMessage(errorcode.trim(), "en"));
    }
}
// See the JSON tab for all the available properties

if ((bool)response.TransactionStatus.Status)
{
    Console.WriteLine("Payment successful! ID: " + response.TransactionStatus.TransactionID);
}
else
{
    string[] errorCodes = response.TransactionStatus.ProcessingDetails.getResponseMessages();
    foreach (string errorCode in errorCodes)
    {
        Console.WriteLine("Response Message: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
    }
}
// See the JSON tab for all the available properties

.then(function (response) {
    if (response.get('Transactions[0].TransactionStatus')) {
        console.log('Payment successful! ID: ' + response.get('Transactions[0].TransactionID'));
    } else {
        var errorCodes = response.get('Transactions[0].ResponseMessage').split(', ');
        errorCodes.forEach(function(errorCode) {
            console.log("Response Message: " + rapid.getMessage(errorCode, "en"));
        });
    }
}).catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});

if response.transaction_status.status?
  puts "Payment successful! ID: #{response.transaction_status.transaction_id.to_s}"
else
  puts "Failed! Message #{response.transaction_status.processing_details.response_message}"
end

Response field Descriptions

Field Name Max Length Data Type Description
AccessCode 512 string An echo of the access code used in the request
AuthorisationCode 6 string The authorisation code for this transaction as returned by the bank
ResponseCode 2 string The two digit response code returned from the bank
ResponseMessage 512 string One or more Response Codes that describes the result of the action performed.
If a Beagle Alert is triggered, this may contain multiple codes:
e.g. D4405, F7003
InvoiceNumber 64 string An echo of the merchant’s invoice number for this transaction
InvoiceReference 64 string An echo of the merchant’s reference number for this transaction
TotalAmount 10 int The amount that was authorised for this transaction
TransactionID 8 int A unique identifier that represents the transaction in eWAY’s system
TransactionStatus 16 boolean A Boolean value that indicates whether the transaction was successful or not
TokenCustomerID‡ 16 long An eWAY-issued ID that represents the Token customer that was loaded or created for this transaction (if applicable)
BeagleScore** 6 string Fraud score representing the estimated probability that the order is fraud. A value between 0.01 to 100.00 representing the % risk the transaction is fraudulent. On Sandbox the score will be -1 unless it is configured to fail for Risk Score, in which case the value will be 101.
Errors 512 string A comma separated list of any error encountered, these can be looked up in the Response Codes section.

** This field is only present if the transaction was processed using Beagle Free

This field is only present if processing a Token transaction, creating or updating a Token customer

Options

The Options collection passed in the original request will be echoed back in the response here.

Field Name Max Length Data Type Description
Value 255 string An echo of the option submitted for this transaction

Verification

These fields are currently unused

Field Name Max Length Data Type Description
CVN 10 string
Address 10 string
Email 10 string
Mobile 10 string
Phone 10 string

Beagle Verification

This will contain the results of the Beagle Verification identification checks that may have been performed. These will be returned are only active with the Responsive Shared Page.

Field Name Max Length Data Type Description
Email 11 string The result of the email verification
Phone 11 string The result of the phone verification

Direct Connection

The Direct Connection API allows for purchases to be submitted directly to eWAY from your server. This allows processing of transactions in one, simple server side call.

Since card data is passed via the server, one of the following must be used to ensure compliance with card data regulations:

Transactions not involving credit card data (such as a recurring token payment) may be processed without proof of compliance. In the eWAY Sandbox, PCI compliance can be enabled via the Sandbox Settings.

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.ewaypayments.com/Transaction
HTTP POST (XML) https://api.ewaypayments.com/DirectPayment.xml
HTTP POST (JSON) https://api.ewaypayments.com/DirectPayment.json
RPC (XML) https://api.ewaypayments.com/xml-rpc
RPC (JSON) https://api.ewaypayments.com/json-rpc

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.sandbox.ewaypayments.com/Transaction
HTTP POST (XML) https://api.sandbox.ewaypayments.com/DirectPayment.xml
HTTP POST (JSON) https://api.sandbox.ewaypayments.com/DirectPayment.json
RPC (XML) https://api.sandbox.ewaypayments.com/xml-rpc
RPC (JSON) https://api.sandbox.ewaypayments.com/json-rpc

Request field descriptions

Basic Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
        "Customer": { 
           "CardDetails": { 
             "Name": "John Smith", 
             "Number": "4444333322221111", 
             "ExpiryMonth": "12", 
             "ExpiryYear": "25",
             "CVN": "123" 
           }
        }, 
        "Payment": {
           "TotalAmount": 1000
        },
        "Method": "ProcessPayment",
        "TransactionType": "Purchase"
        }' \
    https://api.sandbox.ewaypayments.com/Transaction
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <DirectPayment xmlns="https://api.ewaypayments.com/">
            <request>
                <Customer>
                    <CardDetails>
                        <Number>4444333322221111</Number>
                        <Name>John Smith</Name>
                        <ExpiryMonth>12</ExpiryMonth>
                        <ExpiryYear>25</ExpiryYear>
                        <CVN>123</CVN>
                    </CardDetails>
                </Customer>
                <Payment>
                    <TotalAmount>1000</TotalAmount>
                </Payment>
                <Method>ProcessPayment</Method>
                <TransactionType>Purchase</TransactionType>
            </request>
        </DirectPayment>
    </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'Customer' => [
        'CardDetails' => [
            'Name' => 'John Smith',
            'Number' => '4444333322221111',
            'ExpiryMonth' => '12',
            'ExpiryYear' => '25',
            'CVN' => '123',
        ]
    ],
    'Payment' => [
        'TotalAmount' => 1000,
    ],
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction);
RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction();
Customer customer = new Customer();

CardDetails cardDetails = new CardDetails();
cardDetails.setName("John Smith");
cardDetails.setNumber("4444333322221111");
cardDetails.setExpiryMonth("12");
cardDetails.setExpiryYear("25");
cardDetails.setCVN("123");
customer.setCardDetails(cardDetails);

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);

transaction.setCustomer(customer);
transaction.setPaymentDetails(paymentDetails);
transaction.setTransactionType(TransactionType.Purchase);

CreateTransactionResponse response = client.create(PaymentMethod.Direct, transaction);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction()
{
    Customer = new Customer() 
    {
        CardDetails  = new CardDetails()
        {
            Name = "John Smith",
            Number = "4444333322221111",
            ExpiryMonth = "11",
            ExpiryYear = "25",
            CVN = "123"
        }
    },
    PaymentDetails = new PaymentDetails()
    {
        TotalAmount = 1000
    },
    TransactionType = TransactionTypes.Purchase
};

CreateTransactionResponse response = ewayClient.Create(PaymentMethod.Direct, transaction);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.DIRECT, {
    "Customer": {
       "CardDetails": {
         "Name": "John Smith",
         "Number": "4444333322221111",
         "ExpiryMonth": "12",
         "ExpiryYear": "25",
         "CVN": "123"
       }
    },
    "Payment": {
       "TotalAmount": 1000
    },
    "TransactionType": "Purchase"
}).then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new

transaction.customer = EwayRapid::Models::Customer.new
card_details = EwayRapid::Models::CardDetails.new
card_details.name = 'John Smith'
card_details.number = '4444333322221111'
card_details.expiry_month = '05'
card_details.expiry_year = '25'
card_details.cvn = '123'
transaction.customer.card_details = card_details

payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
transaction.payment_details = payment_details

transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::DIRECT, transaction)

Complete Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{ 
        "Customer": { 
           "Reference": "A12345", 
           "Title": "Mr.", 
           "FirstName": "John", 
           "LastName": "Smith", 
           "CompanyName": "Demo Shop 123", 
           "JobDescription": "Developer", 
           "Street1": "Level 5", 
           "Street2": "369 Queen Street", 
           "City": "Sydney", 
           "State": "NSW", 
           "PostalCode": "2000", 
           "Country": "au", 
           "Phone": "09 889 0986", 
           "Mobile": "09 889 6542",
           "Email": "demo@example.org",
           "Url": "http://www.ewaypayments.com",
            "CardDetails": { 
             "Name": "John Smith", 
             "Number": "4444333322221111", 
             "ExpiryMonth": "12", 
             "ExpiryYear": "25", 
             "StartMonth" : "01", 
             "StartYear" : "13", 
             "IssueNumber": "01", 
             "CVN": "123" 
           }
        }, 
        "ShippingAddress": {
           "ShippingMethod": "NextDay",
           "FirstName": "John",
           "LastName": "Smith",
           "Street1": "Level 5", 
           "Street2": "369 Queen Street", 
           "City": "Sydney", 
           "State": "NSW", 
           "Country": "au", 
           "PostalCode": "2000",
           "Phone": "09 889 0986" 
        }, 
        "Items": [ 
         { 
           "SKU": "12345678901234567890", 
           "Description": "Item Description 1",
           "Quantity": 1,
           "UnitCost": 400,
           "Tax": 100,
           "Total": 500
         }, 
         { 
           "SKU": "123456789012", 
           "Description": "Item Description 2", 
           "Quantity": 1,
           "UnitCost": 400,
           "Tax": 100,
           "Total": 500
         }
        ], 
        "Options": [ 
         { 
           "Value": "Option1" 
         }, 
         { 
           "Value": "Option2" 
         }
        ], 
        "Payment": { 
           "TotalAmount": 1000, 
           "InvoiceNumber": "Inv 21540", 
           "InvoiceDescription": "Individual Invoice Description", 
           "InvoiceReference": "513456",
           "CurrencyCode": "AUD"
        }, 
        "Method": "ProcessPayment", 
        "DeviceID": "D1234", 
        "CustomerIP": "127.0.0.1", 
        "PartnerID": "ID", 
        "TransactionType": "Purchase"
        }' \
    https://api.sandbox.ewaypayments.com/Transaction
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <DirectPayment xmlns="https://api.ewaypayments.com/">
            <request>
                <Customer>
                    <Reference>A12345</Reference>
                    <Title>Mr.</Title>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <CompanyName>Demo Shop 123</CompanyName>
                    <JobDescription>Developer</JobDescription>
                    <Street1>Level 5</Street1>
                    <Street2>369 Queen Street</Street2>
                    <City>Sydney</City>
                    <State>NSW</State>
                    <PostalCode>2000</PostalCode>
                    <Country>au</Country>
                    <Email>demo@example.org</Email>
                    <Phone>0289712345</Phone>
                    <Mobile>0289712345</Mobile>
                    <Comments>Customer comments</Comments>
                    <Fax>0289712345</Fax>
                    <Url>http://www.ewaypayments.com</Url>
                    <CardDetails>
                        <Number>4444333322221111</Number>
                        <Name>John Smith</Name>
                        <ExpiryMonth>12</ExpiryMonth>
                        <ExpiryYear>25</ExpiryYear>
                        <CVN>123</CVN>
                    </CardDetails>
                </Customer>
                <ShippingAddress>
                    <ShippingMethod>NextDay</ShippingMethod>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <Street1>Level 5</Street1>
                    <Street2>369 Queen Street</Street2>
                    <City>Sydney</City>
                    <State>NSW</State>
                    <PostalCode>2000</PostalCode>
                    <Country>au</Country>
                    <Email>demo@example.org</Email>
                    <Phone>0289712345</Phone>
                    <Fax>0289712345</Fax>
                </ShippingAddress>
                <Items>
                    <LineItem>
                        <SKU>12345678901234567890</SKU>
                        <Description>Item Description 1</Description>
                        <Quantity>1</Quantity>
                        <UnitCost>400</UnitCost>
                        <Tax>100</Tax>
                        <Total>500</Total>
                    </LineItem>
                    <LineItem>
                        <SKU>123456789012</SKU>
                        <Description>Item Description 2</Description>
                        <Quantity>1</Quantity>
                        <UnitCost>400</UnitCost>
                        <Tax>100</Tax>
                        <Total>500</Total>
                    </LineItem>
                </Items>
                <Options>
                    <Option>
                        <Value>Option1</Value>
                    </Option>
                    <Option>
                        <Value>Option2</Value>
                    </Option>
                </Options>
                <Payment>
                    <TotalAmount>1000</TotalAmount>
                    <InvoiceNumber>Inv 21540</InvoiceNumber>
                    <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
                    <InvoiceReference>Individual Invoice Description</InvoiceReference>
                    <CurrencyCode>AUD</CurrencyCode>
                </Payment>
                <CustomerIP>127.0.0.1</CustomerIP>
                <TransactionType>Purchase</TransactionType>
                <Method>ProcessPayment</Method>
                <DeviceID>D1234</DeviceID>
            </request>
        </DirectPayment>
    </soap:Body>
</soap:Envelope>

<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'Customer' => [
        'Reference' => 'A12345',
        'Title' => 'Mr.',
        'FirstName' => 'John',
        'LastName' => 'Smith',
        'CompanyName' => 'Demo Shop 123',
        'JobDescription' => 'Developer',
        'Street1' => 'Level 5',
        'Street2' => '369 Queen Street',
        'City' => 'Sydney',
        'State' => 'NSW',
        'PostalCode' => '2000',
        'Country' => 'au',
        'Phone' => '09 889 0986',
        'Mobile' => '09 889 6542',
        'Email' => 'demo@example.org',
        "Url" => "http://www.ewaypayments.com",
        'CardDetails' => [
            'Name' => 'John Smith',
            'Number' => '4444333322221111',
            'ExpiryMonth' => '12',
            'ExpiryYear' => '25',
            'CVN' => '123',
        ]
    ],
    'ShippingAddress' => [
        'ShippingMethod' => \Eway\Rapid\Enum\ShippingMethod::NEXT_DAY,
        'FirstName' => 'John',
        'LastName' => 'Smith',
        'Street1' => 'Level 5',
        'Street2' => '369 Queen Street',
        'City' => 'Sydney',
        'State' => 'NSW',
        'Country' => 'au',
        'PostalCode' => '2000',
        'Phone' => '09 889 0986',
    ],
    'Items' => [
        [
            'SKU' => '12345678901234567890',
            'Description' => 'Item Description 1',
            'Quantity' => 1,
            'UnitCost' => 400,
            'Tax' => 100,
            // Total is calculated automatically
        ],
        [
            'SKU' => '123456789012',
            'Description' => 'Item Description 2',
            'Quantity' => 1,
            'UnitCost' => 400,
            'Tax' => 100,
        ],
    ],
    'Options' => [
        [
            'Value' => 'Option1',
        ],
        [
            'Value' => 'Option2',
        ],
    ],
    'Payment' => [
        'TotalAmount' => 1000,
        'InvoiceNumber' => 'Inv 21540',
        'InvoiceDescription' => 'Individual Invoice Description',
        'InvoiceReference' => '513456',
        'CurrencyCode' => 'AUD',
    ],
    'DeviceID' => 'D1234',
    'CustomerIP' => '127.0.0.1',
    'PartnerID' => 'ID',
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
    'Capture' => true,
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction();

Customer customer = new Customer();
customer.setReference("A12345");
customer.setTitle("Mr.");
customer.setFirstName("John");
customer.setLastName("Smith");
customer.setCompanyName("eWay");
customer.setJobDescription("Java Developer");
customer.setPhone("09 889 0986");
customer.setMobile("09 889 6542");
customer.setUrl("http://ewaypayments.com");
customer.setCustomerDeviceIP("127.0.0.1");
customer.setEmail("demo@example.org");

Address address = new Address();
address.setStreet1("Level 5");
address.setStreet2("369 Queen Street");
address.setCity("Sydney");
address.setState("NSW");
address.setCountry("au");
address.setPostalCode("2000");
customer.setAddress(address);

CardDetails cardDetails = new CardDetails();
cardDetails.setName("John Smith");
cardDetails.setNumber("4444333322221111");
cardDetails.setExpiryMonth("12");
cardDetails.setExpiryYear("25");
cardDetails.setStartMonth("01");
cardDetails.setStartYear("13");
cardDetails.setIssueNumber("01");
cardDetails.setCVN("123");
customer.setCardDetails(cardDetails);
transaction.setCustomer(customer);

ShippingDetails shippingDetail = new ShippingDetails();
shippingDetail.setFirstName("John");
shippingDetail.setLastName("Smith");
shippingDetail.setPhone("09 889 0986");
shippingDetail.setShippingMethod(ShippingMethod.LowCost);

Address shipAddress = new Address();
shipAddress.setStreet1("Level 5");
shipAddress.setStreet2("369 Queen Street");
shipAddress.setCity("Sydney");
shipAddress.setState("NSW");
shipAddress.setCountry("au");
shipAddress.setPostalCode("2000");
shippingDetail.setShippingAddress(shipAddress);
transaction.setShippingDetails(shippingDetail);

List<LineItem> items = new ArrayList<>();
LineItem item1 = new LineItem();
item1.setSku("12345678901234567890");
item1.setDescription("Item Description 1");
item1.setQuantity(1);
item1.setUnitCost(400);
item1.setTotalTax(100);
item1.setTotal(500);
items.add(item1);

LineItem item2 = new LineItem();
item2.setSku("123456789012");
item2.setDescription("Item Description 2");
item2.setQuantity(1);
item2.setUnitCost(400);
item2.setTotalTax(100);
item2.setTotal(500);
items.add(item2);

transaction.setLineItems(items);

List<String> options = new ArrayList<>();
options.add("Option1");
options.add("Option2");
transaction.setOptions(options);

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);
paymentDetails.setCurrencyCode("AUD");
paymentDetails.setInvoiceDescription("Individual Invoice Description");
paymentDetails.setInvoiceNumber("Inv 21540");
paymentDetails.setInvoiceReference("513456");
transaction.setPaymentDetails(paymentDetails);

transaction.setPartnerID("ID");
transaction.setCapture(true);
transaction.setDeviceID("D1234");
transaction.setTransactionType(TransactionType.Purchase);

CreateTransactionResponse response = client.create(PaymentMethod.Direct, transaction);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction()
{
    Customer = new Customer()
    {
        Reference = "A12345",
        Title = "Mr.",
        FirstName = "John",
        LastName = "Smith",
        CompanyName = "Demo Shop 123",
        JobDescription = "C# Developer",
        Phone = "09 889 0986",
        Mobile = "09 889 6542",
        Url = "http://www.ewaypayments.com",
        Address = new Address()
        {
            Street1 = "Level 5",
            Street2 = "369 Queen Street",
            City = "Sydney",
            State = "NSW",
            Country = "au",
            PostalCode = "2000",

        },
        CardDetails = new CardDetails()
        {
            Name = "John Smith",
            Number = "4444333322221111",
            ExpiryMonth = "11",
            ExpiryYear = "25",
            StartMonth = "01",
            StartYear = "13",
            IssueNumber = "01",
            CVN = "123"
        }
    },
    ShippingDetails = new ShippingDetails()
    {
        FirstName = "John",
        LastName = "Smith",
        Phone = "09 889 0986",
        ShippingAddress = new Address()
        {
            Street1 = "Level 5",
            Street2 = "369 Queen Street",
            City = "Sydney",
            State = "NSW",
            Country = "au",
            PostalCode = "2000"
        },
        ShippingMethod = ShippingMethod.NextDay,
    },
    LineItems = new[] 
    { 
        new LineItem()
        {
            SKU = "12345678901234567890", 
            Description = "Item Description 1",
            Quantity = 1,
            UnitCost = 400
        },
        new LineItem()
        {
            SKU = "123456789012", 
            Description = "Item Description 2",
            Quantity = 1,
            UnitCost = 400,
        }
    }.ToList(),
    Options = new[] 
    { 
        "Option1", 
        "Option2" 
    }.ToList(),
    PaymentDetails = new PaymentDetails()
    {
        TotalAmount = 1000,
        InvoiceNumber = "Inv 21540",
        InvoiceDescription = "Individual Invoice Description",
        InvoiceReference = "513456",
        CurrencyCode = "AUD"
    },
    DeviceID = "D1234",
    PartnerID = "ID",
    CustomerIP = "127.0.0.1",
    TransactionType = TransactionTypes.Purchase,
    Capture = true
};

CreateTransactionResponse response = ewayClient.Create(PaymentMethod.Direct, transaction);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.DIRECT, {
    "Customer": {
       "Reference": "A12345",
       "Title": "Mr.",
       "FirstName": "John",
       "LastName": "Smith",
       "CompanyName": "Demo Shop 123",
       "JobDescription": "Developer",
       "Street1": "Level 5",
       "Street2": "369 Queen Street",
       "City": "Sydney",
       "State": "NSW",
       "PostalCode": "2000",
       "Country": "au",
       "Phone": "09 889 0986",
       "Mobile": "09 889 6542",
       "Email": "demo@example.org",
       "Url": "http://www.ewaypayments.com",
        "CardDetails": {
         "Name": "John Smith",
         "Number": "4444333322221111",
         "ExpiryMonth": "12",
         "ExpiryYear": "25",
         "StartMonth" : "01",
         "StartYear" : "13",
         "IssueNumber": "01",
         "CVN": "123"
       }
    },
    "ShippingAddress": {
       "ShippingMethod": "NextDay",
       "FirstName": "John",
       "LastName": "Smith",
       "Street1": "Level 5",
       "Street2": "369 Queen Street",
       "City": "Sydney",
       "State": "NSW",
       "Country": "au",
       "PostalCode": "2000",
       "Phone": "09 889 0986"
    },
    "Items": [
     {
       "SKU": "12345678901234567890",
       "Description": "Item Description 1",
       "Quantity": 1,
       "UnitCost": 400,
       "Tax": 100,
       "Total": 500
     },
     {
       "SKU": "123456789012",
       "Description": "Item Description 2",
       "Quantity": 1,
       "UnitCost": 400,
       "Tax": 100,
       "Total": 500
     }
    ],
    "Options": [
     {
       "Value": "Option1"
     },
     {
       "Value": "Option2"
     }
    ],
    "Payment": {
       "TotalAmount": 1000,
       "InvoiceNumber": "Inv 21540",
       "InvoiceDescription": "Individual Invoice Description",
       "InvoiceReference": "513456",
       "CurrencyCode": "AUD"
    },
    "DeviceID": "D1234",
    "CustomerIP": "127.0.0.1",
    "PartnerID": "ID",
    "TransactionType": "Purchase",
    "Capture": true
}).then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new

customer = EwayRapid::Models::Customer.new
customer.reference = 'A12345'
customer.title = 'Mr.'
customer.first_name = 'John'
customer.last_name = 'Smith'
customer.company_name = 'Company'
customer.job_description = 'Ruby Developer'
customer.phone = '09 889 0986'
customer.mobile = '09 889 0986'
customer.fax = '09 654 1234'
customer.url = 'http://www.ewaypayments.com'
customer.comments = 'customer comment'
customer.customer_device_ip = '127.0.0.1'
customer.email = 'demo@example.org'

card_details = EwayRapid::Models::CardDetails.new
card_details.name = 'John Smith'
card_details.number = '4444333322221111'
card_details.expiry_month = '05'
card_details.expiry_year = '25'
card_details.cvn = '123'
customer.card_details = card_details

address = EwayRapid::Models::Address.new
address.street1 = 'Level 5'
address.street2 = '369 Queen Street'
address.city = 'Sydney'
address.state = 'NSW'
address.country = 'AU'
address.postal_code = '2000'
customer.address = address

transaction.customer = customer

shipping_details = EwayRapid::Models::ShippingDetails.new
shipping_address = EwayRapid::Models::Address.new
shipping_address.street1 = 'Level 5'
shipping_address.street2 = '369 Queen Street'
shipping_address.city = 'Sydney'
shipping_address.state = 'NSW'
shipping_address.country = 'AU'
shipping_address.postal_code = '2000'
shipping_details.shipping_address = shipping_address
shipping_details.first_name = 'John'
shipping_details.last_name = 'Smith'
shipping_details.phone = '09 889 0986'
shipping_details.shipping_method = EwayRapid::Enums::ShippingMethod::LOW_COST
transaction.shipping_details = shipping_details

line_item = EwayRapid::Models::LineItem.new
line_item.sku = '12345678901234567890'
line_item.description = 'Item Description 1'
line_item.quantity = 1
line_item.unit_cost = 400
line_item.tax = 100
line_item.total = 500

line_item1 = EwayRapid::Models::LineItem.new
line_item1.sku = '12345678901234567890'
line_item1.description = 'Item Description 1'
line_item1.quantity = 1
line_item1.unit_cost = 400
line_item1.tax = 100
line_item1.total = 500

line_item2 = EwayRapid::Models::LineItem.new
line_item2.sku = '123456789012'
line_item2.description = 'Item Description 2'
line_item2.quantity = 1
line_item2.unit_cost = 400
line_item2.tax = 100
line_item2.total = 500

line_items = []
line_items.push(line_item1)
line_items.push(line_item2)
transaction.line_items = line_items

options = []
options.push('Option1')
options.push('Option2')
transaction.options = options

payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
payment_details.invoice_number = 'Inv 21540'
payment_details.invoice_description = 'Individual Invoice Description'
payment_details.invoice_reference = '513456'
payment_details.currency_code = 'AUD'
transaction.payment_details = payment_details

transaction.device_id = 'D1234'
transaction.partner_id = 'ID'
transaction.capture = true
transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::DIRECT, transaction)
Field Name Field Type Max Length Data Type Description
CustomerIP** O 50 string The customer’s IP address
Method R 20 string The action to perform with this request (see Payment Methods for more information).
One of: ProcessPayment, CreateTokenCustomer, UpdateTokenCustomer, TokenPayment, Authorise
TransactionType R 20 enum The type of transaction you’re performing (see Transaction Types).
One of: Purchase, MOTO, Recurring
DeviceID O 50 string The identification name/number for the device or application used to process the transaction
PartnerID O 50 string The partner ID generated from an eWAY partner agreement
ThirdPartyWalletID O 50 string This field has been deprecated, please use SecuredCardData instead
SecuredCardData O 500 string Card data ID, used for Secure Fields, Visa Checkout, AMEX Express Checkout and Android Pay
Capture O 6 boolean Rapid SDK Libraries Only Set to true to capture funds immediately (default), set to false to perform an authorisation and only hold funds.

Field types: R – Required, O – Optional

**When this field is present along with the Customer Country field, any transaction will be processed using Beagle Fraud Alerts

Payment

This set of fields contains the details of the payment being processed. This section is required when the Method field is set to ProcessPayment or TokenPayment.

Field Name Field Type Max Length Data Type Description
TotalAmount^ R 10 int The amount of the transaction in the lowest denomination for the currency (e.g. a $27.00 transaction would have a TotalAmount value of 2700).
The value of this field must be 0 for the CreateTokenCustomer and UpdateTokenCustomer methods
InvoiceNumber O 12 string The merchant’s invoice number for this transaction
InvoiceDescription O 64 string A description of the purchase that the customer is making
InvoiceReference O 50 string The merchant’s reference number for this transaction
CurrencyCode O 3 string The ISO 4217 3 character code that represents the currency that this transaction is to be processed in. If no value for this field is provided, the merchant’s default currency is used. This should be in uppercase.
e.g. Australian Dollars = AUD

Field types: R – Required, C – Conditionally Required, O – Optional

^ This field is required when the Action is ProcessPayment or TokenPayment

Customer

This set of fields contains the details of the merchant’s customer. These are used when creating and updating Token customers.

Field Name Field Type Max Length Data Type Description
TokenCustomerID C 16 long An eWAY issued ID that represents the Token customer to be loaded for this action.
Required for UpdateTokenCustomer method
Reference O 50 string The merchant’s reference for this customer
Title† C 5 string The customer’s title, empty string allowed.
One of: Mr., Ms., Mrs., Miss, Dr., Sir., Prof.
FirstName† C 50 string The customer’s first name
LastName† C 50 string The customer’s last name
CompanyName O 50 string The customer’s company name
JobDescription O 50 string The customer’s job description / title
Street1 O 50 string The customer’s street address
Street2 O 50 string The customer’s street address
City O 50 string The customer’s city / town / suburb
State O 50 string The customer’s state / county
PostalCode O 30 string The customer’s post / zip code
Country†** C 2 string The customer’s country. This should be the two letter ISO 3166-1 alpha-2 code. This field must be lower case.
e.g. Australia = au
Email O 50 string The customer’s email address, which must be correctly formatted if present
Phone O 32 string The customer’s phone number
Mobile O 32 string The customer’s fax number
Comments O 255 string Any comments the merchant wishes to add about the customer
Fax O 32 string The customer’s fax number
Url O 512 string The customer’s website, which must be correctly formatted if present

Field Types: O – Optional, C – Conditionally Required

† When creating a new Token customer, all conditional fields(†)are required

**When this field is present, along with the customer’s IP address, any transaction will be processed using Beagle

Card Details

The card details section is within the Customer section and is used to pass the customer’s card details for the transaction.

Field Name Field Type Max Length Data Type Description
Name C 50 string The name of the card holder
Number C 50 int The card number that is to be processed for this transaction. (Not required when processing using an existing CustomerTokenID with TokenPayment method). This should be the encrypted value if using Client Side Encryption.
ExpiryMonth C 2 int The month that the card expires.
(Not required when processing using an existing Customer TokenID with TokenPayment method)
ExpiryYear C 2 int The year that the card expires.
(Not required when processing using an existing CustomerTokenID with TokenPayment method)
StartMonth* O 2 int The month that the card is valid from
StartYear* O 2 int The year that the card is valid from
IssueNumber* O 2 int The card’s issue number
CVN C 4 int The Card Verification Number. This should be the encrypted value if using Client Side Encryption. (Required if the TransactionTye is Purchase)

Field Types: R – Required, O – Optional, C – Conditionally Required

*Applies to UK only

Shipping Address

The ShippingAddress section is optional. It is used by Beagle Fraud Alerts (Enterprise) to calculate a risk score for this transaction.

Field Name Field Type Max Length Data Type Description
ShippingMethod O 30 string The method used to ship the customer’s order
One of: Unknown, LowCost, DesignatedByCustomer, International, Military, NextDay, StorePickup, TwoDayService, ThreeDayService, Other
FirstName O 50 string The first name of the person the order is shipped to
LastName O 50 string last name of the person the order is shipped to
Street1 O 50 string The street address the order is shipped to
Street2 O 50 string The street address of the shipping location
City O 50 string The city / suburb of the shipping location
State O 50 string The state / county of the shipping location
PostalCode O 30 string The post / zip code of the shipping location
Country C 2 string The country of the shipping location. This should be the two letter ISO 3166-1 alpha-2 code. This field must be lower case.
e.g. Australia = au
Email O 50 string The email address of the person the order is shipped to, which must be correctly formatted if present.
Phone O 32 string The phone number of the person the order is shipped to
Fax O 32 string The fax number of the shipping location

Items

The Items section is optional. If provided, it should contain a list of line items purchased by the customer, up to a maximum of 99 items. It is used by Beagle Fraud Alerts (Enterprise) to calculate a risk score for this transaction. LineItems have the following fields:

Field Name Field Type Max Length Data Type Description
SKU O 12 string The stock keeping unit used to identify this line item
Description O 26 string A brief description of the product
Quantity O 6 int The purchased quantity
UnitCost O 8 int The pre-tax cost per unit of the product in the lowest denomination
Tax O 8 int The tax amount that applies to this line item in the lowest denomination
Total O 8 int The total amount charged for this line item in the lowest denomination

Options

This section is optional. Anything appearing in this section is not displayed to the customer. Up to 99 options can be defined. Each option has just one field:

Field Name Field Type Max Length Data Type Description
Value O 254 string This field is not displayed to the customer. Anything can be used here, which can be useful for tracking transactions. Additional characters are truncated at 254

Response

Example Response


{
    "Errors": null,
    "AuthorisationCode": "592654",
    "ResponseCode": "00",
    "ResponseMessage": "A2000",
    "TransactionID": 11259550,
    "TransactionStatus": true,
    "TransactionType": "Purchase",
    "BeagleScore": 0,
    "Verification": {
        "CVN": 0,
        "Address": 0,
        "Email": 0,
        "Mobile": 0,
        "Phone": 0
    },
    "Customer": {
        "CardDetails": {
            "Number": "444433XXXXXX1111",
            "Name": "John Smith",
            "ExpiryMonth": "12",
            "ExpiryYear": "25",
            "StartMonth": "01",
            "StartYear": "13",
            "IssueNumber": "01"
        },
        "TokenCustomerID": null,
        "Reference": "A12345",
        "Title": "Mr.",
        "FirstName": "John",
        "LastName": "Smith",
        "CompanyName": "Demo Shop 123",
        "JobDescription": "Developer",
        "Street1": "Level 5",
        "Street2": "369 Queen Street",
        "City": "Sydney",
        "State": "NSW",
        "PostalCode": "2000",
        "Country": "au",
        "Email": "demo@example.org",
        "Phone": "09 889 0986",
        "Mobile": "09 889 6542",
        "Comments": "",
        "Fax": "",
        "Url": "http://www.ewaypayments.com"
    },
    "Payment": {
        "TotalAmount": 1000,
        "InvoiceNumber": "Inv 21540",
        "InvoiceDescription": "Individual Invoice Description",
        "InvoiceReference": "513456",
        "CurrencyCode": "AUD"
    }
}
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <DirectPaymentResponse xmlns="https://api.ewaypayments.com/">
         <DirectPaymentResult>
            <AuthorisationCode>592654</AuthorisationCode>
            <ResponseCode>00</ResponseCode>
            <ResponseMessage>A2000</ResponseMessage>
            <TransactionID>11259550</TransactionID>
            <TransactionStatus>true</TransactionStatus>
            <TransactionType>Purchase</TransactionType>
            <BeagleScore>0</BeagleScore>
            <Verification>
               <CVN>Unchecked</CVN>
               <Address>Unchecked</Address>
               <Email>Unchecked</Email>
               <Mobile>Unchecked</Mobile>
               <Phone>Unchecked</Phone>
            </Verification>
            <Customer>
               <TokenCustomerID xsi:nil="true"/>
               <Reference>A12345</Reference>
               <Title>Mr.</Title>
               <FirstName>John</FirstName>
               <LastName>Smith</LastName>
               <CompanyName>Demo Shop 123</CompanyName>
               <JobDescription>Developer</JobDescription>
               <Street1>Level 5</Street1>
               <Street2>369 Queen Street</Street2>
               <City>Sydney</City>
               <State>NSW</State>
               <PostalCode>2000</PostalCode>
               <Country>au</Country>
               <Email>demo@example.org</Email>
               <Phone>0289712345</Phone>
               <Mobile>0289712345</Mobile>
               <Comments>Customer comments</Comments>
               <Fax>0289712345</Fax>
               <Url>http://www.ewaypayments.com</Url>
               <CardDetails>
                  <Number>444433XXXXXX1111</Number>
                  <Name>John Smith</Name>
                  <ExpiryMonth>12</ExpiryMonth>
                  <ExpiryYear>25</ExpiryYear>
               </CardDetails>
            </Customer>
            <Payment>
               <TotalAmount>1000</TotalAmount>
               <InvoiceNumber>Inv 21540</InvoiceNumber>
               <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
               <InvoiceReference>Individual Invoice Description</InvoiceReference>
               <CurrencyCode>AUD</CurrencyCode>
            </Payment>
         </DirectPaymentResult>
      </DirectPaymentResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available $response properties

if ($response->TransactionStatus) {
    echo 'Payment successful! ID: '.$response->TransactionID;
} else {
    if ($response->getErrors()) {
        foreach ($response->getErrors() as $error) {
            echo "Error: ".\Eway\Rapid::getMessage($error)."<br>";
        }
    } else {
        echo 'Sorry, your payment was declined';
    }
}

// See the JSON tab for all the available response properties

if (response.getTransactionStatus().isStatus()) {
    System.out.println("Payment successful! ID: " + response.getTransactionStatus().getTransactionID());
} else {
    String[] errorcodes = response.getTransactionStatus().getProcessingDetails().getResponseMessage().split(",");
    for (String errorcode: errorcodes) {
        System.out.println("Response Messages: " + RapidSDK.userDisplayMessage(errorcode.trim(), "en"));
    }
}
// See the JSON tab for all the available response properties

if (response.Errors != null)
{
    foreach (string errorCode in response.Errors)
    {
        Console.WriteLine("Error message: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
    }
}
else
{
    if ((bool)response.TransactionStatus.Status)
    {
        Console.WriteLine("Payment successful! ID: " + response.TransactionStatus.TransactionID);
    }
}
// See the JSON tab for all the available response properties

.then(function (response) {
    if (response.get('TransactionStatus')) {
        console.log('Payment successful! ID: ' + response.get('TransactionID'));
    } else {
        var errorCodes = response.get('ResponseMessage').split(', ');
        errorCodes.forEach(function(errorCode) {
            console.log("Response Message: " + rapid.getMessage(errorCode, "en"));
        });
    }
})
.catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});
# See the JSON tab for all the available response properties

if response.errors.empty?
  if response.transaction_status.status?
    puts "Payment successful! ID: #{response.transaction_status.transaction_id.to_s}"
  else
    puts "Failed! Message #{response.transaction_status.processing_details.response_message}"
  end
else
  response.errors.each { |e| puts "Response message: " + EwayRapid::RapidClient.user_display_message(e) }
end

The response from eWAY will contain all relevant details such as the bank authorisation code and a unique number that identifies the transaction in eWAY’s database (TransactionID).

If a Token customer was involved, the ID that eWAY uses to identify that customer will also be returned.

All responses will contain a response code and response message that represents the result of the action performed.

If applicable, the response will also contain information about the payment that has been processed, as well as the results of any Beagle risk analysis that was performed.

Response Fields Descriptions

Field Name Max Length Data Type Description
AuthorisationCode 6 string The authorisation code for this transaction as returned by the bank
ResponseCode 2 string The two digit response code returned from the bank
ResponseMessage 512 string A code that describes the result of the action performed
TransactionID 8 int A unique identifier that represents the transaction in eWAY’s system
TransactionStatus boolean A Boolean value that indicates whether the transaction was successful or not
TransactionType enum The transaction type that this transaction was processed under.
One of: Purchase, MOTO, Recurring
TotalAmount 10 int The amount that was authorised for this transaction
BeagleScore** 6 string Fraud score representing the estimated probability that the order is fraud. A value between 0.01 to 100.00 representing the % risk the transaction is fraudulent. On Sandbox the score will be -1 unless it is configured to fail for Risk Score, in which case the value will be 101.
Errors 512 string A comma separated list of any error encountered, these can be looked up in the Response Codes section.

**This field is only present if the transaction was processed using Beagle Free

‡ This field is only present if processing a token transaction, creating or updating a token customer

Verification

These fields are currently unused

Field Name Max Length Data Type Description
CVN 10 string
Address 10 string
Email 10 string
Mobile 10 string
Phone 10 string

Payment

This set of fields contains the details of the payment which was processed.

Field Name Max Length Data Type Description
TotalAmount 10 int The amount of the transaction in the lowest denomination for the currency
(e.g. a $27.00 transaction would have a TotalAmount value of ‘2700’).
InvoiceNumber 12 string An echo of the merchant’s invoice number for this transaction
InvoiceDescription 64 string An echo of the purchase that the customer is making
InvoiceReference 50 string An echo of the merchant’s reference number for this transaction
CurrencyCode 3 string The ISO 4217 3 character code that represents the currency that this transaction was processed in.

Customer

This set of fields contains the details of the merchant’s customer.

Field Name Max Length Data Type Description
TokenCustomerID 16 long An eWAY issued ID that represents the Token customer to be loaded for this action
Reference 50 string An echo of the merchant’s reference for this customer
Title 5 string An echo of the customer’s title
FirstName 50 string An echo of the customer’s first name
LastName 50 string An echo of the customer’s last name
CompanyName 50 string An echo of the customer’s company name
JobDescription 50 string An echo of the customer’s job description / title
Street1 50 string An echo of the customer’s street address
Street2 50 string An echo of the customer’s street address
City 50 string An echo of the customer’s city / town / suburb
State 50 string An echo of the customer’s state / county
PostalCode 30 string An echo of the customer’s post / zip code
Country 2 string An echo of the customer’s country. This will be the two letter ISO 3166-1 alpha-2 code.
e.g. Australia = au
Email 50 string An echo of the customer’s email address
Phone 32 string An echo of the customer’s phone number
Mobile 32 string An echo of the customer’s fax number
Comments 255 string An echo of any comments
Fax 32 string An echo of the customer’s fax number
Url 512 string An echo of the customer’s website

Card Details

The card details section is within the Customer section

Field Name Max Length Data Type Description
Name 50 string An echo of the name of the card holder
Number 50 int A masked echo of the card number
ExpiryMonth 2 int An echo of the month that the card expires
ExpiryYear 2 int An echo of the year that the card expires
StartMonth* 2 int An echo of the month that the card is valid from
StartYear* 2 int An echo of the year that the card is valid from
IssueNumber* int An echo of the card’s issue number

*Applies to UK only

Responsive Shared Page

For a simple, good looking integration, eWAY’s Responsive Shared Page API provides a hosted form for entering payment information. The form is hosted on eWAY’s PCI DSS compliant, industry leading infrastructure for your and your customer’s peace of mind. There are a number of themes to customise the look of the form, plus it responds to screen size to be suitable for devices from mobiles to PCs.

The Responsive Shared Page also comes with built in integration with 3D Secure, PayPal, MasterPass, Visa Checkout and AMEX Express Checkout - no further development required!

Implementing the Responsive Shared Page API is a three step process:

  1. Pass the customer and transaction details to eWAY to generate an Responsive Shared Page URL.
  2. Redirect the customer to the provided URL to enter their payment information. After processing the transaction, the customer is directed back to the nominated Redirect URL.
  3. Once the transaction has been processed, request the results from eWAY using the Access Code.

Step 1: Create an Access Code

To request an Access Code, make a server-side call to the CreateAccessCodeShared method of Rapid API. The service will respond with an Access Code and return the customer data.

If the request involves an existing Token customer, their details will be returned in the response including the masked credit card number.

If Token Payments are not in use for this transaction, the returned customer data will be an echo of the data in the request.

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.ewaypayments.com/AccessCodesShared
HTTP POST (XML) https://api.ewaypayments.com/CreateAccessCodeShared.xml
HTTP POST (JSON) https://api.ewaypayments.com/CreateAccessCodeShared.json
RPC (XML) https://api.ewaypayments.com/xml-rpc
RPC (JSON) https://api.ewaypayments.com/json-rpc

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.sandbox.ewaypayments.com/AccessCodesShared
HTTP POST (XML) https://api.sandbox.ewaypayments.com/CreateAccessCodeShared.xml
HTTP POST (JSON) https://api.sandbox.ewaypayments.com/CreateAccessCodeShared.json
RPC (XML) https://api.sandbox.ewaypayments.com/xml-rpc
RPC (JSON) https://api.sandbox.ewaypayments.com/json-rpc

Request Field Descriptions

Basic Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
        "Payment": {
           "TotalAmount": 100
        },
        "RedirectUrl": "http://www.eway.com.au",
        "CancelUrl": "http://www.eway.com.au",
        "Method": "ProcessPayment",
        "TransactionType": "Purchase"
        }' \
    https://api.sandbox.ewaypayments.com/AccessCodesShared
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <CreateAccessCodeShared xmlns="https://api.ewaypayments.com/">
            <request>
                <Payment>
                    <TotalAmount>1000</TotalAmount>
                </Payment>
                <RedirectUrl>http://www.eway.com.au</RedirectUrl>
                <CancelUrl>http://www.eway.com.au</CancelUrl>
                <TransactionType>Purchase</TransactionType>
                <Method>ProcessPayment</Method>
            </request>
        </CreateAccessCodeShared>
    </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'RedirectUrl' => 'http://www.eway.com.au',
    'CancelUrl' => "http://www.eway.com.au",
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
    'Payment' => [
        'TotalAmount' => 1000,
    ]
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::RESPONSIVE_SHARED, $transaction);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction();

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);

transaction.setPaymentDetails(paymentDetails);
transaction.setRedirectURL("http://www.eway.com.au");
transaction.setCancelURL("http://www.eway.com.au");
transaction.setTransactionType(TransactionType.Purchase);

CreateTransactionResponse response = client.create(PaymentMethod.ResponsiveShared, transaction);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction()
{
    PaymentDetails = new PaymentDetails()
    {
        TotalAmount = 1000
    },
    RedirectURL = "http://www.eway.com.au",
    CancelURL = "http://www.eway.com.au",
    TransactionType = TransactionTypes.Purchase
};

CreateTransactionResponse response = ewayClient.Create(PaymentMethod.ResponsiveShared, transaction);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.RESPONSIVE_SHARED, {
    "Payment": {
       "TotalAmount": 100
    },
    "RedirectUrl": "http://www.eway.com.au",
    "CancelUrl": "http://www.eway.com.au",
    "TransactionType": "Purchase"
}).then(function (response) {

});

client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new
payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
transaction.payment_details = payment_details
transaction.redirect_url = 'http://www.eway.com.au'
transaction.cancel_url = 'http://www.eway.com.au'
transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::RESPONSIVE_SHARED, transaction)

Complete Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{ 
        "Customer": { 
           "Reference": "A12345", 
           "Title": "Mr.", 
           "FirstName": "John", 
           "LastName": "Smith", 
           "CompanyName": "Demo Shop 123", 
           "JobDescription": "Developer", 
           "Street1": "Level 5", 
           "Street2": "369 Queen Street", 
           "City": "Sydney", 
           "State": "NSW", 
           "PostalCode": "2000", 
           "Country": "au", 
           "Phone": "09 889 0986", 
           "Mobile": "09 889 6542",
           "Email": "demo@example.org",
           "Url": "http://www.ewaypayments.com"
        }, 
        "ShippingAddress": {
           "ShippingMethod": "NextDay",
           "FirstName": "John",
           "LastName": "Smith",
           "Street1": "Level 5", 
           "Street2": "369 Queen Street", 
           "City": "Sydney", 
           "State": "NSW", 
           "Country": "au", 
           "PostalCode": "2000",
           "Phone": "09 889 0986" 
        }, 
        "Items": [ 
         { 
           "SKU": "12345678901234567890", 
           "Description": "Item Description 1",
           "Quantity": 1,
           "UnitCost": 400,
           "Tax": 100,
           "Total": 500
         }, 
         { 
           "SKU": "123456789012", 
           "Description": "Item Description 2", 
           "Quantity": 1,
           "UnitCost": 400,
           "Tax": 100,
           "Total": 500
         }
        ], 
        "Options": [ 
         { 
           "Value": "Option1" 
         }, 
         { 
           "Value": "Option2" 
         }
        ], 
        "Payment": { 
           "TotalAmount": 1000, 
           "InvoiceNumber": "Inv 21540", 
           "InvoiceDescription": "Individual Invoice Description", 
           "InvoiceReference": "513456",
           "CurrencyCode": "AUD"
        }, 
        "RedirectUrl": "http://www.eway.com.au", 
        "CancelUrl": "http://www.eway.com.au",
        "Method": "ProcessPayment", 
        "DeviceID": "D1234", 
        "CustomerIP": "127.0.0.1", 
        "PartnerID": "ID", 
        "TransactionType": "Purchase",
        "LogoUrl": "https://mysite.com/images/logo4eway.jpg",
        "HeaderText": "My Site Header Text",
        "Language": "EN",
        "CustomerReadOnly": true,
        "CustomView": "bootstrap",
        "VerifyCustomerPhone": false,
        "VerifyCustomerEmail": false
        }' \
    https://api.sandbox.ewaypayments.com/AccessCodesShared
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <CreateAccessCodeShared xmlns="https://api.ewaypayments.com/">
            <request>
                <Customer>
                    <Reference>A12345</Reference>
                    <Title>Mr.</Title>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <CompanyName>Demo Shop 123</CompanyName>
                    <JobDescription>Developer</JobDescription>
                    <Street1>Level 5</Street1>
                    <Street2>369 Queen Street</Street2>
                    <City>Sydney</City>
                    <State>NSW</State>
                    <PostalCode>2000</PostalCode>
                    <Country>au</Country>
                    <Email>demo@example.org</Email>
                    <Phone>0289712345</Phone>
                    <Mobile>0289712345</Mobile>
                    <Comments>Customer comments</Comments>
                    <Fax>0289712345</Fax>
                    <Url>http://www.ewaypayments.com</Url>
                </Customer>
                <ShippingAddress>
                    <ShippingMethod>NextDay</ShippingMethod>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <Street1>Level 5</Street1>
                    <Street2>369 Queen Street</Street2>
                    <City>Sydney</City>
                    <State>NSW</State>
                    <PostalCode>2000</PostalCode>
                    <Country>au</Country>
                    <Email>demo@example.org</Email>
                    <Phone>0289712345</Phone>
                    <Fax>0289712345</Fax>
                </ShippingAddress>
                <Items>
                    <LineItem>
                        <SKU>12345678901234567890</SKU>
                        <Description>Item Description 1</Description>
                        <Quantity>1</Quantity>
                        <UnitCost>400</UnitCost>
                        <Tax>100</Tax>
                        <Total>500</Total>
                    </LineItem>
                    <LineItem>
                        <SKU>123456789012</SKU>
                        <Description>Item Description 2</Description>
                        <Quantity>1</Quantity>
                        <UnitCost>400</UnitCost>
                        <Tax>100</Tax>
                        <Total>500</Total>
                    </LineItem>
                </Items>
                <Options>
                    <Option>
                        <Value>Option1</Value>
                    </Option>
                    <Option>
                        <Value>Option2</Value>
                    </Option>
                </Options>
                <Payment>
                    <TotalAmount>1000</TotalAmount>
                    <InvoiceNumber>Inv 21540</InvoiceNumber>
                    <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
                    <InvoiceReference>Individual Invoice Description</InvoiceReference>
                    <CurrencyCode>AUD</CurrencyCode>
                </Payment>
                <RedirectUrl>http://www.eway.com.au</RedirectUrl>
                <CancelUrl>http://www.eway.com.au</CancelUrl>
                <CustomerIP>127.0.0.1</CustomerIP>
                <DeviceID>D1234</DeviceID>
                <TransactionType>Purchase</TransactionType>
                <Method>ProcessPayment</Method>
                <CheckoutPayment>false</CheckoutPayment>
                <CustomerReadOnly>true</CustomerReadOnly>
                <VerifyCustomerPhone>false</VerifyCustomerPhone>
                <VerifyCustomerEmail>false</VerifyCustomerEmail>
                <LogoUrl>https://mysite.com/images/logo4eway.jpg</LogoUrl>
                <HeaderText>My Site Header Text</HeaderText>
                <Language>EN</Language>
                <CustomView>Bootstrap</CustomView>
            </request>
        </CreateAccessCodeShared>
    </soap:Body>
</soap:Envelope>

<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'Customer' => [
        'Reference' => 'A12345',
        'Title' => 'Mr.',
        'FirstName' => 'John',
        'LastName' => 'Smith',
        'CompanyName' => 'Demo Shop 123',
        'JobDescription' => 'Developer',
        'Street1' => 'Level 5',
        'Street2' => '369 Queen Street',
        'City' => 'Sydney',
        'State' => 'NSW',
        'PostalCode' => '2000',
        'Country' => 'au',
        'Phone' => '09 889 0986',
        'Mobile' => '09 889 6542',
        'Email' => 'demo@example.org',
        "Url" => "http://www.ewaypayments.com",
    ],
    'ShippingAddress' => [
        'ShippingMethod' => \Eway\Rapid\Enum\ShippingMethod::NEXT_DAY,
        'FirstName' => 'John',
        'LastName' => 'Smith',
        'Street1' => 'Level 5',
        'Street2' => '369 Queen Street',
        'City' => 'Sydney',
        'State' => 'NSW',
        'Country' => 'au',
        'PostalCode' => '2000',
        'Phone' => '09 889 0986',
    ],
    'Items' => [
        [
            'SKU' => '12345678901234567890',
            'Description' => 'Item Description 1',
            'Quantity' => 1,
            'UnitCost' => 400,
            'Tax' => 100,
            // Total is calculated automatically
        ],
        [
            'SKU' => '123456789012',
            'Description' => 'Item Description 2',
            'Quantity' => 1,
            'UnitCost' => 400,
            'Tax' => 100,
        ],
    ],
    'Options' => [
        [
            'Value' => 'Option1',
        ],
        [
            'Value' => 'Option2',
        ],
    ],
    'Payment' => [
        'TotalAmount' => 1000,
        'InvoiceNumber' => 'Inv 21540',
        'InvoiceDescription' => 'Individual Invoice Description',
        'InvoiceReference' => '513456',
        'CurrencyCode' => 'AUD',
    ],
    'RedirectUrl' => 'http://www.eway.com.au',
    'CancelUrl' => "http://www.eway.com.au",
    'DeviceID' => 'D1234',
    'CustomerIP' => '127.0.0.1',
    'PartnerID' => 'ID',
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
    'Capture' => true,
    'LogoUrl' => 'https://mysite.com/images/logo4eway.jpg',
    'HeaderText' => 'My Site Header Text',
    'Language' => 'EN',
    'CustomerReadOnly' => true
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::RESPONSIVE_SHARED, $transaction);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction();

Customer customer = new Customer();
customer.setReference("A12345");
customer.setTitle("Mr.");
customer.setFirstName("John");
customer.setLastName("Smith");
customer.setCompanyName("eWay");
customer.setJobDescription("Java Developer");
customer.setPhone("09 889 0986");
customer.setMobile("09 889 6542");
customer.setUrl("http://ewaypayments.com");
customer.setCustomerDeviceIP("127.0.0.1");
customer.setEmail("demo@example.org");

Address address = new Address();
address.setStreet1("Level 5");
address.setStreet2("369 Queen Street");
address.setCity("Sydney");
address.setState("NSW");
address.setCountry("au");
address.setPostalCode("2000");
customer.setAddress(address);
transaction.setCustomer(customer);

ShippingDetails shippingDetail = new ShippingDetails();
shippingDetail.setFirstName("John");
shippingDetail.setLastName("Smith");
shippingDetail.setPhone("09 889 0986");
shippingDetail.setShippingMethod(ShippingMethod.LowCost);

Address shipAddress = new Address();
shipAddress.setStreet1("Level 5");
shipAddress.setStreet2("369 Queen Street");
shipAddress.setCity("Sydney");
shipAddress.setState("NSW");
shipAddress.setCountry("au");
shipAddress.setPostalCode("2000");
shippingDetail.setShippingAddress(shipAddress);
transaction.setShippingDetails(shippingDetail);

List<LineItem> items = new ArrayList<>();
LineItem item1 = new LineItem();
item1.setSku("12345678901234567890");
item1.setDescription("Item Description 1");
item1.setQuantity(1);
item1.setUnitCost(400);
item1.setTotalTax(100);
item1.setTotal(500);
items.add(item1);

LineItem item2 = new LineItem();
item2.setSku("123456789012");
item2.setDescription("Item Description 2");
item2.setQuantity(1);
item2.setUnitCost(400);
item2.setTotalTax(100);
item2.setTotal(500);
items.add(item2);

transaction.setLineItems(items);

List<String> options = new ArrayList<>();
options.add("Option1");
options.add("Option2");
transaction.setOptions(options);

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);
paymentDetails.setCurrencyCode("AUD");
paymentDetails.setInvoiceDescription("Individual Invoice Description");
paymentDetails.setInvoiceNumber("Inv 21540");
paymentDetails.setInvoiceReference("513456");
transaction.setPaymentDetails(paymentDetails);

transaction.setPartnerID("ID");
transaction.setCapture(true);
transaction.setRedirectURL("http://www.eway.com.au");
transaction.setCancelURL("http://www.eway.com.au");
transaction.setDeviceID("D1234");
transaction.setTransactionType(TransactionType.Purchase);
transaction.setLogoUrl("https://mysite.com/images/logo4eway.jpg");
transaction.setHeaderText("My Site Header Text");
transaction.setLanguage("EN");
transaction.setCustomerReadOnly(true);
transaction.setCustomView("bootstrap");
transaction.setVerifyCustomerPhone(false);
transaction.setVerifyCustomerEmail(false);
transaction.setSaveCustomer(false);

CreateTransactionResponse response = client.create(PaymentMethod.ResponsiveShared, transaction);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction()
{
    Customer = new Customer()
    {
        Reference = "A12345",
        Title = "Mr.",
        FirstName = "John",
        LastName = "Smith",
        CompanyName = "Demo Shop 123",
        JobDescription = "C# Developer",
        Phone = "09 889 0986",
        Mobile = "09 889 6542",
        Url = "http://www.ewaypayments.com",
        Address = new Address()
        {
            Street1 = "Level 5",
            Street2 = "369 Queen Street",
            City = "Sydney",
            State = "NSW",
            Country = "au",
            PostalCode = "2000",

        }
    },
    ShippingDetails = new ShippingDetails()
    {
        FirstName = "John",
        LastName = "Smith",
        Phone = "09 889 0986",
        ShippingAddress = new Address()
        {
            Street1 = "Level 5",
            Street2 = "369 Queen Street",
            City = "Sydney",
            State = "NSW",
            Country = "au",
            PostalCode = "2000"
        },
        ShippingMethod = ShippingMethod.NextDay,
    },
    LineItems = new[] 
    { 
        new LineItem()
        {
            SKU = "12345678901234567890", 
            Description = "Item Description 1",
            Quantity = 1,
            UnitCost = 400,
            Tax = 100,
            Total = 400
        },
        new LineItem()
        {
            SKU = "123456789012", 
            Description = "Item Description 2",
            Quantity = 1,
            UnitCost = 400,
            Tax = 100,
            Total = 400
        }
    }.ToList(),
    Options = new[] 
    { 
        "Option1", 
        "Option2" 
    }.ToList(),
    PaymentDetails = new PaymentDetails()
    {
        TotalAmount = 1000,
        InvoiceNumber = "Inv 21540",
        InvoiceDescription = "Individual Invoice Description",
        InvoiceReference = "513456",
        CurrencyCode = "AUD"
    },
    RedirectURL = "http://www.eway.com.au",
    CancelURL = "http://www.eway.com.au",
    DeviceID = "D1234",
    PartnerID = "ID",
    CustomerIP = "127.0.0.1",
    TransactionType = TransactionTypes.Purchase,
    LogoUrl = "https://mysite.com/images/logo4eway.jpg",
    HeaderText = "My Site Header Text",
    Language = "EN",
    CustomerReadOnly = true,
    CustomView = "bootstrap",
    VerifyCustomerPhone = false,
    VerifyCustomerEmail = false,
    Capture = true,
    SaveCustomer = false
};

CreateTransactionResponse response = ewayClient.Create(PaymentMethod.ResponsiveShared, transaction);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.RESPONSIVE_SHARED, {
    "Customer": {
       "Reference": "A12345",
       "Title": "Mr.",
       "FirstName": "John",
       "LastName": "Smith",
       "CompanyName": "Demo Shop 123",
       "JobDescription": "Developer",
       "Street1": "Level 5",
       "Street2": "369 Queen Street",
       "City": "Sydney",
       "State": "NSW",
       "PostalCode": "2000",
       "Country": "au",
       "Phone": "09 889 0986",
       "Mobile": "09 889 6542",
       "Email": "demo@example.org",
       "Url": "http://www.ewaypayments.com"
    },
    "ShippingAddress": {
       "ShippingMethod": "NextDay",
       "FirstName": "John",
       "LastName": "Smith",
       "Street1": "Level 5",
       "Street2": "369 Queen Street",
       "City": "Sydney",
       "State": "NSW",
       "Country": "au",
       "PostalCode": "2000",
       "Phone": "09 889 0986"
    },
    "Items": [
     {
       "SKU": "12345678901234567890",
       "Description": "Item Description 1",
       "Quantity": 1,
       "UnitCost": 400,
       "Tax": 100,
       "Total": 500
     },
     {
       "SKU": "123456789012",
       "Description": "Item Description 2",
       "Quantity": 1,
       "UnitCost": 400,
       "Tax": 100,
       "Total": 500
     }
    ],
    "Options": [
     {
       "Value": "Option1"
     },
     {
       "Value": "Option2"
     }
    ],
    "Payment": {
       "TotalAmount": 1000,
       "InvoiceNumber": "Inv 21540",
       "InvoiceDescription": "Individual Invoice Description",
       "InvoiceReference": "513456",
       "CurrencyCode": "AUD"
    },
    "RedirectUrl": "http://www.eway.com.au",
    "CancelUrl": "http://www.eway.com.au",
    "DeviceID": "D1234",
    "CustomerIP": "127.0.0.1",
    "PartnerID": "ID",
    "TransactionType": "Purchase",
    "LogoUrl": "https://mysite.com/images/logo4eway.jpg",
    "HeaderText": "My Site Header Text",
    "Language": "EN",
    "CustomerReadOnly": true,
    "CustomView": "bootstrap",
    "VerifyCustomerPhone": false,
    "VerifyCustomerEmail": false
}).then(function (response) {

});

client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new

customer = EwayRapid::Models::Customer.new
customer.reference = 'A12345'
customer.title = 'Mr.'
customer.first_name = 'John'
customer.last_name = 'Smith'
customer.company_name = 'Company'
customer.job_description = 'Ruby Developer'
customer.phone = '09 889 0986'
customer.mobile = '09 889 0986'
customer.fax = '09 654 1234'
customer.url = 'http://www.ewaypayments.com'
customer.comments = 'customer comment'
customer.customer_device_ip = '127.0.0.1'
customer.email = 'demo@example.org'

address = EwayRapid::Models::Address.new
address.street1 = 'Level 5'
address.street2 = '369 Queen Street'
address.city = 'Sydney'
address.state = 'NSW'
address.country = 'AU'
address.postal_code = '2000'
customer.address = address

transaction.customer = customer

shipping_details = EwayRapid::Models::ShippingDetails.new
shipping_address = EwayRapid::Models::Address.new
shipping_address.street1 = 'Level 5'
shipping_address.street2 = '369 Queen Street'
shipping_address.city = 'Sydney'
shipping_address.state = 'NSW'
shipping_address.country = 'AU'
shipping_address.postal_code = '2000'
shipping_details.shipping_address = shipping_address
shipping_details.first_name = 'John'
shipping_details.last_name = 'Smith'
shipping_details.phone = '09 889 0986'
shipping_details.shipping_method = EwayRapid::Enums::ShippingMethod::LOW_COST
transaction.shipping_details = shipping_details

line_item = EwayRapid::Models::LineItem.new
line_item.sku = '12345678901234567890'
line_item.description = 'Item Description 1'
line_item.quantity = 1
line_item.unit_cost = 400
line_item.tax = 100
line_item.total = 500

line_item1 = EwayRapid::Models::LineItem.new
line_item1.sku = '12345678901234567890'
line_item1.description = 'Item Description 1'
line_item1.quantity = 1
line_item1.unit_cost = 400
line_item1.tax = 100
line_item1.total = 500

line_item2 = EwayRapid::Models::LineItem.new
line_item2.sku = '123456789012'
line_item2.description = 'Item Description 2'
line_item2.quantity = 1
line_item2.unit_cost = 400
line_item2.tax = 100
line_item2.total = 500

line_items = []
line_items.push(line_item1)
line_items.push(line_item2)
transaction.line_items = line_items

options = []
options.push('Option1')
options.push('Option2')
transaction.options = options

payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
payment_details.invoice_number = 'Inv 21540'
payment_details.invoice_description = 'Individual Invoice Description'
payment_details.invoice_reference = '513456'
payment_details.currency_code = 'AUD'
transaction.payment_details = payment_details

transaction.redirect_url = 'http://www.eway.com.au'
transaction.cancel_url = 'http://www.eway.com.au'
transaction.device_id = 'D1234'
transaction.partner_id = 'ID'
transaction.capture = true
transaction.logo_url = 'https://mysite.com/images/logo4eway.jpg'
transaction.header_text = 'My Site Header Text'
transaction.language = 'EN'
transaction.customer_read_only = true
transaction.custom_view = 'bootstrap'
transaction.verify_customer_phone = false
transaction.verify_customer_email = false
transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::RESPONSIVE_SHARED, transaction)
Field Name Field Type Max Length Data Type Description
CustomerIP** O 50 string The customer’s IP address
Method R 20 string The action to perform with this request (see Payment Methods for more information).
One of: ProcessPayment, CreateTokenCustomer, UpdateTokenCustomer, TokenPayment, Authorise
TransactionType R Int enum The type of transaction you’re performing (see Transaction Types).
One of: Purchase, MOTO, Recurring
DeviceID O 50 string The identification name/number for the device or application used to process the transaction
PartnerID O 50 string The partner ID generated from an eWAY partner agreement
RedirectUrl R 512 string, URL The URL that the shared page redirects to after a payment is processed
CancelUrl R 512 string, URL The URL that the shared page redirects to if a customer cancels the transaction
LogoUrl O 512 string, URL The URL of the merchant’s logo to display on the shared page. This must start with https://. If blank or omitted, the logo defined in the Shared Page settings in MYeWAY will be used.
HeaderText O 255 string Short text description to be placed under the logo on the shared page. If blank or omitted, the text defined in the Shared Page settings in MYeWAY will be used.
Language O 5 string Language code determines the language that the shared page will be displayed in.
One of: EN (English, default), ES (Spanish)
CustomerReadOnly O boolean When set to false, cardholders will be able to edit the information on the shared page, even if it’s sent through in the server side request. To fetch the details the customer entered, do a Transaction Query once the transaction is complete.
CustomView O string Set the theme of the Responsive Shared Page from 12 available themes:
Bootstrap, BootstrapAmelia, BootstrapCerulean, BootstrapCosmo, BootstrapCyborg, BootstrapFlatly, BootstrapJournal, BootstrapReadable, BootstrapSimplex, BootstrapSlate, BootstrapSpacelab, BootstrapUnited
VerifyCustomerPhone O boolean Set whether the customer’s phone number should be confirmed using Beagle Verify
VerifyCustomerEmail O boolean Set whether the customer’s email should be confirmed using Beagle Verify
Capture O 6 boolean Rapid SDK Libraries Only Set to true to capture funds immediately (default), set to false to perform an authorisation and only hold funds.
SaveCustomer O 6 boolean Rapid SDK Libraries Only Set to true to create a token customer when the transaction is complete

Field types: R – Required, O – Optional

1 Note that the eWAY AccessCode is appended as a querystring parameter to the RedirectURL – existing querystring parameters are preserved.

**When this field is present along with the Customer Country field, any transaction will be processed using Beagle Fraud Alerts

Payment

This set of fields contains the details of the payment being processed. This section is required when the Method field is set to ProcessPayment or TokenPayment.

Field Name Field Type Max Length Data Type Description
TotalAmount R 10 int The amount of the transaction in the lowest denomination for the currency (e.g. a $27.00 transaction would have a TotalAmount value of ‘2700’).
The value of this field must be 0 for the CreateTokenCustomer andUpdateTokenCustomer methods. This field is required when the Action is ProcessPayment or TokenPayment.
InvoiceNumber O 12 string The merchant’s invoice number for this transaction.
InvoiceDescription O 64 string A short description of the purchase that the customer is making.
InvoiceReference O 50 string The merchant’s reference number for this transaction.
CurrencyCode O 3 string The ISO 4217 3 character code that represents the currency that this transaction is to be processed in. If no value for this field is provided, the merchant’s default currency is used. This should be in uppercase.
e.g. Australian Dollars = AUD

Customer

This set of fields contains the details of the merchant’s customer. These are used when creating and updating token customers.

Field Name Field Type Max Length Data Type Description
TokenCustomerID C 16 long An eWAY-issued ID that represents the Token customer to be loaded for this action.
Required for UpdateTokenCustomer method
Reference O 50 string The merchant’s reference for this customer.
Title† C 5 string The customer’s title, empty string allowed, which will default to Mr.
One of: Mr., Ms., Mrs., Miss, Dr., Sir., Prof.
FirstName† C 50 string The customer’s first name.
LastName† C 50 string The customer’s last name
CompanyName O 50 string The customer’s company name.
JobDescription O 50 string The customer’s job description / title.
Street1 O 50 string The customer’s street address.
Street2 O 50 string The customer’s street address.
City O 50 string The customer’s city / town / suburb.
State O 50 string The customer’s state / county.
PostalCode O 30 string The customer’s post / zip code.
Country† C 2 string The customer’s country. This should be the two letter ISO 3166-1 alpha-2 code. This field must be lower case.
e.g. Australia = au
Email O 50 string The customer’s email address, which must be correctly formatted if present
Phone O 32 string The customer’s phone number.
Mobile O 32 string The customer’s mobile phone number.
Comments O 255 string Any comments the merchant wishes to add about the customer.
Fax O 32 string The customer’s fax number.
Url O 512 string The customer’s website, which must be correctly formatted if present.

Field Types: O – Optional, C – Conditionally Required

† When creating a new Token customer, all conditional fields(†)are required

Shipping Address

The ShippingAddress section is optional. It is used by Beagle Fraud Alerts (Enterprise) to calculate a risk score for this transaction.

Field Name Field Type Max Length Data Type Description
ShippingMethod C 16 long The method used to ship the customer’s order.
One of: Unknown, LowCost, DesignatedByCustomer, International, Military, NextDay, StorePickup, TwoDayService, ThreeDayService, Other
FirstName O 50 string The first name of the person the order is shipped to.
LastName O 50 string The last name of the person the order is shipped to.
Street1 O 50 string The street address the order is shipped to.
Street2 O 50 string The street address of the shipping location.
City O 50 string The shipping city / town / suburb.
State O 50 string The shipping state / county.
PostalCode O 30 string The shipping post / zip code.
Country† C 2 string The shipping’s country. This should be the two letter ISO 3166-1 alpha-2 code. This field must be lower case.
e.g. Australia = au
Email O 50 string The shipping email address, which must be correctly formatted if present.
Phone O 32 string The phone number of the person the order is shipped to.
Fax O 32 string The fax number of the shipping location.

Items

The Items section is optional. If provided, it should contain a list of line items purchased by the customer, up to a maximum of 99 items. It is used by Beagle Fraud Alerts (Enterprise) to calculate a risk score for this transaction. Items have the following fields:

Field Name Field Type Max Length Data Type Description
SKU O 12 string The stock keeping unit used to identify this line item
Description O 26 string A brief description of the product
Quantity O 6 int The purchased quantity
UnitCost O 8 int The pre-tax cost per unit of the product in the lowest denomination
Tax O 8 int The tax amount that applies to this line item in the lowest denomination
Total O 8 int The total amount charged for this line item in the lowest denomination

Options

This section is optional. Anything appearing in this section is not displayed to the customer, but it is returned to the merchant in the result. Up to 99 options can be defined. Each option has just one field:

Field Name Field Type Max Length Data Type Description
Value O 254 string This field is not displayed to the customer but is returned in the result. Anything can be used here, which can be useful for tracking transactions. Additional characters are truncated at 254

Field types: O – Optional

Response Fields Descriptions

Example Response

{
    "SharedPaymentUrl": "https://secure-au.sandbox.ewaypayments.com/sharedpage/sharedpayment?AccessCode=44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2",
    "AccessCode": "44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2",
    "Customer": {
        "CardNumber": "",
        "CardStartMonth": "",
        "CardStartYear": "",
        "CardIssueNumber": "",
        "CardName": "",
        "CardExpiryMonth": "",
        "CardExpiryYear": "",
        "IsActive": false,
        "TokenCustomerID": null,
        "Reference": "A12345",
        "Title": "Mr.",
        "FirstName": "John",
        "LastName": "Smith",
        "CompanyName": "Demo Shop 123",
        "JobDescription": "Developer",
        "Street1": "Level 5",
        "Street2": "369 Queen Street",
        "City": "Sydney",
        "State": "NSW",
        "PostalCode": "2000",
        "Country": "au",
        "Email": "demo@example.org",
        "Phone": "09 889 0986",
        "Mobile": "09 889 6542",
        "Comments": "",
        "Fax": "",
        "Url": "http://www.ewaypayments.com"
    },
    "Payment": {
        "TotalAmount": 1000,
        "InvoiceNumber": "Inv 21540",
        "InvoiceDescription": "Individual Invoice Description",
        "InvoiceReference": "513456",
        "CurrencyCode": "AUD"
    },
    "FormActionURL": "https://secure-au.sandbox.ewaypayments.com/AccessCode/44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2",
    "CompleteCheckoutURL": null,
    "Errors": null
}
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <CreateAccessCodeSharedResponse xmlns="https://api.ewaypayments.com/">
         <CreateAccessCodeSharedResult>
            <AccessCode>44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2</AccessCode>
            <Customer>
               <TokenCustomerID xsi:nil="true"/>
               <Reference>A12345</Reference>
               <Title>Mr.</Title>
               <FirstName>John</FirstName>
               <LastName>Smith</LastName>
               <CompanyName>Demo Shop 123</CompanyName>
               <JobDescription>Developer</JobDescription>
               <Street1>Level 5</Street1>
               <Street2>369 Queen Street</Street2>
               <City>Sydney</City>
               <State>NSW</State>
               <PostalCode>2000</PostalCode>
               <Country>au</Country>
               <Email>demo@example.org</Email>
               <Phone>0289712345</Phone>
               <Mobile>0289712345</Mobile>
               <Comments>Customer comments</Comments>
               <Fax>0289712345</Fax>
               <Url>http://www.ewaypayments.com</Url>
               <CardNumber/>
               <CardStartMonth/>
               <CardStartYear/>
               <CardIssueNumber/>
               <CardName/>
               <CardExpiryMonth/>
               <CardExpiryYear/>
               <IsActive>false</IsActive>
            </Customer>
            <Payment>
               <TotalAmount>1000</TotalAmount>
               <InvoiceNumber>Inv 21540</InvoiceNumber>
               <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
               <InvoiceReference>Individual Invoice Description</InvoiceReference>
               <CurrencyCode>AUD</CurrencyCode>
            </Payment>
            <FormActionURL>https://secure-au.sandbox.ewaypayments.com/Process</FormActionURL>            <SharedPaymentUrl>https://secure-au.sandbox.ewaypayments.com/sharedpage/sharedpayment?AccessCode=44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2</SharedPaymentUrl>
         </CreateAccessCodeSharedResult>
      </CreateAccessCodeSharedResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available $response properties

if (!$response->getErrors()) {
    // Redirect to the Responsive Shared Page
    header('Location: '.$response->SharedPaymentUrl);
    die();
} else {
    foreach ($response->getErrors() as $error) {
        echo "Error: ".\Eway\Rapid::getMessage($error)."<br>";
    }
}

// See the JSON tab for all the available response properties

if (response.getErrors().isEmpty()) {
    // Redirect the user to this location
    $redirectURL = response.getSharedPaymentUrl();
} else {
    for (String errorcode: response.getErrors()) {
        System.out.println("Response Messages: " + RapidSDK.userDisplayMessage(errorcode, "en"));
    };
}
if (response.Errors == null)
{
    Response.Redirect(response.SharedPaymentUrl);
}
else
{
    foreach (string errorCode in response.Errors)
    {
        Console.WriteLine("Response Messages: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
    }
}
// See the JSON tab for all the available response properties

.then(function (response) {
    if (response.getErrors().length == 0) {
        var redirectURL = response.get('SharedPaymentUrl');
    } else {
        response.getErrors().forEach(function(error) {
            console.log("Response Messages: " + rapid.getMessage(error, "en"));
        });
    }
})
.catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});
# See the JSON tab for all the available response properties

if response.errors.empty?
  redirect_url = response.shared_payment_url
else
  response.errors.each { |e| puts "Response message: "+ EwayRapid::RapidClient.user_display_message(e) }
end

Field Name Max Length Data Type Description
SharedPaymentUrl 512 String The URL to redirect the customer to enter their card details
AccessCode 512 String A unique Access Code that is used to identify this transaction with Rapid API. This code will need to be present for all future requests associated with this transaction
Errors 512 String Any error codes associates with the request, these can be looked up in the Response Codes section.

Customer

Field Name Max Length Data Type Description
CardNumber 50 string The Token customer’s masked credit card number
CardName 50 string The Token customer’s card holder name
CardExpiryMonth 2 string The Token customer’s card expiry month
CardExpiryYear 2 string The Token customer’s card expiry year
CardStartMonth* 2 string The Token customer’s card valid from month
CardStartYear* 2 string The Token customer’s card valid from year
CardIssueNumber* 2 string The Token customer’s card issue number
IsActive boolean If the Token customer is active
TokenCustomerID 16 long The Token customer’s unique Token Customer ID Only returned if included in the CreateAccessCodeRequest on TokenPayment and UpdateTokenCustomer methods
Reference 50 string The merchant’s reference for this customer
Title 5 string The customer’s title.
FirstName 50 string The customer’s first name.
LastName 50 string The customer’s last name
CompanyName 50 string The customer’s company name.
JobDescription 50 string The customer’s job description / title.
Street1 50 string The customer’s street address.
Street2 50 string The customer’s street address.
City 50 string The customer’s city / town / suburb.
State 50 string The customer’s state / county.
PostalCode 30 string The customer’s post / zip code.
Country 2 string The customer’s country formatted as a two letter ISO 3166-1 alpha-2 code
Email 50 string The customer’s email address
Phone 32 string The customer’s phone number.
Mobile 32 string The customer’s mobile phone number.
Comments 255 string Any comments merchant added about the customer.
Fax 32 string The customer’s fax number.
Url 512 string The customer’s website.

*Applies to UK only

Payment

Field Name Max Length Data Type Description
TotalAmount 10 int The amount of the transaction in cents, as passed in original request.
InvoiceNumber 16 string The merchant’s invoice number for this transaction.
InvoiceDescription 64 string A short description of the purchase that the customer is making.
InvoiceReference 50 string The merchant’s reference number for this transaction.
CurrencyCode 3 string The ISO 4217 3 character code that represents the currency that this transaction is to be processed in.

Step 2: Redirect customer to eWAY

Using the SharedPaymentUrl you must now redirect the customer’s browser to eWAY to process their credit card details.

Step 3: Request results

Once the customer has been redirected to the final page (as specified by the RedirectUrl), the merchant will need to request the results from eWAY by calling the GetAccessCodeResult method of the Rapid API web service.

The Access Code will be appended to the Redirect URL as a query string (i.e. ?AccessCode=).

If CustomerReadOnly was set to false, the details the customer entered on the Responsive Shared Page can be fetched using Transaction Query.

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.ewaypayments.com/AccessCode/{AccessCode}
HTTP POST (XML) https://api.ewaypayments.com/GetAccessCodeResult.xml
HTTP POST (JSON) https://api.ewaypayments.com/GetAccessCodeResult.json
RPC (XML) https://api.ewaypayments.com/xml-rpc
RPC (JSON) https://api.ewaypayments.com/json-rpc

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.sandbox.ewaypayments.com/AccessCode/{AccessCode}
HTTP POST (XML) https://api.sandbox.ewaypayments.com/GetAccessCodeResult.xml
HTTP POST (JSON) https://api.sandbox.ewaypayments.com/GetAccessCodeResult.json
RPC (XML) https://api.sandbox.ewaypayments.com/xml-rpc
RPC (JSON) https://api.sandbox.ewaypayments.com/json-rpc

Request Field Descriptions

Example request

curl --request GET \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    https://api.sandbox.ewaypayments.com/AccessCode/44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <GetAccessCodeResult xmlns="https://api.ewaypayments.com/">
         <request>
            <AccessCode>44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2</AccessCode>
         </request>
      </GetAccessCodeResult>
   </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$response = $client->queryTransaction('44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2');
RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

QueryTransactionResponse response = client.queryTransaction("44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2");
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

QueryTransactionResponse response = ewayClient.QueryTransaction("44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2");
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.queryTransaction("44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2")
.then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

response = client.query_transaction_by_access_code('44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2')
Field Name Field Type Max Length Data Type Description
AccessCode R 512 string Access Code returned in Step 1.

Field Types: R – Required

If a transaction has been processed, the response received from eWAY will contain all relevant details such as the bank authorisation code and a unique number that identifies the transaction in eWAY’s database (TransactionID).

If a Token customer was involved, the ID that eWAY uses to identify that customer will also be returned.

All responses will contain a response code and response message that represents the result of the action performed.

If applicable, the response will also contain information about the payment that has been processed, as well as the results of any Beagle risk analysis that was performed.

Response Field Descriptions

Example response

{
    "AccessCode": "44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2",
    "AuthorisationCode": "522587",
    "ResponseCode": "00",
    "ResponseMessage": "A2000",
    "InvoiceNumber": "Inv 21540",
    "InvoiceReference": "513456",
    "TotalAmount": 1000,
    "TransactionID": 11259580,
    "TransactionStatus": true,
    "TokenCustomerID": null,
    "BeagleScore": 0,
    "Options": [{
        "Value": "Option1"
    }, {
        "Value": "Option2"
    }],
    "Verification": {
        "CVN": 0,
        "Address": 0,
        "Email": 0,
        "Mobile": 0,
        "Phone": 0
    },
    "BeagleVerification": {
        "Email": 0,
        "Phone": 0
    },
    "Errors": null
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <GetAccessCodeResultResponse xmlns="https://api.ewaypayments.com/">
         <GetAccessCodeResultResult>
            <AccessCode>44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2</AccessCode>
            <AuthorisationCode>522587</AuthorisationCode>
            <ResponseCode>00</ResponseCode>
            <ResponseMessage>A2000</ResponseMessage>
            <InvoiceNumber>Inv 21540</InvoiceNumber>
            <InvoiceReference>513456</InvoiceReference>
            <TotalAmount>1000</TotalAmount>
            <TransactionID>11259580</TransactionID>
            <TransactionStatus>true</TransactionStatus>
            <TokenCustomerID xsi:nil="true"/>
            <BeagleScore>0</BeagleScore>
            <Options>
               <Option>
                  <Value>Option1</Value>
               </Option>
               <Option>
                  <Value>Option2</Value>
               </Option>
            </Options>
            <Verification>
               <CVN>Unchecked</CVN>
               <Address>Unchecked</Address>
               <Email>Unchecked</Email>
               <Mobile>Unchecked</Mobile>
               <Phone>Unchecked</Phone>
            </Verification>
            <BeagleVerification>
               <Email>NotVerified</Email>
               <Phone>NotVerified</Phone>
            </BeagleVerification>
         </GetAccessCodeResultResult>
      </GetAccessCodeResultResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available properties

$transactionResponse = $response->Transactions[0];

if ($transactionResponse->TransactionStatus) {
    echo 'Payment successful! ID: '.$transactionResponse->TransactionID;
} else {
    $errors = split(',', $transactionResponse->ResponseMessage);
    foreach ($errors as $error) {
        echo "Payment failed: ".\Eway\Rapid::getMessage(trim($error))."<br>";
    }
}

// See the JSON tab for all the available properties

if (response.getTransactionStatus().isStatus()) {
    System.out.println("Payment successful! ID: " + response.getTransactionStatus().getTransactionID());
} else {
    String[] errorcodes = response.getTransactionStatus().getProcessingDetails().getResponseMessage().split(",");
    for (String errorcode: errorcodes) {
        System.out.println("Response Messages: " + RapidSDK.userDisplayMessage(errorcode.trim(), "en"));
    }
}
// See the JSON tab for all the available properties

if ((bool)response.TransactionStatus.Status)
{
    Console.WriteLine("Payment successful! ID: " + response.TransactionStatus.TransactionID);
}
else
{
    string[] errorCodes = response.TransactionStatus.ProcessingDetails.getResponseMessages();
    foreach (string errorCode in errorCodes)
    {
        Console.WriteLine("Response Message: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
    }
}
// See the JSON tab for all the available properties

.then(function (response) {
    if (response.get('Transactions[0].TransactionStatus')) {
        console.log('Payment successful! ID: ' + response.get('Transactions[0].TransactionID'));
    } else {
        var errorCodes = response.get('Transactions[0].ResponseMessage').split(', ');
        errorCodes.forEach(function(errorCode) {
            console.log("Response Message: " + rapid.getMessage(errorCode, "en"));
        });
    }
}).catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});

if response.transaction_status.status?
  puts "Payment successful! ID: #{response.transaction_status.transaction_id.to_s}"
else
  puts "Failed! Message #{response.transaction_status.processing_details.response_message}"
end

Field Name Max Length Data Type Description
AccessCode 512 string An echo of the access code used in the request
AuthorisationCode 6 string The authorisation code for this transaction as returned by the bank
ResponseCode 2 string The two digit response code returned from the bank
ResponseMessage 512 string One or more Response Codes that describes the result of the action performed.
If a Beagle Alert is triggered, this may contain multiple codes:
e.g. D4405, F7003
InvoiceNumber 64 string An echo of the merchant’s invoice number for this transaction
InvoiceReference 64 string An echo of the merchant’s reference number for this transaction
TotalAmount 10 int The amount that was authorised for this transaction. If card surcharge is enabled, the TotalAmount will include the surcharge.
TransactionID 8 int A unique identifier that represents the transaction in eWAY’s system
TransactionStatus 16 boolean A Boolean value that indicates whether the transaction was successful or not
TokenCustomerID‡ 16 long An eWAY-issued ID that represents the Token customer that was loaded or created for this transaction (if applicable)
BeagleScore** 6 string Fraud score representing the estimated probability that the order is fraud. A value between 0.01 to 100.00 representing the % risk the transaction is fraudulent. On Sandbox the score will be -1 unless it is configured to fail for Risk Score, in which case the value will be 101.
Errors 512 string A comma separated list of any error encountered, these can be looked up in the Response Codes section.

*This field is only present if the transaction was processed using Beagle Free

This field is only present if processing a Token transaction, creating or updating a Token customer

Options

The Options collection passed in the original request will be echoed back in the response here.

Field Name Max Length Data Type Description
Value 255 string An echo of the option submitted for this transaction

Verification

These fields are currently unused

Field Name Max Length Data Type Description
CVN 10 string
Address 10 string
Email 10 string
Mobile 10 string
Phone 10 string

Beagle Verification

This will contain the results of the Beagle Verification fraud checks that may have been performed.

For all fields, the available return options are NotVerified, Attempted, Verified or Failed.

When using the REST API, a number will be returned which maps as follows:

Field Name Max Length Data Type Description
Email 10 string The result of the Email verification
Phone 10 string The result of the Phone verification

IFrame

The Responsive Shared Page can be displayed on your site as a modal iframe. This provides the security and reduced PCI compliance scope of the Responsive Shared Page with the advantage of customers never leaving your site.

Implementing the Rapid IFrame API is a three step process:

  1. Pass the customer and transaction details to eWAY to generate a Shared Payment URL.
  2. Use the eWAY JavaScript to display the eWAY Rapid IFrame to accept the payment.
  3. Once the transaction has been processed, request the results from eWAY using the Access Code.

Step 1: Create a Shared Payment URL

To request a Shared Payment URL, make a server-side call to the CreateAccessCodeShared method of Rapid API. The service will respond with a Shared Payment URL, an Access Code and return the customer data.

If the request involves an existing Token customer, their details will be returned in the response including the masked credit card number.

If Token Payments are not in use for this transaction, the returned customer data will be an echo of the data in the request.

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.ewaypayments.com/AccessCodesShared
HTTP POST (XML) https://api.ewaypayments.com/CreateAccessCodeShared.xml
HTTP POST (JSON) https://api.ewaypayments.com/CreateAccessCodeShared.json
RPC (XML) https://api.ewaypayments.com/xml-rpc
RPC (JSON) https://api.ewaypayments.com/json-rpc

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.sandbox.ewaypayments.com/AccessCodesShared
HTTP POST (XML) https://api.sandbox.ewaypayments.com/CreateAccessCodeShared.xml
HTTP POST (JSON) https://api.sandbox.ewaypayments.com/CreateAccessCodeShared.json
RPC (XML) https://api.sandbox.ewaypayments.com/xml-rpc
RPC (JSON) https://api.sandbox.ewaypayments.com/json-rpc

Request Field Descriptions

Basic Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
        "Payment": {
           "TotalAmount": 100
        },
        "RedirectUrl": "http://www.example.org",
        "CancelUrl": "http://www.example.org",
        "Method": "ProcessPayment",
        "TransactionType": "Purchase"
        }' \
    https://api.sandbox.ewaypayments.com/AccessCodesShared
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <CreateAccessCodeShared xmlns="https://api.ewaypayments.com/">
            <request>
                <Payment>
                    <TotalAmount>1000</TotalAmount>
                </Payment>
                <RedirectUrl>http://www.example.org</RedirectUrl>
                <CancelUrl>http://www.example.org</CancelUrl>
                <TransactionType>Purchase</TransactionType>
                <Method>ProcessPayment</Method>
            </request>
        </CreateAccessCodeShared>
    </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'RedirectUrl' => 'http://www.eway.com.au',
    'CancelUrl' => "http://www.eway.com.au",
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
    'Payment' => [
        'TotalAmount' => 1000,
    ]
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::RESPONSIVE_SHARED, $transaction);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction();

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);

transaction.setPaymentDetails(paymentDetails);
transaction.setRedirectURL("http://www.eway.com.au");
transaction.setCancelURL("http://www.eway.com.au");
transaction.setTransactionType(TransactionType.Purchase);

CreateTransactionResponse response = client.create(PaymentMethod.ResponsiveShared, transaction);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction()
{
    PaymentDetails = new PaymentDetails()
    {
        TotalAmount = 1000
    },
    RedirectURL = "http://www.eway.com.au",
    CancelURL = "http://www.eway.com.au",
    TransactionType = TransactionTypes.Purchase
};

CreateTransactionResponse response = ewayClient.Create(PaymentMethod.ResponsiveShared, transaction);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.RESPONSIVE_SHARED, {
    "Payment": {
       "TotalAmount": 100
    },
    "RedirectUrl": "http://www.eway.com.au",
    "CancelUrl": "http://www.eway.com.au",
    "TransactionType": "Purchase"
}).then(function (response) {

});

client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new
payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
transaction.payment_details = payment_details
transaction.redirect_url = 'http://www.eway.com.au'
transaction.cancel_url = 'http://www.eway.com.au'
transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::RESPONSIVE_SHARED, transaction)

Complete Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{ 
        "Customer": { 
           "Reference": "A12345", 
           "Title": "Mr.", 
           "FirstName": "John", 
           "LastName": "Smith", 
           "CompanyName": "Demo Shop 123", 
           "JobDescription": "Developer", 
           "Street1": "Level 5", 
           "Street2": "369 Queen Street", 
           "City": "Sydney", 
           "State": "NSW", 
           "PostalCode": "2000", 
           "Country": "au", 
           "Phone": "09 889 0986", 
           "Mobile": "09 889 6542",
           "Email": "demo@example.org",
           "Url": "http://www.eway.com.au"
        }, 
        "ShippingAddress": {
           "ShippingMethod": "NextDay",
           "FirstName": "John",
           "LastName": "Smith",
           "Street1": "Level 5", 
           "Street2": "369 Queen Street", 
           "City": "Sydney", 
           "State": "NSW", 
           "Country": "au", 
           "PostalCode": "2000",
           "Phone": "09 889 0986" 
        }, 
        "Items": [ 
         { 
           "SKU": "12345678901234567890", 
           "Description": "Item Description 1",
           "Quantity": 1,
           "UnitCost": 400,
           "Tax": 100,
           "Total": 500
         }, 
         { 
           "SKU": "123456789012", 
           "Description": "Item Description 2", 
           "Quantity": 1,
           "UnitCost": 400,
           "Tax": 100,
           "Total": 500
         }
        ], 
        "Options": [ 
         { 
           "Value": "Option1" 
         }, 
         { 
           "Value": "Option2" 
         }
        ], 
        "Payment": { 
           "TotalAmount": 1000, 
           "InvoiceNumber": "Inv 21540", 
           "InvoiceDescription": "Individual Invoice Description", 
           "InvoiceReference": "513456",
           "CurrencyCode": "AUD"
        }, 
        "RedirectUrl": "http://www.example.org", 
        "CancelUrl": "http://www.example.org",
        "Method": "ProcessPayment", 
        "DeviceID": "D1234", 
        "CustomerIP": "127.0.0.1", 
        "PartnerID": "ID", 
        "TransactionType": "Purchase",
        "LogoUrl": "https://mysite.com/images/logo4eway.jpg",
        "Language": "EN",
        "CustomerReadOnly": true
        }' \
    https://api.sandbox.ewaypayments.com/AccessCodesShared
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <CreateAccessCodeShared xmlns="https://api.ewaypayments.com/">
            <request>
                <Customer>
                    <Reference>A12345</Reference>
                    <Title>Mr.</Title>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <CompanyName>Demo Shop 123</CompanyName>
                    <JobDescription>Developer</JobDescription>
                    <Street1>Level 5</Street1>
                    <Street2>369 Queen Street</Street2>
                    <City>Sydney</City>
                    <State>NSW</State>
                    <PostalCode>2000</PostalCode>
                    <Country>au</Country>
                    <Email>demo@example.org</Email>
                    <Phone>0289712345</Phone>
                    <Mobile>0289712345</Mobile>
                    <Comments>Customer comments</Comments>
                    <Fax>0289712345</Fax>
                    <Url>http://www.ewaypayments.com</Url>
                </Customer>
                <ShippingAddress>
                    <ShippingMethod>NextDay</ShippingMethod>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <Street1>Level 5</Street1>
                    <Street2>369 Queen Street</Street2>
                    <City>Sydney</City>
                    <State>NSW</State>
                    <PostalCode>2000</PostalCode>
                    <Country>au</Country>
                    <Email>demo@example.org</Email>
                    <Phone>0289712345</Phone>
                    <Fax>0289712345</Fax>
                </ShippingAddress>
                <Items>
                    <LineItem>
                        <SKU>12345678901234567890</SKU>
                        <Description>Item Description 1</Description>
                        <Quantity>1</Quantity>
                        <UnitCost>400</UnitCost>
                        <Tax>100</Tax>
                        <Total>500</Total>
                    </LineItem>
                    <LineItem>
                        <SKU>123456789012</SKU>
                        <Description>Item Description 2</Description>
                        <Quantity>1</Quantity>
                        <UnitCost>400</UnitCost>
                        <Tax>100</Tax>
                        <Total>500</Total>
                    </LineItem>
                </Items>
                <Options>
                    <Option>
                        <Value>Option1</Value>
                    </Option>
                    <Option>
                        <Value>Option2</Value>
                    </Option>
                </Options>
                <Payment>
                    <TotalAmount>1000</TotalAmount>
                    <InvoiceNumber>Inv 21540</InvoiceNumber>
                    <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
                    <InvoiceReference>Individual Invoice Description</InvoiceReference>
                    <CurrencyCode>AUD</CurrencyCode>
                </Payment>
                <RedirectUrl>http://www.example.org</RedirectUrl>
                <CancelUrl>http://www.example.org</CancelUrl>
                <CustomerIP>127.0.0.1</CustomerIP>
                <DeviceID>D1234</DeviceID>
                <TransactionType>Purchase</TransactionType>
                <Method>ProcessPayment</Method>
                <CustomerReadOnly>true</CustomerReadOnly>
                <LogoUrl>https://mysite.com/images/logo4eway.jpg</LogoUrl>
                <Language>EN</Language>
            </request>
        </CreateAccessCodeShared>
    </soap:Body>
</soap:Envelope>

<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'Customer' => [
        'Reference' => 'A12345',
        'Title' => 'Mr.',
        'FirstName' => 'John',
        'LastName' => 'Smith',
        'CompanyName' => 'Demo Shop 123',
        'JobDescription' => 'Developer',
        'Street1' => 'Level 5',
        'Street2' => '369 Queen Street',
        'City' => 'Sydney',
        'State' => 'NSW',
        'PostalCode' => '2000',
        'Country' => 'au',
        'Phone' => '09 889 0986',
        'Mobile' => '09 889 6542',
        'Email' => 'demo@example.org',
        "Url" => "http://www.ewaypayments.com",
    ],
    'ShippingAddress' => [
        'ShippingMethod' => \Eway\Rapid\Enum\ShippingMethod::NEXT_DAY,
        'FirstName' => 'John',
        'LastName' => 'Smith',
        'Street1' => 'Level 5',
        'Street2' => '369 Queen Street',
        'City' => 'Sydney',
        'State' => 'NSW',
        'Country' => 'au',
        'PostalCode' => '2000',
        'Phone' => '09 889 0986',
    ],
    'Items' => [
        [
            'SKU' => '12345678901234567890',
            'Description' => 'Item Description 1',
            'Quantity' => 1,
            'UnitCost' => 400,
            'Tax' => 100,
            // Total is calculated automatically
        ],
        [
            'SKU' => '123456789012',
            'Description' => 'Item Description 2',
            'Quantity' => 1,
            'UnitCost' => 400,
            'Tax' => 100,
        ],
    ],
    'Options' => [
        [
            'Value' => 'Option1',
        ],
        [
            'Value' => 'Option2',
        ],
    ],
    'Payment' => [
        'TotalAmount' => 1000,
        'InvoiceNumber' => 'Inv 21540',
        'InvoiceDescription' => 'Individual Invoice Description',
        'InvoiceReference' => '513456',
        'CurrencyCode' => 'AUD',
    ],
    'RedirectUrl' => 'http://www.example.org',
    'CancelUrl' => "http://www.example.org",
    'DeviceID' => 'D1234',
    'CustomerIP' => '127.0.0.1',
    'PartnerID' => 'ID',
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
    'Capture' => true,
    'LogoUrl' => 'https://mysite.com/images/logo4eway.jpg',
    'Language' => 'EN',
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::RESPONSIVE_SHARED, $transaction);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction();

Customer customer = new Customer();
customer.setReference("A12345");
customer.setTitle("Mr.");
customer.setFirstName("John");
customer.setLastName("Smith");
customer.setCompanyName("eWay");
customer.setJobDescription("Java Developer");
customer.setPhone("09 889 0986");
customer.setMobile("09 889 6542");
customer.setUrl("http://ewaypayments.com");
customer.setCustomerDeviceIP("127.0.0.1");
customer.setEmail("demo@example.org");

Address address = new Address();
address.setStreet1("Level 5");
address.setStreet2("369 Queen Street");
address.setCity("Sydney");
address.setState("NSW");
address.setCountry("au");
address.setPostalCode("2000");
customer.setAddress(address);
transaction.setCustomer(customer);

ShippingDetails shippingDetail = new ShippingDetails();
shippingDetail.setFirstName("John");
shippingDetail.setLastName("Smith");
shippingDetail.setPhone("09 889 0986");
shippingDetail.setShippingMethod(ShippingMethod.LowCost);

Address shipAddress = new Address();
shipAddress.setStreet1("Level 5");
shipAddress.setStreet2("369 Queen Street");
shipAddress.setCity("Sydney");
shipAddress.setState("NSW");
shipAddress.setCountry("au");
shipAddress.setPostalCode("2000");
shippingDetail.setShippingAddress(shipAddress);
transaction.setShippingDetails(shippingDetail);

List<LineItem> items = new ArrayList<>();
LineItem item1 = new LineItem();
item1.setSku("12345678901234567890");
item1.setDescription("Item Description 1");
item1.setQuantity(1);
item1.setUnitCost(400);
item1.setTotalTax(100);
item1.setTotal(500);
items.add(item1);

LineItem item2 = new LineItem();
item2.setSku("123456789012");
item2.setDescription("Item Description 2");
item2.setQuantity(1);
item2.setUnitCost(400);
item2.setTotalTax(100);
item2.setTotal(500);
items.add(item2);

transaction.setLineItems(items);

List<String> options = new ArrayList<>();
options.add("Option1");
options.add("Option2");
transaction.setOptions(options);

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);
paymentDetails.setCurrencyCode("AUD");
paymentDetails.setInvoiceDescription("Individual Invoice Description");
paymentDetails.setInvoiceNumber("Inv 21540");
paymentDetails.setInvoiceReference("513456");
transaction.setPaymentDetails(paymentDetails);

transaction.setPartnerID("ID");
transaction.setCapture(true);
transaction.setRedirectURL("http://www.eway.com.au");
transaction.setCancelURL("http://www.eway.com.au");
transaction.setDeviceID("D1234");
transaction.setTransactionType(TransactionType.Purchase);
transaction.setSaveCustomer(false);

CreateTransactionResponse response = client.create(PaymentMethod.ResponsiveShared, transaction);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction()
{
    Customer = new Customer()
    {
        Reference = "A12345",
        Title = "Mr.",
        FirstName = "John",
        LastName = "Smith",
        CompanyName = "Demo Shop 123",
        JobDescription = "C# Developer",
        Phone = "09 889 0986",
        Mobile = "09 889 6542",
        Url = "http://www.ewaypayments.com",
        Address = new Address()
        {
            Street1 = "Level 5",
            Street2 = "369 Queen Street",
            City = "Sydney",
            State = "NSW",
            Country = "au",
            PostalCode = "2000",

        }
    },
    ShippingDetails = new ShippingDetails()
    {
        FirstName = "John",
        LastName = "Smith",
        Phone = "09 889 0986",
        ShippingAddress = new Address()
        {
            Street1 = "Level 5",
            Street2 = "369 Queen Street",
            City = "Sydney",
            State = "NSW",
            Country = "au",
            PostalCode = "2000"
        },
        ShippingMethod = ShippingMethod.NextDay,
    },
    LineItems = new[] 
    { 
        new LineItem()
        {
            SKU = "12345678901234567890", 
            Description = "Item Description 1",
            Quantity = 1,
            UnitCost = 400
        },
        new LineItem()
        {
            SKU = "123456789012", 
            Description = "Item Description 2",
            Quantity = 1,
            UnitCost = 400,
        }
    }.ToList(),
    Options = new[] 
    { 
        "Option1", 
        "Option2" 
    }.ToList(),
    PaymentDetails = new PaymentDetails()
    {
        TotalAmount = 1000,
        InvoiceNumber = "Inv 21540",
        InvoiceDescription = "Individual Invoice Description",
        InvoiceReference = "513456",
        CurrencyCode = "AUD"
    },
    RedirectURL = "http://www.eway.com.au",
    CancelURL = "http://www.eway.com.au",
    DeviceID = "D1234",
    PartnerID = "ID",
    CustomerIP = "127.0.0.1",
    TransactionType = TransactionTypes.Purchase,
    Capture = true,
    SaveCustomer = false
};

CreateTransactionResponse response = ewayClient.Create(PaymentMethod.ResponsiveShared, transaction);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.RESPONSIVE_SHARED, {
    "Customer": {
       "Reference": "A12345",
       "Title": "Mr.",
       "FirstName": "John",
       "LastName": "Smith",
       "CompanyName": "Demo Shop 123",
       "JobDescription": "Developer",
       "Street1": "Level 5",
       "Street2": "369 Queen Street",
       "City": "Sydney",
       "State": "NSW",
       "PostalCode": "2000",
       "Country": "au",
       "Phone": "09 889 0986",
       "Mobile": "09 889 6542",
       "Email": "demo@example.org",
       "Url": "http://www.ewaypayments.com"
    },
    "ShippingAddress": {
       "ShippingMethod": "NextDay",
       "FirstName": "John",
       "LastName": "Smith",
       "Street1": "Level 5",
       "Street2": "369 Queen Street",
       "City": "Sydney",
       "State": "NSW",
       "Country": "au",
       "PostalCode": "2000",
       "Phone": "09 889 0986"
    },
    "Items": [
     {
       "SKU": "12345678901234567890",
       "Description": "Item Description 1",
       "Quantity": 1,
       "UnitCost": 400,
       "Tax": 100,
       "Total": 500
     },
     {
       "SKU": "123456789012",
       "Description": "Item Description 2",
       "Quantity": 1,
       "UnitCost": 400,
       "Tax": 100,
       "Total": 500
     }
    ],
    "Options": [
     {
       "Value": "Option1"
     },
     {
       "Value": "Option2"
     }
    ],
    "Payment": {
       "TotalAmount": 1000,
       "InvoiceNumber": "Inv 21540",
       "InvoiceDescription": "Individual Invoice Description",
       "InvoiceReference": "513456",
       "CurrencyCode": "AUD"
    },
    "RedirectUrl": "http://www.eway.com.au",
    "CancelUrl": "http://www.eway.com.au",
    "DeviceID": "D1234",
    "CustomerIP": "127.0.0.1",
    "PartnerID": "ID",
    "TransactionType": "Purchase",
    "LogoUrl": "https://mysite.com/images/logo4eway.jpg",
    "Language": "EN",
}).then(function (response) {

});

client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new

customer = EwayRapid::Models::Customer.new
customer.reference = 'A12345'
customer.title = 'Mr.'
customer.first_name = 'John'
customer.last_name = 'Smith'
customer.company_name = 'Company'
customer.job_description = 'Ruby Developer'
customer.phone = '09 889 0986'
customer.mobile = '09 889 0986'
customer.fax = '09 654 1234'
customer.url = 'http://www.ewaypayments.com'
customer.comments = 'customer comment'
customer.customer_device_ip = '127.0.0.1'
customer.email = 'demo@example.org'

address = EwayRapid::Models::Address.new
address.street1 = 'Level 5'
address.street2 = '369 Queen Street'
address.city = 'Sydney'
address.state = 'NSW'
address.country = 'AU'
address.postal_code = '2000'
customer.address = address

transaction.customer = customer

shipping_details = EwayRapid::Models::ShippingDetails.new
shipping_address = EwayRapid::Models::Address.new
shipping_address.street1 = 'Level 5'
shipping_address.street2 = '369 Queen Street'
shipping_address.city = 'Sydney'
shipping_address.state = 'NSW'
shipping_address.country = 'AU'
shipping_address.postal_code = '2000'
shipping_details.shipping_address = shipping_address
shipping_details.first_name = 'John'
shipping_details.last_name = 'Smith'
shipping_details.phone = '09 889 0986'
shipping_details.shipping_method = EwayRapid::Enums::ShippingMethod::LOW_COST
transaction.shipping_details = shipping_details

line_item = EwayRapid::Models::LineItem.new
line_item.sku = '12345678901234567890'
line_item.description = 'Item Description 1'
line_item.quantity = 1
line_item.unit_cost = 400
line_item.tax = 100
line_item.total = 500

line_item1 = EwayRapid::Models::LineItem.new
line_item1.sku = '12345678901234567890'
line_item1.description = 'Item Description 1'
line_item1.quantity = 1
line_item1.unit_cost = 400
line_item1.tax = 100
line_item1.total = 500

line_item2 = EwayRapid::Models::LineItem.new
line_item2.sku = '123456789012'
line_item2.description = 'Item Description 2'
line_item2.quantity = 1
line_item2.unit_cost = 400
line_item2.tax = 100
line_item2.total = 500

line_items = []
line_items.push(line_item1)
line_items.push(line_item2)
transaction.line_items = line_items

options = []
options.push('Option1')
options.push('Option2')
transaction.options = options

payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
payment_details.invoice_number = 'Inv 21540'
payment_details.invoice_description = 'Individual Invoice Description'
payment_details.invoice_reference = '513456'
payment_details.currency_code = 'AUD'
transaction.payment_details = payment_details

transaction.redirect_url = 'http://www.eway.com.au'
transaction.cancel_url = 'http://www.eway.com.au'
transaction.device_id = 'D1234'
transaction.partner_id = 'ID'
transaction.logo_url = 'https://mysite.com/images/logo4eway.jpg'
transaction.header_text = 'My Site Header Text'
transaction.language = 'EN'
transaction.capture = true
transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::RESPONSIVE_SHARED, transaction)
Field Name Field Type Max Length Data Type Description
CustomerIP** O 50 string The customer’s IP address
Method R 20 string The action to perform with this request (see Payment Methods for more information).
One of: ProcessPayment, CreateTokenCustomer, UpdateTokenCustomer, TokenPayment, Authorise
TransactionType R Int enum The type of transaction you’re performing (see Transaction Types).
One of: Purchase, MOTO, Recurring
DeviceID O 50 string The identification name/number for the device or application used to process the transaction
PartnerID O 50 string The partner ID generated from an eWAY partner agreement
RedirectUrl R 512 string, URL This variable is required but currently unused. Any valid URL can be used.
CancelUrl R 512 string, URL This variable is required but currently unused. Any valid URL can be used.
LogoUrl O 512 string, URL The URL of the merchant’s logo to display in the iframe. This must start with https://. If blank or omitted, the logo defined in the Shared Page settings in MYeWAY will be used.
Language O 5 string Language code determines the language that the iframe will be displayed in.
One of: EN (English, default), ES (Spanish)
CustomerReadOnly O boolean When set to false, cardholders will be able to edit their email & phone number, even if it’s sent through in the server side request. To fetch the details the customer entered, do a Transaction Query once the transaction is complete.
Capture O 6 boolean Rapid SDK Libraries Only Set to true to capture funds immediately (default), set to false to perform an authorisation and only hold funds.
SaveCustomer O 6 boolean Rapid SDK Libraries Only Set to true to create a token customer when the transaction is complete

Field types: R – Required, O – Optional

**When this field is present along with the Customer Country field, any transaction will be processed using Beagle Fraud Alerts

Payment

This set of fields contains the details of the payment being processed. This section is required when the Method field is set to ProcessPayment or TokenPayment.

Field Name Field Type Max Length Data Type Description
TotalAmount R 10 int The amount of the transaction in the lowest denomination for the currency (e.g. a $27.00 transaction would have a TotalAmount value of ‘2700’).
The value of this field must be 0 for the CreateTokenCustomer andUpdateTokenCustomer methods. This field is required when the Action is ProcessPayment or TokenPayment.
InvoiceNumber O 12 string The merchant’s invoice number for this transaction.
InvoiceDescription O 64 string A short description of the purchase that the customer is making.
InvoiceReference O 50 string The merchant’s reference number for this transaction.
CurrencyCode O 3 string The ISO 4217 3 character code that represents the currency that this transaction is to be processed in. If no value for this field is provided, the merchant’s default currency is used. This should be in uppercase.
e.g. Australian Dollars = AUD

Customer

This set of fields contains the details of the merchant’s customer. These are used when creating and updating token customers.

Field Name Field Type Max Length Data Type Description
TokenCustomerID C 16 long An eWAY-issued ID that represents the Token customer to be loaded for this action.
Required for UpdateTokenCustomer method
Reference O 50 string The merchant’s reference for this customer.
Title† C 5 string The customer’s title, empty string allowed, which will default to Mr.
One of: Mr., Ms., Mrs., Miss, Dr., Sir., Prof.
FirstName† C 50 string The customer’s first name.
LastName† C 50 string The customer’s last name
CompanyName O 50 string The customer’s company name.
JobDescription O 50 string The customer’s job description / title.
Street1 O 50 string The customer’s street address.
Street2 O 50 string The customer’s street address.
City O 50 string The customer’s city / town / suburb.
State O 50 string The customer’s state / county.
PostalCode O 30 string The customer’s post / zip code.
Country† C 2 string The customer’s country. This should be the two letter ISO 3166-1 alpha-2 code. This field must be lower case.
e.g. Australia = au
Email O 50 string The customer’s email address, which must be correctly formatted if present
Phone O 32 string The customer’s phone number.
Mobile O 32 string The customer’s mobile phone number.
Comments O 255 string Any comments the merchant wishes to add about the customer.
Fax O 32 string The customer’s fax number.
Url O 512 string The customer’s website, which must be correctly formatted if present.

Field Types: O – Optional, C – Conditionally Required

† When creating a new Token customer, all conditional fields(†)are required

Shipping Address

The ShippingAddress section is optional. It is used by Beagle Fraud Alerts (Enterprise) to calculate a risk score for this transaction.

Field Name Field Type Max Length Data Type Description
ShippingMethod C 16 long The method used to ship the customer’s order.
One of: Unknown, LowCost, DesignatedByCustomer, International, Military, NextDay, StorePickup, TwoDayService, ThreeDayService, Other
FirstName O 50 string The first name of the person the order is shipped to.
LastName O 50 string The last name of the person the order is shipped to.
Street1 O 50 string The street address the order is shipped to.
Street2 O 50 string The street address of the shipping location.
City O 50 string The shipping city / town / suburb.
State O 50 string The shipping state / county.
PostalCode O 30 string The shipping post / zip code.
Country† C 2 string The shipping’s country. This should be the two letter ISO 3166-1 alpha-2 code. This field must be lower case.
e.g. Australia = au
Email O 50 string The shipping email address, which must be correctly formatted if present.
Phone O 32 string The phone number of the person the order is shipped to.
Fax O 32 string The fax number of the shipping location.

Items

The Items section is optional. If provided, it should contain a list of line items purchased by the customer, up to a maximum of 99 items. It is used by Beagle Fraud Alerts (Enterprise) to calculate a risk score for this transaction. Items have the following fields:

Field Name Field Type Max Length Data Type Description
SKU O 12 string The stock keeping unit used to identify this line item
Description O 26 string A brief description of the product
Quantity O 6 int The purchased quantity
UnitCost O 8 int The pre-tax cost per unit of the product in the lowest denomination
Tax O 8 int The tax amount that applies to this line item in the lowest denomination
Total O 8 int The total amount charged for this line item in the lowest denomination

Options

This section is optional. Anything appearing in this section is not displayed to the customer, but it is returned to the merchant in the result. Up to 99 options can be defined. Each option has just one field:

Field Name Field Type Max Length Data Type Description
Value O 254 string This field is not displayed to the customer but is returned in the result. Anything can be used here, which can be useful for tracking transactions. Additional characters are truncated at 254

Field types: O – Optional

Response Fields Descriptions

Example Response

{
    "SharedPaymentUrl": "https://secure-au.sandbox.ewaypayments.com/sharedpage/sharedpayment?AccessCode=44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2",
    "AccessCode": "44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2",
    "Customer": {
        "CardNumber": "",
        "CardStartMonth": "",
        "CardStartYear": "",
        "CardIssueNumber": "",
        "CardName": "",
        "CardExpiryMonth": "",
        "CardExpiryYear": "",
        "IsActive": false,
        "TokenCustomerID": null,
        "Reference": "A12345",
        "Title": "Mr.",
        "FirstName": "John",
        "LastName": "Smith",
        "CompanyName": "Demo Shop 123",
        "JobDescription": "Developer",
        "Street1": "Level 5",
        "Street2": "369 Queen Street",
        "City": "Sydney",
        "State": "NSW",
        "PostalCode": "2000",
        "Country": "au",
        "Email": "demo@example.org",
        "Phone": "09 889 0986",
        "Mobile": "09 889 6542",
        "Comments": "",
        "Fax": "",
        "Url": "http://www.ewaypayments.com"
    },
    "Payment": {
        "TotalAmount": 1000,
        "InvoiceNumber": "Inv 21540",
        "InvoiceDescription": "Individual Invoice Description",
        "InvoiceReference": "513456",
        "CurrencyCode": "AUD"
    },
    "FormActionURL": "https://secure-au.sandbox.ewaypayments.com/AccessCode/44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2",
    "CompleteCheckoutURL": null,
    "Errors": null
}
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <CreateAccessCodeSharedResponse xmlns="https://api.ewaypayments.com/">
         <CreateAccessCodeSharedResult>
            <AccessCode>44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2</AccessCode>
            <Customer>
               <TokenCustomerID xsi:nil="true"/>
               <Reference>A12345</Reference>
               <Title>Mr.</Title>
               <FirstName>John</FirstName>
               <LastName>Smith</LastName>
               <CompanyName>Demo Shop 123</CompanyName>
               <JobDescription>Developer</JobDescription>
               <Street1>Level 5</Street1>
               <Street2>369 Queen Street</Street2>
               <City>Sydney</City>
               <State>NSW</State>
               <PostalCode>2000</PostalCode>
               <Country>au</Country>
               <Email>demo@example.org</Email>
               <Phone>0289712345</Phone>
               <Mobile>0289712345</Mobile>
               <Comments>Customer comments</Comments>
               <Fax>0289712345</Fax>
               <Url>http://www.ewaypayments.com</Url>
               <CardNumber/>
               <CardStartMonth/>
               <CardStartYear/>
               <CardIssueNumber/>
               <CardName/>
               <CardExpiryMonth/>
               <CardExpiryYear/>
               <IsActive>false</IsActive>
            </Customer>
            <Payment>
               <TotalAmount>1000</TotalAmount>
               <InvoiceNumber>Inv 21540</InvoiceNumber>
               <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
               <InvoiceReference>Individual Invoice Description</InvoiceReference>
               <CurrencyCode>AUD</CurrencyCode>
            </Payment>
            <FormActionURL>https://secure-au.sandbox.ewaypayments.com/Process</FormActionURL>            
            <SharedPaymentUrl>https://secure-au.sandbox.ewaypayments.com/sharedpage/sharedpayment?AccessCode=44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2</SharedPaymentUrl>
         </CreateAccessCodeSharedResult>
      </CreateAccessCodeSharedResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available $response properties

if (!$response->getErrors()) {
    $sharedPaymentUrl = $response->SharedPaymentUrl;
} else {
    foreach ($response->getErrors() as $error) {
        echo "Error: ".\Eway\Rapid::getMessage($error)."<br>";
    }
}

// See the JSON tab for all the available response properties

if (response.getErrors().isEmpty()) {
    // Use this URL to display the iframe
    String sharedPaymentUrl = response.getSharedPaymentUrl();
} else {
    for (String errorcode: response.getErrors()) {
        System.out.println("Response Messages: " + RapidSDK.userDisplayMessage(errorcode, "en"));
    };
}
if (response.Errors == null)
{
    string sharedPaymentUrl = response.SharedPaymentUrl;
}
else
{
    foreach (string errorCode in response.Errors)
    {
        Console.WriteLine("Response Messages: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
    }
}
// See the JSON tab for all the available response properties

.then(function (response) {
    if (response.getErrors().length == 0) {
        var sharedPaymentUrl = response.get('SharedPaymentUrl');
    } else {
        response.getErrors().forEach(function(error) {
            console.log("Response Messages: " + rapid.getMessage(error, "en"));
        });
    }
})
.catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});
# See the JSON tab for all the available response properties

if response.errors.empty?
  sharedpage_url = response.shared_payment_url
else
  response.errors.each { |e| puts "Response message: "+ EwayRapid::RapidClient.user_display_message(e) }
end

Field Name Max Length Data Type Description
AccessCode 512 String A unique Access Code that is used to identify this transaction with Rapid API. This code will need to be present for all future requests associated with this transaction
Errors 512 String Any error codes associates with the request, these can be looked up in the Response Codes section.

Customer

Field Name Max Length Data Type Description
CardNumber 50 string The Token customer’s masked credit card number
CardName 50 string The Token customer’s card holder name
CardExpiryMonth 2 string The Token customer’s card expiry month
CardExpiryYear 2 string The Token customer’s card expiry year
CardStartMonth* 2 string The Token customer’s card valid from month
CardStartYear* 2 string The Token customer’s card valid from year
CardIssueNumber* 2 string The Token customer’s card issue number
IsActive boolean If the Token customer is active
TokenCustomerID 16 long The Token customer’s unique Token Customer ID Only returned if included in the CreateAccessCodeRequest on TokenPayment and UpdateTokenCustomer methods
Reference 50 string The merchant’s reference for this customer
Title 5 string The customer’s title.
FirstName 50 string The customer’s first name.
LastName 50 string The customer’s last name
CompanyName 50 string The customer’s company name.
JobDescription 50 string The customer’s job description / title.
Street1 50 string The customer’s street address.
Street2 50 string The customer’s street address.
City 50 string The customer’s city / town / suburb.
State 50 string The customer’s state / county.
PostalCode 30 string The customer’s post / zip code.
Country 2 string The customer’s country formatted as a two letter ISO 3166-1 alpha-2 code
Email 50 string The customer’s email address
Phone 32 string The customer’s phone number.
Mobile 32 string The customer’s mobile phone number.
Comments 255 string Any comments merchant added about the customer.
Fax 32 string The customer’s fax number.
Url 512 string The customer’s website.

*Applies to UK only

Payment

Field Name Max Length Data Type Description
TotalAmount 10 int The amount of the transaction in cents, as passed in original request.
InvoiceNumber 16 string The merchant’s invoice number for this transaction.
InvoiceDescription 64 string A short description of the purchase that the customer is making.
InvoiceReference 50 string The merchant’s reference number for this transaction.
CurrencyCode 3 string The ISO 4217 3 character code that represents the currency that this transaction is to be processed in.

Step 2: Display the eWAY Rapid IFrame

Example iframe display script

<script src="https://secure.ewaypayments.com/scripts/eCrypt.min.js"></script>
<script>

    /**
     * eWAY Rapid IFrame config object. Contains the SharedPaymentUrl
     */
    var eWAYConfig = {
      sharedPaymentUrl: "<<SharedPaymentUrl Goes Here>>"
    };

    /**
     * Example eWAY Rapid IFrame callback
     */
    function resultCallback(result, transactionID, errors) {
      if (result == "Complete") {
        alert("Payment complete! eWAY Transaction ID: " + transactionID);
      } else if (result == "Error") {
        alert("There was a problem completing the payment: " + errors);
      }
    }

</script>

<button type="button" onClick="eCrypt.showModalPayment(eWAYConfig, resultCallback);">Pay with eWAY</button>

Once the Access Code has been received, the Rapid IFrame can be displayed to the customer. To show the iframe involves a simply adding the eWAY eCrypt library and a JavaScript call:

<script src="https://secure.ewaypayments.com/scripts/eCrypt.min.js"></script>

eCrypt.showModalPayment(eWAYConfig, resultCallback)

This call can be triggered in whatever way makes sense for your application: on a click of a button or even just when the page loads.

The showModalPayment function accepts two arguments:

Config

The Config object passes the following configuration information to the iframe

Value Description
sharedPaymentUrl The SharedPaymentUrl returned from eWAY in step 1.

Note: The first version of IFrame required the variables endpoint and accessCode in the config. This will continue to work, except for UK merchants who must use sharedPaymentUrl.

Callback

The Callback function is called once the customer has completed the transaction in the iframe, cancelled the iframe or if there was an error loading the iframe. The function should accept three arguments, which contain the following:

Argument Description
result Whether a transaction was processed. One of Complete, Cancel, or Error
transactionID The transaction ID if the transaction was completed
errors Any errors associated with displaying the iframe

Note: If the transaction was successful is not returned to the callback, this can only be determined by requesting the result as described in Step 3. The result returned to the callback only describes if the iframe could be shown.

Step 3: Request results

Once the customer has completed the payment, the merchant will need to request the results from eWAY by calling the GetAccessCodeResult method of the Rapid API web service. This is done using the AccessCode requested in Step 1.

If CustomerReadOnly was set to false, the details the customer entered in the iframe can be fetched using Transaction Query.

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.ewaypayments.com/AccessCode/{AccessCode}
HTTP POST (XML) https://api.ewaypayments.com/GetAccessCodeResult.xml
HTTP POST (JSON) https://api.ewaypayments.com/GetAccessCodeResult.json
RPC (XML) https://api.ewaypayments.com/xml-rpc
RPC (JSON) https://api.ewaypayments.com/json-rpc

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.sandbox.ewaypayments.com/AccessCode/{AccessCode}
HTTP POST (XML) https://api.sandbox.ewaypayments.com/GetAccessCodeResult.xml
HTTP POST (JSON) https://api.sandbox.ewaypayments.com/GetAccessCodeResult.json
RPC (XML) https://api.sandbox.ewaypayments.com/xml-rpc
RPC (JSON) https://api.sandbox.ewaypayments.com/json-rpc

Request Field Descriptions

Example request

curl --request GET \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    https://api.sandbox.ewaypayments.com/AccessCode/44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <GetAccessCodeResult xmlns="https://api.ewaypayments.com/">
         <request>
            <AccessCode>44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2</AccessCode>
         </request>
      </GetAccessCodeResult>
   </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$response = $client->queryTransaction('44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2');
RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

QueryTransactionResponse response = client.queryTransaction("44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2");
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

QueryTransactionResponse response = ewayClient.QueryTransaction("44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2");
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.queryTransaction("44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2")
.then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

response = client.query_transaction_by_access_code('44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2')
Field Name Field Type Max Length Data Type Description
AccessCode R 512 string Access Code returned in Step 1.

Field Types: R – Required

If a transaction has been processed, the response received from eWAY will contain all relevant details such as the bank authorisation code and a unique number that identifies the transaction in eWAY’s database (TransactionID).

If a Token customer was involved, the ID that eWAY uses to identify that customer will also be returned.

All responses will contain a response code and response message that represents the result of the action performed.

If applicable, the response will also contain information about the payment that has been processed, as well as the results of any Beagle risk analysis that was performed.

Response Field Descriptions

Example response

{
    "AccessCode": "44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2",
    "AuthorisationCode": "522587",
    "ResponseCode": "00",
    "ResponseMessage": "A2000",
    "InvoiceNumber": "Inv 21540",
    "InvoiceReference": "513456",
    "TotalAmount": 1000,
    "TransactionID": 11259580,
    "TransactionStatus": true,
    "TokenCustomerID": null,
    "BeagleScore": 0,
    "Options": [{
        "Value": "Option1"
    }, {
        "Value": "Option2"
    }],
    "Verification": {
        "CVN": 0,
        "Address": 0,
        "Email": 0,
        "Mobile": 0,
        "Phone": 0
    },
    "BeagleVerification": {
        "Email": 0,
        "Phone": 0
    },
    "Errors": null
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <GetAccessCodeResultResponse xmlns="https://api.ewaypayments.com/">
         <GetAccessCodeResultResult>
            <AccessCode>44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2</AccessCode>
            <AuthorisationCode>522587</AuthorisationCode>
            <ResponseCode>00</ResponseCode>
            <ResponseMessage>A2000</ResponseMessage>
            <InvoiceNumber>Inv 21540</InvoiceNumber>
            <InvoiceReference>513456</InvoiceReference>
            <TotalAmount>1000</TotalAmount>
            <TransactionID>11259580</TransactionID>
            <TransactionStatus>true</TransactionStatus>
            <TokenCustomerID xsi:nil="true"/>
            <BeagleScore>0</BeagleScore>
            <Options>
               <Option>
                  <Value>Option1</Value>
               </Option>
               <Option>
                  <Value>Option2</Value>
               </Option>
            </Options>
            <Verification>
               <CVN>Unchecked</CVN>
               <Address>Unchecked</Address>
               <Email>Unchecked</Email>
               <Mobile>Unchecked</Mobile>
               <Phone>Unchecked</Phone>
            </Verification>
            <BeagleVerification>
               <Email>NotVerified</Email>
               <Phone>NotVerified</Phone>
            </BeagleVerification>
         </GetAccessCodeResultResult>
      </GetAccessCodeResultResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available properties

$transactionResponse = $response->Transactions[0];

if ($transactionResponse->TransactionStatus) {
    echo 'Payment successful! ID: '.$transactionResponse->TransactionID;
} else {
    $errors = split(', ', $transactionResponse->ResponseMessage);
    foreach ($errors as $error) {
        echo "Payment failed: ".\Eway\Rapid::getMessage($error)."<br>";
    }
}

// See the JSON tab for all the available properties

if (response.getTransactionStatus().isStatus()) {
    System.out.println("Payment successful! ID: " + response.getTransactionStatus().getTransactionID());
} else {
    String[] errorcodes = response.getTransactionStatus().getProcessingDetails().getResponseMessage().split(",");
    for (String errorcode: errorcodes) {
        System.out.println("Response Messages: " + RapidSDK.userDisplayMessage(errorcode.trim(), "en"));
    }
}
// See the JSON tab for all the available properties

if ((bool)response.TransactionStatus.Status)
{
    Console.WriteLine("Payment successful! ID: " + response.TransactionStatus.TransactionID);
}
else
{
    string[] errorCodes = response.TransactionStatus.ProcessingDetails.getResponseMessages();
    foreach (string errorCode in errorCodes)
    {
        Console.WriteLine("Response Message: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
    }
}
// See the JSON tab for all the available properties

.then(function (response) {
    if (response.get('Transactions[0].TransactionStatus')) {
        console.log('Payment successful! ID: ' + response.get('Transactions[0].TransactionID'));
    } else {
        var errorCodes = response.get('Transactions[0].ResponseMessage').split(', ');
        errorCodes.forEach(function(errorCode) {
            console.log("Response Message: " + rapid.getMessage(errorCode, "en"));
        });
    }
}).catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});

if response.transaction_status.status?
  puts "Payment successful! ID: #{response.transaction_status.transaction_id.to_s}"
else
  puts "Failed! Message #{response.transaction_status.processing_details.response_message}"
end

Field Name Max Length Data Type Description
AccessCode 512 string An echo of the access code used in the request
AuthorisationCode 6 string The authorisation code for this transaction as returned by the bank
ResponseCode 2 string The two digit response code returned from the bank
ResponseMessage 512 string One or more Response Codes that describes the result of the action performed.
If a Beagle Alert is triggered, this may contain multiple codes:
e.g. D4405, F7003
InvoiceNumber 64 string An echo of the merchant’s invoice number for this transaction
InvoiceReference 64 string An echo of the merchant’s reference number for this transaction
TotalAmount 10 int The amount that was authorised for this transaction. If card surcharge is enabled, the TotalAmount will include the surcharge.
TransactionID 8 int A unique identifier that represents the transaction in eWAY’s system
TransactionStatus 16 boolean A Boolean value that indicates whether the transaction was successful or not
TokenCustomerID‡ 16 long An eWAY-issued ID that represents the Token customer that was loaded or created for this transaction (if applicable)
BeagleScore** 6 string Fraud score representing the estimated probability that the order is fraud. A value between 0.01 to 100.00 representing the % risk the transaction is fraudulent. On Sandbox the score will be -1 unless it is configured to fail for Risk Score, in which case the value will be 101.
Errors 512 string A comma separated list of any error encountered, these can be looked up in the Response Codes section.

*This field is only present if the transaction was processed using Beagle Free

This field is only present if processing a Token transaction, creating or updating a Token customer

Options

The Options collection passed in the original request will be echoed back in the response here.

Field Name Max Length Data Type Description
Value 255 string An echo of the option submitted for this transaction

Verification

These fields are currently unused

Field Name Max Length Data Type Description
CVN 10 string
Address 10 string
Email 10 string
Mobile 10 string
Phone 10 string

Beagle Verification

These fields are currently unused

Field Name Max Length Data Type Description
Email 10 string
Phone 10 string

Secure Fields

eWAY’s Secure Fields solution provides the flexibility of a form that appears entirely on the merchant’s site, with fields that are hosted securely by eWAY. This is done by using JavaScript to replace specified divs with iframes which consist only of the input text field.

Since the payment form is displayed on the site, it is important that SSL is used to secure the page and provide reassurance to customers, increasing your basket conversion.

Implementing eWAY’s Secure Fields requires:

  1. Using JavaScript and HTML to add the Secure Fields to the website
  2. Passing the Secure Field Code using the Direct Connection API to complete the transaction

Configuring Secure Fields

<script type="text/javascript">
    var publicApiKey = "epk-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
    var fieldStyles = "line-height: 1; height: 28px; border: 1px solid #AAA; color: #000; padding: 2px;";

    var nameFieldConfig = {
            publicApiKey: publicApiKey,
            fieldDivId: "eway-secure-field-name",
            fieldType: "name",
            styles: fieldStyles 
        };
    var cardFieldConfig = {
            publicApiKey: publicApiKey,
            fieldDivId: "eway-secure-field-card",
            fieldType: "card",
            styles: fieldStyles,
            maskValues: false
        };
    var expiryFieldConfig = {
            publicApiKey: publicApiKey,
            fieldDivId: "eway-secure-field-expiry",
            fieldType: "expiry",
            styles: fieldStyles
        };
    var cvnFieldConfig = {
            publicApiKey: publicApiKey,
            fieldDivId: "eway-secure-field-cvn",
            fieldType: "cvn",
            styles: fieldStyles
        };
</script>

<form method="POST" action="/createTransaction" id="payment_form">
    Card Name: <div id="eway-secure-field-name"></div><br>
    Card Number: <div id="eway-secure-field-card"></div><br>
    Card Expiry: <div id="eway-secure-field-expiry"></div><br>
    Card CVN: <div id="eway-secure-field-cvn"></div><br><br>
    <input type="hidden" id="securefieldcode" name="SecuredCardData" value="" />
    <input type="submit" value="Process" text="Process" />    
</form>   

Step 1: Configure the fields

Each Secure Field requires a config that tells eWAY what field to display and how it should look. This is done with a JavaScript object, which accepts the following values:

*denotes a required field

Each field requires a corresponding <div> with the id defined in the configuration. A height style is recommended for the divs to restrict their size.

Creating a Secure Fields callback

<script type="text/javascript">
    function secureFieldCallback(event) {
        if (!event.fieldValid) {
            alert(event.errors);
        } else {
            // set the hidden Secure Field Code field
            var s = document.getElementById("securefieldcode");
            s.value = event.secureFieldCode
        }
    }
</script>

Step 2: Create a callback

The Secure Fields will return data via a JavaScript callback function. This data contains the secureFieldCode to process the transaction, along with useful details such as validation and error states. The function should accept one parameter, which contains the following values:

Note that this callback is called each time the associated Secure Field is updated or focus is lost.

Initialising Secure Fields

<script src="https://secure.ewaypayments.com/scripts/eWAY.min.js" data-init="false"></script>

<script type="text/javascript">
    window.onload = function () {
        eWAY.setupSecureField(nameFieldConfig, secureFieldCallback);
        eWAY.setupSecureField(cardFieldConfig, secureFieldCallback);
        eWAY.setupSecureField(expiryFieldConfig, secureFieldCallback);
        eWAY.setupSecureField(cvnFieldConfig, secureFieldCallback);
    };
</script>

Step 3: Initialise the Secure Fields

To initialise the Secure Fields, first the eWAY.js JavaScript needs to be included:

<script src="https://secure.ewaypayments.com/scripts/eWAY.min.js" data-init="false"></script>

Then each field should be initialised using the function eWAY.setupSecureField(). This accepts two parameters: A configuration object and a callback function.

When the page is loaded, the Secure Fields will be loaded into the specified divs. The secureFieldCode returned in the callback function should be submitted with any other data being captured on the page when the users is ready.

Basic Direct request for Secure Fields

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
        "Payment": {
           "TotalAmount": 1000
        },
        "Method": "ProcessPayment",
        "TransactionType": "Purchase",
        "SecuredCardData": "44DD7jYYyRgaQnVibOAsYbbFIYmSXbS6hmTxosAhG6CK1biw="
        }' \
    https://api.sandbox.ewaypayments.com/Transaction
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <DirectPayment xmlns="https://api.ewaypayments.com/">
            <request>
                <Payment>
                    <TotalAmount>1000</TotalAmount>
                </Payment>
                <Method>ProcessPayment</Method>
                <TransactionType>Purchase</TransactionType>
                <SecuredCardData>44DD7jYYyRgaQnVibOAsYbbFIYmSXbS6hmTxosAhG6CK1biw=</SecuredCardData>
            </request>
        </DirectPayment>
    </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'Payment' => [
        'TotalAmount' => 1000,
    ],
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
    'SecuredCardData' => '44DD7jYYyRgaQnVibOAsYbbFIYmSXbS6hmTxosAhG6CK1biw=',
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction);
RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction();

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);

transaction.setPaymentDetails(paymentDetails);
transaction.setTransactionType(TransactionType.Purchase);
transaction.setSecuredCardData("44DD7jYYyRgaQnVibOAsYbbFIYmSXbS6hmTxosAhG6CK1biw=");

CreateTransactionResponse response = client.create(PaymentMethod.Direct, transaction);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction()
{
    PaymentDetails = new PaymentDetails()
    {
        TotalAmount = 1000
    },
    TransactionType = TransactionTypes.Purchase,
    SecuredCardData = "44DD7jYYyRgaQnVibOAsYbbFIYmSXbS6hmTxosAhG6CK1biw="
};

CreateTransactionResponse response = ewayClient.Create(PaymentMethod.Direct, transaction);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.DIRECT, {
    "Payment": {
       "TotalAmount": 1000
    },
    "TransactionType": "Purchase",
    "SecuredCardData": "44DD7jYYyRgaQnVibOAsYbbFIYmSXbS6hmTxosAhG6CK1biw="
}).then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new

payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
transaction.payment_details = payment_details

transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE
transaction.secured_card_data = '44DD7jYYyRgaQnVibOAsYbbFIYmSXbS6hmTxosAhG6CK1biw='

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::DIRECT, transaction)

Step 4: Complete the transaction with Rapid Direct

Once the form has been submitted and the secureFieldCode passed to your server, a transaction can be processed by calling Rapid’s Direct Connection API.

This works the same as a standard Direct Connection request, however instead of using CardDetails, the secureFieldCode should be passed in the SecuredCardData field. A purchase or a create token transaction can be completed with this data.

Refunds

Full and partial refunds can be processed for any transaction in eWAY.

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.ewaypayments.com/Transaction/{TransactionID}/Refund
HTTP POST (XML) https://api.ewaypayments.com/DirectRefund.xml
HTTP POST (JSON) https://api.ewaypayments.com/DirectRefund.json
RPC (XML) https://api.ewaypayments.com/xml-rpc
RPC (JSON) https://api.ewaypayments.com/json-rpc

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.sandbox.ewaypayments.com/Transaction/{TransactionID}/Refund
HTTP POST (XML) https://api.sandbox.ewaypayments.com/DirectRefund.xml
HTTP POST (JSON) https://api.sandbox.ewaypayments.com/DirectRefund.json
RPC (XML) https://api.sandbox.ewaypayments.com/xml-rpc
RPC (JSON) https://api.sandbox.ewaypayments.com/json-rpc

Request Field Descriptions

Basic Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
        "Refund": {
           "TotalAmount": 10
        }
        }' \
    https://api.sandbox.ewaypayments.com/Transaction/11259550/Refund
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <DirectRefund xmlns="https://api.ewaypayments.com/">
            <request>
                <Refund>
                    <TotalAmount>10</TotalAmount>
                    <TransactionID>11259550</TransactionID>
                </Refund>
            </request>
        </DirectRefund>
    </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$refund = [
    'Refund' => [
        'TransactionID' => 11259550,
        'TotalAmount' => 10
    ],
];

$response = $client->refund($refund);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

RefundDetails refundDetails = new RefundDetails();
refundDetails.setOriginalTransactionID("11259550");
refundDetails.setTotalAmount(10);

Refund refund = new Refund();
refund.setRefundDetails(refundDetails);

RefundResponse response = client.refund(refund);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Refund refund = new Refund()
{
    RefundDetails = new RefundDetails()
    {
        TotalAmount = 100,
        OriginalTransactionID = 11259550
    }
};

RefundResponse refundResponse = ewayClient.Refund(refund);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.refund({
    "Refund": {
       "TotalAmount": 10,
       "TransactionID": 11259550
    }
}).then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

refund = EwayRapid::Models::Refund.new
refund_details = EwayRapid::InternalModels::RefundDetails.new
refund_details.total_amount = 10
refund_details.original_transaction_id = 11259550
refund.refund_details = refund_details

response = client.refund(refund)

Complete Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{ 
        "Customer": { 
           "Reference": "A12345", 
           "Title": "Mr.", 
           "FirstName": "John", 
           "LastName": "Smith", 
           "CompanyName": "Demo Shop 123", 
           "JobDescription": "Developer", 
           "Street1": "Level 5", 
           "Street2": "369 Queen Street", 
           "City": "Sydney", 
           "State": "NSW", 
           "PostalCode": "2000", 
           "Country": "au", 
           "Phone": "09 889 0986", 
           "Mobile": "09 889 6542",
           "Email": "demo@example.org",
           "Url": "http://www.ewaypayments.com",
            "CardDetails": { 
             "ExpiryMonth": "12", 
             "ExpiryYear": "25"
           }
        }, 
        "ShippingAddress": {
           "ShippingMethod": "NextDay",
           "FirstName": "John",
           "LastName": "Smith",
           "Street1": "Level 5", 
           "Street2": "369 Queen Street", 
           "City": "Sydney", 
           "State": "NSW", 
           "Country": "au", 
           "PostalCode": "2000",
           "Phone": "09 889 0986" 
        }, 
        "Items": [ 
         { 
           "SKU": "12345678901234567890", 
           "Description": "Item Description 1",
           "Quantity": 1,
           "UnitCost": 400,
           "Tax": 100,
           "Total": 500
         }, 
         { 
           "SKU": "123456789012", 
           "Description": "Item Description 2", 
           "Quantity": 1,
           "UnitCost": 400,
           "Tax": 100,
           "Total": 500
         }
        ], 
        "Options": [ 
         { 
           "Value": "Option1" 
         }, 
         { 
           "Value": "Option2" 
         }
        ], 
        "Refund": { 
           "TotalAmount": 10, 
           "InvoiceNumber": "Inv 21540", 
           "InvoiceDescription": "Individual Invoice Description", 
           "InvoiceReference": "513456",
           "CurrencyCode": "AUD"
        }, 
        "DeviceID": "D1234", 
        "CustomerIP": "127.0.0.1", 
        }' \
    https://api.sandbox.ewaypayments.com/Transaction/11259550/Refund
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <DirectRefund xmlns="https://api.ewaypayments.com/">
            <request>
                <Customer>
                    <Reference>A12345</Reference>
                    <Title>Mr.</Title>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <CompanyName>Demo Shop 123</CompanyName>
                    <JobDescription>Developer</JobDescription>
                    <Street1>Level 5</Street1>
                    <Street2>369 Queen Street</Street2>
                    <City>Sydney</City>
                    <State>NSW</State>
                    <PostalCode>2000</PostalCode>
                    <Country>au</Country>
                    <Email>demo@example.org</Email>
                    <Phone>0289712345</Phone>
                    <Mobile>0289712345</Mobile>
                    <Comments>Customer comments</Comments>
                    <Fax>0289712345</Fax>
                    <Url>http://www.ewaypayments.com</Url>
                    <CardDetails>
                        <ExpiryMonth>12</ExpiryMonth>
                        <ExpiryYear>25</ExpiryYear>
                    </CardDetails>
                </Customer>
                <ShippingAddress>
                    <ShippingMethod>NextDay</ShippingMethod>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <Street1>Level 5</Street1>
                    <Street2>369 Queen Street</Street2>
                    <City>Sydney</City>
                    <State>NSW</State>
                    <PostalCode>2000</PostalCode>
                    <Country>au</Country>
                    <Email>demo@example.org</Email>
                    <Phone>0289712345</Phone>
                    <Fax>0289712345</Fax>
                </ShippingAddress>
                <Items>
                    <LineItem>
                        <SKU>12345678901234567890</SKU>
                        <Description>Item Description 1</Description>
                        <Quantity>1</Quantity>
                        <UnitCost>400</UnitCost>
                        <Tax>100</Tax>
                        <Total>500</Total>
                    </LineItem>
                    <LineItem>
                        <SKU>123456789012</SKU>
                        <Description>Item Description 2</Description>
                        <Quantity>1</Quantity>
                        <UnitCost>400</UnitCost>
                        <Tax>100</Tax>
                        <Total>500</Total>
                    </LineItem>
                </Items>
                <Options>
                    <Option>
                        <Value>Option1</Value>
                    </Option>
                    <Option>
                        <Value>Option2</Value>
                    </Option>
                </Options>
                <Refund>
                    <TotalAmount>100</TotalAmount>
                    <InvoiceNumber>Inv 21540</InvoiceNumber>
                    <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
                    <InvoiceReference>Individual Invoice Description</InvoiceReference>
                    <CurrencyCode>AUD</CurrencyCode>
                    <TransactionID>11259550</TransactionID>
                </Refund>
                <CustomerIP>127.0.0.1</CustomerIP>
                <DeviceID>D1234</DeviceID>
            </request>
        </DirectRefund>
    </soap:Body>
</soap:Envelope>

<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$refund = [
    'Customer' => [
        'Reference' => 'A12345',
        'Title' => 'Mr.',
        'FirstName' => 'John',
        'LastName' => 'Smith',
        'CompanyName' => 'Demo Shop 123',
        'JobDescription' => 'Developer',
        'Street1' => 'Level 5',
        'Street2' => '369 Queen Street',
        'City' => 'Sydney',
        'State' => 'NSW',
        'PostalCode' => '2000',
        'Country' => 'au',
        'Phone' => '09 889 0986',
        'Mobile' => '09 889 6542',
        'Email' => 'demo@example.org',
        "Url" => "http://www.ewaypayments.com",
        'CardDetails' => [
            'ExpiryMonth' => '12',
            'ExpiryYear' => '25'
        ]
    ],
    'ShippingAddress' => [
        'ShippingMethod' => \Eway\Rapid\Enum\ShippingMethod::NEXT_DAY,
        'FirstName' => 'John',
        'LastName' => 'Smith',
        'Street1' => 'Level 5',
        'Street2' => '369 Queen Street',
        'City' => 'Sydney',
        'State' => 'NSW',
        'Country' => 'au',
        'PostalCode' => '2000',
        'Phone' => '09 889 0986',
    ],
    'Items' => [
        [
            'SKU' => '12345678901234567890',
            'Description' => 'Item Description 1',
            'Quantity' => 1,
            'UnitCost' => 400,
            'Tax' => 100,
            // Total is calculated automatically
        ],
        [
            'SKU' => '123456789012',
            'Description' => 'Item Description 2',
            'Quantity' => 1,
            'UnitCost' => 400,
            'Tax' => 100,
        ],
    ],
    'Options' => [
        [
            'Value' => 'Option1',
        ],
        [
            'Value' => 'Option2',
        ],
    ],
    'Refund' => [
        'TransactionID' => 11259550,
        'TotalAmount' => 10,
        'InvoiceNumber' => 'Inv 21540',
        'InvoiceDescription' => 'Individual Invoice Description',
        'InvoiceReference' => '513456',
        'CurrencyCode' => 'AUD',
    ],
    'DeviceID' => 'D1234',
    'CustomerIP' => '127.0.0.1',
];

$response = $client->refund($refund);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Refund refund = new Refund();

Customer customer = new Customer();
customer.setReference("A12345");
customer.setTitle("Mr.");
customer.setFirstName("John");
customer.setLastName("Smith");
customer.setCompanyName("eWay");
customer.setJobDescription("Java Developer");
customer.setPhone("09 889 0986");
customer.setMobile("09 889 6542");
customer.setUrl("http://ewaypayments.com");
customer.setCustomerDeviceIP("127.0.0.1");
customer.setEmail("demo@example.org");

Address address = new Address();
address.setStreet1("Level 5");
address.setStreet2("369 Queen Street");
address.setCity("Sydney");
address.setState("NSW");
address.setCountry("au");
address.setPostalCode("2000");
customer.setAddress(address);

CardDetails cardDetails = new CardDetails();
cardDetails.setExpiryMonth("12");
cardDetails.setExpiryYear("25");
customer.setCardDetails(cardDetails);
refund.setCustomer(customer);

ShippingDetails shippingDetail = new ShippingDetails();
shippingDetail.setFirstName("John");
shippingDetail.setLastName("Smith");
shippingDetail.setPhone("09 889 0986");
shippingDetail.setShippingMethod(ShippingMethod.LowCost);

Address shipAddress = new Address();
shipAddress.setStreet1("Level 5");
shipAddress.setStreet2("369 Queen Street");
shipAddress.setCity("Sydney");
shipAddress.setState("NSW");
shipAddress.setCountry("au");
shipAddress.setPostalCode("2000");
shippingDetail.setShippingAddress(shipAddress);
refund.setShippingDetails(shippingDetail);

List<LineItem> items = new ArrayList<>();
LineItem item1 = new LineItem();
item1.setSku("12345678901234567890");
item1.setDescription("Item Description 1");
item1.setQuantity(1);
item1.setUnitCost(400);
item1.setTotalTax(100);
item1.setTotal(500);
items.add(item1);

LineItem item2 = new LineItem();
item2.setSku("123456789012");
item2.setDescription("Item Description 2");
item2.setQuantity(1);
item2.setUnitCost(400);
item2.setTotalTax(100);
item2.setTotal(500);
items.add(item2);

refund.setLineItems(items);

List<String> options = new ArrayList<>();
options.add("Option1");
options.add("Option2");
refund.setOptions(options);

RefundDetails refundDetails = new RefundDetails();
refundDetails.setOriginalTransactionID("11259550");
refundDetails.setTotalAmount(10);
refundDetails.setCurrencyCode("AUD");
refundDetails.setInvoiceDescription("Individual Invoice Description");
refundDetails.setInvoiceNumber("Inv 21540");
refundDetails.setInvoiceReference("513456");
refund.setRefundDetails(refundDetails);

refund.setDeviceID("D1234");

RefundResponse response = client.refund(refund);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Refund refund = new Refund()
{
    Customer = new Customer()
    {
        Reference = "A12345",
        Title = "Mr.",
        FirstName = "John",
        LastName = "Smith",
        CompanyName = "Demo Shop 123",
        JobDescription = "C# Developer",
        Phone = "09 889 0986",
        Mobile = "09 889 6542",
        Url = "http://www.ewaypayments.com",
        Address = new Address()
        {
            Street1 = "Level 5",
            Street2 = "369 Queen Street",
            City = "Sydney",
            State = "NSW",
            Country = "au",
            PostalCode = "2000",

        },
        CardDetails = new CardDetails
        {
            ExpiryMonth = "12",
            ExpiryYear = "25"
        }
    },
    ShippingDetails = new ShippingDetails()
    {
        FirstName = "John",
        LastName = "Smith",
        Phone = "09 889 0986",
        ShippingAddress = new Address()
        {
            Street1 = "Level 5",
            Street2 = "369 Queen Street",
            City = "Sydney",
            State = "NSW",
            Country = "au",
            PostalCode = "2000"
        }
    },
    LineItems = new[] 
    { 
        new LineItem()
        {
            SKU = "12345678901234567890", 
            Description = "Item Description 1",
            Quantity = 1,
            UnitCost = 400
        },
        new LineItem()
        {
            SKU = "123456789012", 
            Description = "Item Description 2",
            Quantity = 1,
            UnitCost = 400,
        }
    }.ToList(),
    Options = new[] 
    { 
        "Option1", 
        "Option2" 
    }.ToList(),
    RefundDetails = new RefundDetails()
    {
        TotalAmount = 10,
        OriginalTransactionID = 11259550,
        InvoiceNumber = "Inv 21540",
        InvoiceDescription = "Individual Invoice Description",
        InvoiceReference = "513456",
        CurrencyCode = "AUD"
    },
    DeviceID = "D1234"
};

RefundResponse refundResponse = ewayClient.Refund(refund);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.refund({
    "Customer": {
       "Reference": "A12345",
       "Title": "Mr.",
       "FirstName": "John",
       "LastName": "Smith",
       "CompanyName": "Demo Shop 123",
       "JobDescription": "Developer",
       "Street1": "Level 5",
       "Street2": "369 Queen Street",
       "City": "Sydney",
       "State": "NSW",
       "PostalCode": "2000",
       "Country": "au",
       "Phone": "09 889 0986",
       "Mobile": "09 889 6542",
       "Email": "demo@example.org",
       "Url": "http://www.ewaypayments.com",
        "CardDetails": {
         "ExpiryMonth": "12",
         "ExpiryYear": "26"
       }
    },
    "ShippingAddress": {
       "ShippingMethod": "NextDay",
       "FirstName": "John",
       "LastName": "Smith",
       "Street1": "Level 5",
       "Street2": "369 Queen Street",
       "City": "Sydney",
       "State": "NSW",
       "Country": "au",
       "PostalCode": "2000",
       "Phone": "09 889 0986"
    },
    "Items": [
     {
       "SKU": "12345678901234567890",
       "Description": "Item Description 1",
       "Quantity": 1,
       "UnitCost": 400,
       "Tax": 100,
       "Total": 500
     },
     {
       "SKU": "123456789012",
       "Description": "Item Description 2",
       "Quantity": 1,
       "UnitCost": 400,
       "Tax": 100,
       "Total": 500
     }
    ],
    "Options": [
     {
       "Value": "Option1"
       },
     {
       "Value": "Option2"
     }
    ],
    "Refund": {
       "TotalAmount": 100,
       "InvoiceNumber": "Inv 21540",
       "InvoiceDescription": "Individual Invoice Description",
       "InvoiceReference": "513456",
       "CurrencyCode": "AUD",
       "TransactionID": 11259550
    },
    "DeviceID": "D1234",
    "CustomerIP": "127.0.0.1"
}).then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

refund = EwayRapid::Models::Refund.new

customer = EwayRapid::Models::Customer.new
customer.reference = 'A12345'
customer.title = 'Mr.'
customer.first_name = 'John'
customer.last_name = 'Smith'
customer.company_name = 'Company'
customer.job_description = 'Ruby Developer'
customer.phone = '09 889 0986'
customer.mobile = '09 889 0986'
customer.fax = '09 654 1234'
customer.url = 'http://www.ewaypayments.com'
customer.comments = 'customer comment'
customer.customer_device_ip = '127.0.0.1'
customer.email = 'demo@example.org'

card_details = EwayRapid::Models::CardDetails.new
card_details.expiry_month = '05'
card_details.expiry_year = '25'
customer.card_details = card_details

address = EwayRapid::Models::Address.new
address.street1 = 'Level 5'
address.street2 = '369 Queen Street'
address.city = 'Sydney'
address.state = 'NSW'
address.country = 'AU'
address.postal_code = '2000'
customer.address = address

refund.customer = customer

shipping_details = EwayRapid::Models::ShippingDetails.new
shipping_address = EwayRapid::Models::Address.new
shipping_address.street1 = 'Level 5'
shipping_address.street2 = '369 Queen Street'
shipping_address.city = 'Sydney'
shipping_address.state = 'NSW'
shipping_address.country = 'AU'
shipping_address.postal_code = '2000'
shipping_details.shipping_address = shipping_address
shipping_details.first_name = 'John'
shipping_details.last_name = 'Smith'
shipping_details.phone = '09 889 0986'
refund.shipping_details = shipping_details

line_item = EwayRapid::Models::LineItem.new
line_item.sku = '12345678901234567890'
line_item.description = 'Item Description 1'
line_item.quantity = 1
line_item.unit_cost = 400
line_item.tax = 100
line_item.total = 500

line_item1 = EwayRapid::Models::LineItem.new
line_item1.sku = '12345678901234567890'
line_item1.description = 'Item Description 1'
line_item1.quantity = 1
line_item1.unit_cost = 400
line_item1.tax = 100
line_item1.total = 500

line_item2 = EwayRapid::Models::LineItem.new
line_item2.sku = '123456789012'
line_item2.description = 'Item Description 2'
line_item2.quantity = 1
line_item2.unit_cost = 400
line_item2.tax = 100
line_item2.total = 500

line_items = []
line_items.push(line_item1)
line_items.push(line_item2)
refund.line_items = line_items

options = []
options.push('Option1')
options.push('Option2')
refund.options = options

refund_details = EwayRapid::InternalModels::RefundDetails.new
refund_details.total_amount = 10
refund_details.original_transaction_id = 11259550
refund_details.invoice_number = 'Inv 21540'
refund_details.invoice_description = 'Individual Invoice Description'
refund_details.invoice_reference = '513456'
refund_details.currency_code = 'AUD'
refund.refund_details = refund_details

response = client.refund(refund)
Field Name Field Type Max Length Data Type Description
CustomerIP O 50 string The customer’s IP Address
DeviceID O 50 string The identification name/number for the device or application used to process the transaction
PartnerID O 50 string The partner ID generated from a partner agreement

Refund

This set of fields contains the details of the refund being processed.

Field Name Field Type Max Length Data Type Description
TotalAmount R 10 int The amount of the transaction in the lowest denomination for the currency (e.g. a $27.00 transaction would have a TotalAmount value of ‘2700’).
InvoiceNumber O 16 String The merchant’s invoice number for this transaction
InvoiceDescription O 64 string A description of the refund that the customer is making
InvoiceReference O 50 string The merchant’s reference number for this transaction
CurrencyCode O 3 string The ISO 4217 3 character code that represents the currency that this transaction is to be processed in. If no value for this field is provided, the merchant’s default currency is used. This should be in uppercase.
e.g. Australian Dollars = AUD
TransactionID R 8 string The unique identifier of the transaction to refund. Not required when using REST

Customer

This set of fields contains the details of the merchant’s customer. These are all optional.

Field Name Field Type Max Length Data Type Description
Reference O 50 string The merchant’s reference for this customer
Title O 5 string The customer’s title, empty string allowed.
One of: Mr., Ms., Mrs., Miss, Dr., Sir., Prof.
FirstName O 50 string The customer’s first name
LastName O 50 string The customer’s last name
CompanyName O 50 string The customer’s company name
JobDescription O 50 string The customer’s job description / title
Street1 O 50 string The customer’s street address
Street2 O 50 string The customer’s street address
City O 50 string The customer’s city / town / suburb
State O 50 string The customer’s state / county
PostalCode O 30 string The customer’s post / zip code
Country O 2 string The customer’s country. This should be the two letter ISO 3166-1 alpha-2 code. This field must be lower case.
e.g. Australia = au
Email O 50 string The customer’s email address, which must be correctly formatted if present
Phone O 32 string The customer’s phone number
Mobile O 32 string The customer’s mobile phone number
Comments O 255 string Any comments the merchant wishes to add about the customer
Fax O 32 string The customer’s fax number
Url O 512 string The customer’s website, which must be correctly formatted if present

Card Details

The card details section is within the Customer section and is used to pass the customers card details for the refund. These are only needed if the customer’s card expiry date has changed since the purchase.

Field Name Field Type Max Length Description
ExpiryMonth O 2 The month that the card expires
ExpiryYear O 2 The year that the card expires

Shipping Address

The ShippingAddress section is optional. It is used by Beagle Fraud Alerts (Enterprise) to calculate a risk score for this transaction.

Field Name Field Type Max Length Data Type Description
ShippingMethod O 30 long The method used to ship the customer’s order. One of: Unknown, LowCost, DesignatedByCustomer, International, Military, NextDay, StorePickup, TwoDayService, ThreeDayService, Other
FirstName O 50 string The first name of the person the order is shipped to.
LastName O 50 string The last name of the person the order is shipped to.
Street1 O 50 string The street address the order is shipped to.
Street2 O 50 string The street address of the shipping location.
City O 50 string The shipping city / town / suburb.
State O 50 string The shipping state / county.
PostalCode O 30 string The shipping post / zip code.
Country† O 2 string The shipping country. This should be the two letter ISO 3166-1 alpha-2 code. This field must be lower case.
e.g. Australia = au
Email O 50 string The customer’s email address, which must be correctly formatted if present.
Phone O 32 string The phone number of the person the order is shipped to.
Fax O 32 string The fax number of the shipping location.

Items

The Items section is optional. If provided, it should contain a list of line items purchased by the customer, up to a maximum of 99 items.

Field Name Field Type Max Length Data Type Description
SKU O 12 string The stock keeping unit used to identify this line item
Description O 26 string A brief description of the product
Quantity O 6 int The purchased quantity
UnitCost O 8 int The pre-tax cost per unit of the product in the lowest denomination
Tax O 8 int The tax amount that applies to this line item in the lowest denomination
Total O 8 int The total amount charged for this line item in the lowest denomination

Options

This section is optional. Anything appearing in this section is not displayed to the customer, but it is returned to the merchant in the result. Up to 99 options can be defined. Each option has just one field:

Field Name Field Type Max Length Data Type Description
Value O 254 string This field is not displayed to the customer but is returned in the result. Anything can be used here, which can be useful for tracking transactions. Additional characters are truncated at 254

Response

The response from eWAY will contain all relevant details such as the bank authorisation code and a unique number that identifies the transaction in eWAY’s database. All responses will contain a response code and response message that represents the result of the action performed.

Response field Descriptions

Example Response

{
    "AuthorisationCode": "703764",
    "ResponseCode": null,
    "ResponseMessage": "A2000",
    "TransactionID": 11259710,
    "TransactionStatus": true,
    "Verification": null,
    "Customer": {
        "CardDetails": {
            "Number": "",
            "Name": "",
            "ExpiryMonth": "12",
            "ExpiryYear": "25",
            "StartMonth": "",
            "StartYear": "",
            "IssueNumber": ""
        },
        "TokenCustomerID": null,
        "Reference": "A12345",
        "Title": "Mr.",
        "FirstName": "John",
        "LastName": "Smith",
        "CompanyName": "Demo Shop 123",
        "JobDescription": "Developer",
        "Street1": "Level 5",
        "Street2": "369 Queen Street",
        "City": "Sydney",
        "State": "NSW",
        "PostalCode": "2000",
        "Country": "au",
        "Email": "demo@example.org",
        "Phone": "09 889 0986",
        "Mobile": "09 889 6542",
        "Comments": "",
        "Fax": "",
        "Url": "http://www.ewaypayments.com"
    },
    "Refund": {
        "TransactionID": "11259550",
        "TotalAmount": 100,
        "InvoiceNumber": "Inv 21540",
        "InvoiceDescription": "Individual Invoice Description",
        "InvoiceReference": "513456",
        "CurrencyCode": "AUD"
    },
    "Errors": null
}
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <DirectRefundResponse xmlns="https://api.ewaypayments.com/">
         <DirectRefundResult>
            <AuthorisationCode>703764</AuthorisationCode>
            <ResponseMessage>A2000</ResponseMessage>
            <TransactionID>11259710</TransactionID>
            <TransactionStatus>true</TransactionStatus>
            <Customer>
               <TokenCustomerID xsi:nil="true"/>
               <Reference>A12345</Reference>
               <Title>Mr.</Title>
               <FirstName>John</FirstName>
               <LastName>Smith</LastName>
               <CompanyName>Demo Shop 123</CompanyName>
               <JobDescription>Developer</JobDescription>
               <Street1>Level 5</Street1>
               <Street2>369 Queen Street</Street2>
               <City>Sydney</City>
               <State>NSW</State>
               <PostalCode>2000</PostalCode>
               <Country>au</Country>
               <Email>demo@example.org</Email>
               <Phone>0289712345</Phone>
               <Mobile>0289712345</Mobile>
               <Comments>Customer comments</Comments>
               <Fax>0289712345</Fax>
               <Url>http://www.ewaypayments.com</Url>
               <CardDetails>
                  <Number/>
                  <Name/>
                  <ExpiryMonth>12</ExpiryMonth>
                  <ExpiryYear>25</ExpiryYear>
                  <StartMonth/>
                  <StartYear/>
                  <IssueNumber/>
                  <CVN/>
               </CardDetails>
            </Customer>
            <Refund>
               <TotalAmount>100</TotalAmount>
               <InvoiceNumber>Inv 21540</InvoiceNumber>
               <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
               <InvoiceReference>Individual Invoice Description</InvoiceReference>
               <CurrencyCode>AUD</CurrencyCode>
               <TransactionID>11259550</TransactionID>
            </Refund>
         </DirectRefundResult>
      </DirectRefundResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available $response properties

if ($response->TransactionStatus) {
    echo 'Refund successful! ID: '.$response->TransactionID;
} else {
    if ($response->getErrors()) {
        foreach ($response->getErrors() as $error) {
            echo "Error: ".\Eway\Rapid::getMessage($error)."<br>";
        }
    } else {
        echo 'Sorry, your refund failed';
    }
}

// See the JSON tab for all the available response properties

if (response.getTransactionStatus().isStatus()) {
    System.out.println("Refund successful! ID: " + response.getTransactionStatus().getTransactionID());
} else {
    if (!response.getErrors().isEmpty()) {
        for (String errorcode: response.getErrors()) {
            System.out.println("Error Message: " + RapidSDK.userDisplayMessage(errorcode, "en"));
        }
    } else {
        System.out.println("Sorry, your refund failed");
    }
}
if (refundResponse.Errors == null)
{
    if ((bool)refundResponse.TransactionStatus)
    {
        Console.WriteLine("Refund successful! ID: " + refundResponse.TransactionID);
    }
    else
    {
        Console.WriteLine("Sorry, your refund failed");
    }
}
else
{
    foreach (string errorCode in refundResponse.Errors)
    {
        Console.WriteLine("Error Message: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
    }
}
// See the JSON tab for all the available response properties

.then(function (response) {
    if (response.get('TransactionStatus')) {
        console.log('Refund successful! ID: ' + response.get('TransactionID'));
    } else {
        var errorCodes = response.get('ResponseMessage').split(', ');
        errorCodes.forEach(function(errorCode) {
            console.log("Response Message: " + rapid.getMessage(errorCode, "en"));
        });
    }
})
.catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});
# See the JSON tab for all the available response properties

if response.errors.empty?
  if response.transaction_status.status?
    puts "Refund successful! ID: #{response.transaction_status.transaction_id}"
  else
    puts "Sorry, your refund failed"
  end
else
  response.errors.each { |e| puts "Response message: "+ EwayRapid::RapidClient.user_display_message(e) }
end

Field Name Max Length Data Type Description
AuthorisationCode 6 string The authorisation code for this transaction as returned by the bank
ResponseCode 2 string The two digit response code returned from the bank
ResponseMessage 512 string One or more Response Codes that describes the result of the action performed.
If a Beagle Alert is triggered, this may contain multiple codes:
e.g. D4405, F7003
TotalAmount 10 int The amount that was authorised for this transaction
TransactionID 8 int A unique identifier that represents the transaction in eWAY’s system
TransactionStatus 16 boolean A Boolean value that indicates whether the transaction was successful or not
Errors 512 string A comma separated list of any error encountered, these can be looked up in the Response Codes section.

Refund

These fields are specific to a refund and confirmation of the data passed in the request.

Field Name Max Length Data Type Description
TransactionID 8 int A unique identifier that represents the transaction in eWAY’s system
TotalAmount 10 int The amount that was authorised for this transaction
InvoiceNumber 64 string An echo of the merchant’s invoice number for this transaction
InvoiceReference 64 string An echo of the merchant’s reference number for this transaction
CurrencyCode 3 string The ISO 4217 3 character code that represents the currency that this transaction is to be processed in.
e.g. Australian Dollars = AUD

Customer

This will return the information specifically about the customer.

Field Name Max Length Data Type Description
TokenCustomerID 16 long Not currently used in refunds, will always returned null
Reference 50 string The merchant’s reference for this customer.
Title 5 string The customer’s title
FirstName 50 string The customer’s first name.
LastName 50 string The customer’s last name
CompanyName 50 string The customer’s company name.
JobDescription 50 string The customer’s job description / title.
Street1 50 string The customer’s street address.
Street2 50 string The customer’s street address.
City 50 string The customer’s city / town / suburb.
State 50 string The customer’s state / county.
PostalCode 30 string The customer’s post / zip code.
Country 2 string The customer’s country as a two letter ISO 3166-1 alpha-2 code.
e.g. Australia = au
Email 50 string The customer’s email address, which must be correctly formatted if present.
Phone 32 string The customer’s phone number.
Mobile 32 string The customer’s mobile phone number.
Comments 255 string Any comments the merchant wishes to add about the customer.
Fax 32 string The customer’s fax number.
Url 512 string The customer’s website, which must be correctly formatted if present.

Card Details

For a refund most card details will remain blank, except the expiry month and year if passed.

Field Name Max Length Data Type Description
Number 50 string blank
Name 50 string blank
ExpiryMonth 2 int The customer’s card expiry month
ExpiryYear 2 int The customer’s card expiry year
StartMonth 2 string blank
StartYear 2 string blank
IssueNumber 2 string blank

Transaction Query

Step 1: Request transaction results

In order to request complete details about a transaction, eWAY’s Transaction Query API can be used. This will return any details about the customer (including any entered in the Responsive Shared Page) along with information about the transaction and any fraud rules that were triggered.

The Transaction Query API can be used to find a transaction using the Transaction ID, Access Code, Invoice Number or Invoice Reference. Searching by Invoice Number or Invoice Reference is only available when those details are unique.

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.ewaypayments.com/Transaction/{TransactionID or AccessCode}
REST (GET) https://api.ewaypayments.com/Transaction/InvoiceNumber/{Invoice Number}
REST (GET) https://api.ewaypayments.com/Transaction/InvoiceRef/{Invoice Reference}
HTTP POST (XML) https://api.ewaypayments.com/TransactionSearch.xml
HTTP POST (JSON) https://api.ewaypayments.com/TransactionSearch.json
RPC (XML) https://api.ewaypayments.com/xml-rpc
RPC (JSON) https://api.ewaypayments.com/json-rpc

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.sandbox.ewaypayments.com/Transaction/{TransactionID or AccessCode}
REST (GET) https://api.sandbox.ewaypayments.com/Transaction/InvoiceNumber/{Invoice Number}
REST (GET) https://api.sandbox.ewaypayments.com/Transaction/InvoiceRef/{Invoice Reference}
HTTP POST (XML) https://api.sandbox.ewaypayments.com/TransactionSeach.xml
HTTP POST (JSON) https://api.sandbox.ewaypayments.com/TransactionSearch.json
RPC (XML) https://api.sandbox.ewaypayments.com/xml-rpc
RPC (JSON) https://api.sandbox.ewaypayments.com/json-rpc

Request field descriptions

Example query by access code

curl --request GET \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    https://api.sandbox.ewaypayments.com/Transaction/44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <TransactionSearch xmlns="https://api.ewaypayments.com/">
         <request>
            <TransactionFilter>
                <AccessCode>44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2</AccessCode>
            </TransactionFilter>
         </request>
      </TransactionSearch>
   </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$response = $client->queryTransaction('44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2');

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

QueryTransactionResponse response = client.queryTransaction("44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2");
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

QueryTransactionResponse response = ewayClient.QueryTransaction("44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2");
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.queryTransaction("44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2")
.then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

response = client.query_transaction_by_access_code('44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2')

Example query by invoice number

curl --request GET \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    https://api.sandbox.ewaypayments.com/Transaction/InvoiceNumber/INVOICE-NO-3
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <TransactionSearch xmlns="https://api.ewaypayments.com/">
         <request>
            <TransactionFilter>
                <InvoiceNumberMatchType>Equals</InvoiceNumberMatchType>
                <InvoiceNumber>INVOICE-NO-3</InvoiceNumber>
            </TransactionFilter>
         </request>
      </TransactionSearch>
   </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$response = $client->queryInvoiceNumber('INVOICE-NO-3');

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

TransactionFilter filter = new TransactionFilter();
filter.setInvoiceNumber("INVOICE-NO-3");
QueryTransactionResponse response = client.queryTransaction(filter);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

QueryTransactionResponse response = ewayClient.QueryInvoiceNumber("INVOICE-NO-3");
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.queryInvoiceNumber("INVOICE-NO-3")
.then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

filter = EwayRapid::Enums::TransactionFilter.new
filter.invoice_number = 'INVOICE-NO-3'
response = client.query_transaction_by_filter(filter)

All fields are children of TransactionFilter - except when using REST, where the parameters are passed in the URL.

Field Name Max Length Data Type Description
AccessCode 512 string An eWAY Access Code for a transaction
TransactionID 8 string An eWAY Transaction ID for a transaction
InvoiceReferenceMatchType 512 string This must be set to Equals. Must be used when searching by InvoiceReference. Not used for REST requests.
InvoiceReference 50 string The Invoice Reference to search for.
InvoiceNumberMatchType 512 string This must be set to Equals. Must be used when searching by InvoiceNumber. Not used for REST requests.
InvoiceNumber 512 string The Invoice Number to search for.

Only one search criteria can be used per query.

Response field Descriptions

Example Response

{
    "Transactions": [{
        "AuthorisationCode": "522587",
        "ResponseCode": "00",
        "ResponseMessage": "A2000",
        "InvoiceNumber": "Inv 21540",
        "InvoiceReference": "513456",
        "TotalAmount": 1000,
        "TransactionID": 11259580,
        "TransactionStatus": true,
        "TokenCustomerID": null,
        "BeagleScore": 0,
        "Options": [],
        "Verification": {
            "CVN": 0,
            "Address": 0,
            "Email": 0,
            "Mobile": 0,
            "Phone": 0
        },
        "BeagleVerification": {
            "Email": 0,
            "Phone": 0
        },
        "Customer": {
            "TokenCustomerID": null,
            "Reference": null,
            "Title": null,
            "FirstName": "John",
            "LastName": "Smith",
            "CompanyName": null,
            "JobDescription": null,
            "Street1": "Level 5",
            "Street2": "369 Queen Street",
            "City": "Sydney",
            "State": "NSW",
            "PostalCode": "2000",
            "Country": "au",
            "Email": "demo@example.org",
            "Phone": "09 889 0986",
            "Mobile": null,
            "Comments": null,
            "Fax": null,
            "Url": null
        },
        "CustomerNote": null,
        "ShippingAddress": {
            "ShippingMethod": null,
            "FirstName": "John",
            "LastName": "Smith",
            "Street1": "Level 5",
            "Street2": "369 Queen Street",
            "City": "Sydney",
            "State": "NSW",
            "Country": "au",
            "PostalCode": "2000",
            "Email": "",
            "Phone": "09 889 0986",
            "Fax": null
        }
    }],
    "Errors": ""
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <TransactionSearchResponse xmlns="https://api.ewaypayments.com/">
         <TransactionSearchResult>
            <Errors/>
            <Transactions>
               <TransactionResult>
                  <AuthorisationCode>522587</AuthorisationCode>
                  <ResponseCode>00</ResponseCode>
                  <ResponseMessage>A2000</ResponseMessage>
                  <InvoiceNumber>Inv 21540</InvoiceNumber>
                  <InvoiceReference>513456</InvoiceReference>
                  <TotalAmount>1000</TotalAmount>
                  <TransactionID>11259580</TransactionID>
                  <TransactionStatus>true</TransactionStatus>
                  <TokenCustomerID xsi:nil="true"/>
                  <BeagleScore>0</BeagleScore>
                  <Options/>
                  <Verification>
                     <CVN>Unchecked</CVN>
                     <Address>Unchecked</Address>
                     <Email>Unchecked</Email>
                     <Mobile>Unchecked</Mobile>
                     <Phone>Unchecked</Phone>
                  </Verification>
                  <BeagleVerification>
                     <Email>NotVerified</Email>
                     <Phone>NotVerified</Phone>
                  </BeagleVerification>
                  <Customer>
                     <TokenCustomerID xsi:nil="true"/>
                     <FirstName>John</FirstName>
                     <LastName>Smith</LastName>
                     <Street1>Level 5</Street1>
                     <Street2>369 Queen Street</Street2>
                     <City>Sydney</City>
                     <State>NSW</State>
                     <PostalCode>2000</PostalCode>
                     <Country>au</Country>
                     <Email>demo@example.org</Email>
                     <Phone>09 889 0986</Phone>
                  </Customer>
                  <ShippingAddress>
                     <FirstName>John</FirstName>
                     <LastName>Smith</LastName>
                     <Street1>Level 5</Street1>
                     <Street2>369 Queen Street</Street2>
                     <City>Sydney</City>
                     <State>NSW</State>
                     <Country>au</Country>
                     <PostalCode>2000</PostalCode>
                     <Email/>
                     <Phone>09 889 0986</Phone>
                  </ShippingAddress>
               </TransactionResult>
            </Transactions>
         </TransactionSearchResult>
      </TransactionSearchResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available properties

$response = $response->Transactions[0];

if ($response->TransactionStatus) {
    echo 'Transaction successful! ID: '.$response->TransactionID;
} else {
    $errors = split(', ', $response->ResponseMessage);
    foreach ($errors as $error) {
        echo "Payment failed: ".\Eway\Rapid::getMessage($error)."<br>";
    }
}
// See the JSON tab for all the available properties

if (response.getErrors().isEmpty()) {
    System.out.println("Transaction successful! ID: " + response.getTransactionStatus().getTransactionID());
} else {
    for (String errorcode: response.getErrors()) {
        System.out.println("Response Messages: " + RapidSDK.userDisplayMessage(errorcode, "en"));
    };
}
// See the JSON tab for all the available properties

if ((bool)response.TransactionStatus.Status)
{
    Console.WriteLine("Payment successful! ID: " + response.TransactionStatus.TransactionID);
}
else
{
    string[] errorCodes = response.TransactionStatus.ProcessingDetails.getResponseMessages();
    foreach (string errorCode in errorCodes)
    {
        Console.WriteLine("Response Message: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
    }
}
// See the JSON tab for all the available properties

.then(function (response) {
    if (response.get('Transactions[0].TransactionStatus')) {
        console.log('Payment successful! ID: ' + response.get('Transactions[0].TransactionID'));
    } else {
        var errorCodes = response.get('Transactions[0].ResponseMessage').split(', ');
        errorCodes.forEach(function(errorCode) {
            console.log("Response Message: " + rapid.getMessage(errorCode, "en"));
        });
    }
}).catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});

# See the JSON tab for all the available properties

if response.errors.empty?
  if response.transaction_status.status?
    puts "Payment successful! ID: #{response.transaction_status.transaction_id}"
  else
    puts "Response Message: #{response.transaction_status.processing_details.response_message}"
  end
else
  response.errors.each { |e| puts "Response message: "+ EwayRapid::RapidClient.user_display_message(e) }
end
Field Name Max Length Data Type Description
AuthorisationCode 6 string The authorisation code for this transaction as returned by the bank
ResponseCode 2 string The two digit response code returned from the bank
ResponseMessage 512 string One or more Response Codes that describes the result of the action performed.
If a Beagle Alert is triggered, this may contain multiple codes:
e.g. D4405, F7003
InvoiceNumber 64 string An echo of the merchant’s invoice number for this transaction
InvoiceReference 64 string An echo of the merchant’s reference number for this transaction
TotalAmount 10 int The amount that was authorised for this transaction. If a card surcharge was charged, the TotalAmount will include the surcharge.
TransactionID 8 int A unique identifier that represents the transaction in eWAY’s system
TransactionStatus boolean A Boolean value that indicates whether the transaction was successful or not
TokenCustomerID‡ 16 long An eWAY-issued ID that represents the Token customer that was loaded or created for this transaction (if applicable)
BeagleScore** 6 string Fraud score representing the estimated probability that the order is fraud, based off analysis of past Beagle Fraud Alerts transactions. This field will only be returned for transactions using the Beagle Free gateway.
TransactionDateTime 25 ISO8601 date time v40+ (see versions) The date and time the transaction took place
FraudAction 512 string v40+ (see versions) The fraud action that occurred if any. One of NotChallenged, Allow, Review, PreAuth, Processed, Approved, Block
TransactionCaptured boolean v40+ (see versions) True if funds were captured in the transaction.
TransactionType 1 int v40+ (see versions) A numeric representation of the transaction type:
  • 1 - Purchase
  • 4 - Refund
  • 8 - PreAuth
CurrencyCode 3 string v40+ (see versions) The ISO 4217 numeric currency code (e.g. AUD = 036)
Source 1 int v40+ (see versions) Reserved for future use
MaxRefund 10 int v40+ (see versions) The maximum amount that could be refunded from this transaction
OriginalTransactionId 8 int v40+ (see versions) Contains the original transaction ID if the queried transaction is a refund

*This field is only present if the transaction was processed using Beagle Free

This field is only present for a Token transaction

Options

The Options collection passed in the original request will be echoed back in the response here.

Field Name Max Length Data Type Description
Value 255 string An echo of the option submitted for this transaction

Verification

These fields are currently unused

Field Name Max Length Data Type Description
CVN 10 string
Address 10 string
Email 10 string
Mobile 10 string
Phone 10 string

Beagle Verification

This will contain the results of the Beagle Verification fraud checks that may have been performed. These fields will only be valid if the transaction was conducted via the Responsive Shared Page API and Beagle Verification was enabled.

For all fields, the available return options are NotVerified, Attempted, Verified or Failed.

When using the REST API, a number will be returned which maps as follows:

Field Name Max Length Data Type Description
Email 10 string The result of the Email verification
Phone 10 string The result of the Phone verification

Customer

This set of fields contains the details of the merchant’s customer.

Field Name Max Length Data Type Description
TokenCustomerID 16 long An eWAY issued ID that represents the Token customer loaded for this transaction
FirstName 50 string An echo of the customer’s first name
LastName 50 string An echo of the customer’s last name
Street1 50 string An echo of the customer’s street address
Street2 50 string An echo of the customer’s street address
City 50 string An echo of the customer’s city / town / suburb
State 50 string An echo of the customer’s state / county
PostalCode 30 string An echo of the customer’s post / zip code
Country 2 string An echo of the customer’s country as the two letter ISO 3166-1 alpha-2 code
Email 50 string An echo of the customer’s email address
Phone 32 string An echo of the customer’s phone number

Shipping Address

This set of fields contains the details of the shipping address of the merchant’s customer.

Field Name Max Length Data Type Description
FirstName 50 string The first name of the person the order is shipped to.
LastName 50 string The last name of the person the order is shipped to.
Street1 50 string The street address the order is shipped to.
Street2 50 string The street address of the shipping location.
City 50 string The customer’s shipping city / town / suburb.
State 50 string The customer’s shipping state / county.
PostalCode 30 string The customer’s shipping post / zip code.
Country 2 string The customer’s shipping country as the two letter ISO 3166-1 alpha-2 code
Email 50 string The customer’s shipping email address
Phone 32 string The phone number of the person the order is shipped to.

Pre-Auth

eWAY’s Pre-authorisation solution allows merchants to reserve funds on a customer’s credit card without charging it. They can then confirm the transaction at their convenience via MYeWAY or eWAY’s API. This service is perfect for merchants whose prices are dependent on variable costs.

Authorisation

To authorise a payment, use the same process as a transaction in any of the available payment methods with the Method set to Authorise.

When using an eWAY Rapid SDK, setting the Capture property on the transaction to false will perform an authorisation.

Remember to store the Transaction ID so that you can Capture or Cancel the payment!

Capture a Payment

Once a payment has been authorised, the transaction can be completed with a Capture request

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.ewaypayments.com/CapturePayment

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.sandbox.ewaypayments.com/CapturePayment

Request Field Descriptions

Example Capture Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
          "Payment": {
             "TotalAmount": 1000,
             "InvoiceNumber": "Inv 4444",
             "InvoiceDescription": "Individual Invoice Description",
             "InvoiceReference": "513456",
             "CurrencyCode": "AUD"
          },
          "TransactionId": 11260833
        }' \
    https://api.sandbox.ewaypayments.com/CapturePayment
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <CapturePayment xmlns="https://api.ewaypayments.com/">
         <request>
            <TransactionID>11260833</TransactionID>
            <Payment>
               <TotalAmount>1000</TotalAmount>
               <InvoiceNumber>Inv 4444</InvoiceNumber>
               <InvoiceDescription>Individual Invoice Description</InvoiceDescription>
               <InvoiceReference>513456</InvoiceReference>
               <CurrencyCode>AUD</CurrencyCode>
            </Payment>
         </request>
      </CapturePayment>
   </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'Payment' => [
        'TotalAmount' => 1000,
    ],
    'TransactionID' => 11260833,
];


$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::AUTHORISATION, $transaction);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);

Transaction transaction = new Transaction();
transaction.setPaymentDetails(paymentDetails);
transaction.setAuthTransactionID(11260833);

CreateTransactionResponse response = client.create(PaymentMethod.Authorisation, transaction);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

CapturePaymentRequest capture = new CapturePaymentRequest()
{
    TransactionId = "11260833",
    Payment = new Payment()
    {
        TotalAmount = 1000
    }
};

CapturePaymentResponse response = ewayClient.CapturePayment(capture);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.AUTHORISATION, {
    "Payment": {
        "TotalAmount": 1000,
    },
    "TransactionId": 11260833
}).then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new
transaction.auth_transaction_id = 11260833

payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
transaction.payment_details = payment_details

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::AUTHORISATION, transaction)
Field Name Field Type Max Length Data Type Description
TransactionId R 8 int The Transaction ID of the Authorisation to capture

Payment

This set of fields contains the details of the payment being processed.

Field Name Field Type Max Length Data Type Description
TotalAmount R 10 int The amount to capture in the lowest denomination for the currency (e.g. a $27.00 transaction would have a TotalAmount value of ‘2700’).
Note: Only amounts up to the original authorisation can be captured. Capturing less than 85% of the authorised amount may result in a separate charge on the customer’s card
InvoiceNumber O 16 string merchant’s invoice number for this transaction
InvoiceDescription O 64 string A description of the purchase that the customer is making
InvoiceReference O 50 string The merchant’s reference number for this transaction
CurrencyCode O 3 string The ISO 4217 3 character code that represents the currency that this transaction is to be processed in. If no value for this field is provided, the merchant’s default currency is used. This should be in uppercase.
e.g. Australian Dollars = AUD

Field types: R – Required, C – Conditionally Required, O – Optional

Response

Example response

{
    "ResponseCode": "399854",
    "ResponseMessage": "399854",
    "TransactionID": 11260840,
    "TransactionStatus": true,
    "Errors": null
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <CapturePaymentResponse xmlns="https://api.ewaypayments.com/">
         <CapturePaymentResult>
            <ResponseCode>399854</ResponseCode>
            <ResponseMessage>399854</ResponseMessage>
            <TransactionID>11260840</TransactionID>
            <TransactionStatus>true</TransactionStatus>
         </CapturePaymentResult>
      </CapturePaymentResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available $response properties

if ($response->TransactionStatus) {
    echo 'Payment successful! ID: '.$response->TransactionID;
} else {
    if ($response->getErrors()) {
        foreach ($response->getErrors() as $error) {
            echo "Error: ".\Eway\Rapid::getMessage($error)."<br>";
        }
    } else {
        echo 'Sorry, your payment was declined';
    }
}

// See the JSON tab for all the available response properties

if (response.getTransactionStatus().isStatus()) {
    System.out.println("Payment successful! ID: " + response.getTransactionStatus().getTransactionID());
} else {
    if (!response.getErrors().isEmpty()) {
        for (String errorcode: response.getErrors()) {
            System.out.println("Error Messages: " + RapidSDK.userDisplayMessage(errorcode, "en"));
        }
    } else {
        System.out.println("Sorry, your payment failed");
    }
}

// See the JSON tab for all the available response properties

if ((bool)response.TransactionStatus)
{
    Console.WriteLine("Capture successful! ID: " + response.TransactionStatus.TransactionID);
}
else
{    
    if (response.ResponseMessage != null) {
        string[] errorCodes = response.ResponseMessage.Split(new[] { ", " }, StringSplitOptions.None);

        foreach (string errorCode in errorCodes)
        {
            Console.WriteLine("Response Message: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
        }
    }
}

.then(function (response) {
    if (response.get('TransactionStatus')) {
        console.log('Payment successful! ID: ' + response.get('TransactionID'));
    } else {
        var errorCodes = response.get('ResponseMessage').split(', ');
        errorCodes.forEach(function(errorCode) {
            console.log("Response Message: " + rapid.getMessage(errorCode, "en"));
        });
    }
})
.catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});
# See the JSON tab for all the available response properties

if response.errors.empty?
  if response.transaction_status.status?
    puts "Payment successful! ID: #{response.transaction_status.transaction_id}"
  else
    puts "Response Message: #{response.transaction_status.processing_details.response_message}"
  end
else
  response.errors.each { |e| puts "Response message: "+ EwayRapid::RapidClient.user_display_message(e) }
end

The response from eWAY will contain details as to whether the transaction succeeded or failed.

Response Field Descriptions

Field Name Max Length Data Type Description
ResponseCode 512 string The authorisation code for this transaction as returned by the bank
ResponseMessage 512 string One or more Response Codes that describes the result of the action performed.
TransactionStatus boolean Whether the capture transaction succeeded
TransactionID 8 int A unique identifier that represents the transaction in eWAY’s system
Errors 255 string The error codes of any errors that occurred with the Capture, these can be looked up in the Response Codes section.

Cancel an Authorisation

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.ewaypayments.com/CancelAuthorisation

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (POST) https://api.sandbox.ewaypayments.com/CancelAuthorisation

Request Field Descriptions

Example Cancel Request

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
          "TransactionId": 11260833
        }' \
    https://api.sandbox.ewaypayments.com/CancelAuthorisation
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <CancelAuthorisation xmlns="https://api.ewaypayments.com/">
         <request>
            <TransactionID>11260833</TransactionID>
         </request>
      </CancelAuthorisation>
   </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$response = $client->cancelTransaction(11260833);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Refund refund = new Refund();

RefundDetails refundDetails = new RefundDetails();
refundDetails.setOriginalTransactionID("11260833");
refund.setRefundDetails(refundDetails);

RefundResponse response = client.cancel(refund);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

CancelAuthorisationRequest cancel = new CancelAuthorisationRequest()
{
    TransactionId = "11260833"
};

CancelAuthorisationResponse response = ewayClient.CancelAuthorisation(cancel);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.cancelTransaction("11260833")
.then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

refund = EwayRapid::Models::Refund.new

refund_details = EwayRapid::InternalModels::RefundDetails.new
refund_details.original_transaction_id = 11260833
refund.refund_details = refund_details

response = client.cancel(refund)

Field Name Field Type Max Length Data Type Description
TransactionId R 8 int The Transaction ID of the Authorisation to cancel

Response

Example response

{
    "ResponseCode": "720432",
    "ResponseMessage": "720432",
    "TransactionID": 11260941,
    "TransactionStatus": true,
    "Errors": null
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <CancelAuthorisationResponse xmlns="https://api.ewaypayments.com/">
         <CancelAuthorisationResult>
            <ResponseCode>720432</ResponseCode>
            <ResponseMessage>720432</ResponseMessage>
            <TransactionID>11260941</TransactionID>
            <TransactionStatus>true</TransactionStatus>
         </CancelAuthorisationResult>
      </CancelAuthorisationResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available $response properties

if ($response->TransactionStatus) {
    echo 'Cancel authorisation successful! ID: '.$response->TransactionID;
} else {
    if ($response->getErrors()) {
        foreach ($response->getErrors() as $error) {
            echo "Error: ".\Eway\Rapid::getMessage($error)."<br>";
        }
    } else {
        echo 'Sorry, your cancellation was declined';
    }
}

// See the JSON tab for all the available response properties

if (response.getTransactionStatus().isStatus()) {
    System.out.println("Cancel authorisation successful! ID: " + response.getTransactionStatus().getTransactionID());
} else {
    if (!response.getErrors().isEmpty()) {
        for (String errorcode: response.getErrors()) {
            System.out.println("Error Messages: " + RapidSDK.userDisplayMessage(errorcode, "en"));
        }
    } else {
        System.out.println("Sorry, your cancellation failed");
    }
}
// See the JSON tab for all the available response properties

if ((bool)response.TransactionStatus)
{
    Console.WriteLine("Cancel successful! ID: " + response.TransactionStatus.TransactionID);
}
else
{    
    if (response.ResponseMessage != null) {
        string[] errorCodes = response.ResponseMessage.Split(new[] { ", " }, StringSplitOptions.None);

        foreach (string errorCode in errorCodes)
        {
            Console.WriteLine("Response Message: " + RapidClientFactory.UserDisplayMessage(errorCode, "EN"));
        }
    }
}
.then(function (response) {
    if (response.get('TransactionStatus')) {
        console.log('Cancel authorisation successful! ID: ' + response.get('TransactionID'));
    } else {
        var errorCodes = response.get('ResponseMessage').split(', ');
        errorCodes.forEach(function(errorCode) {
            console.log("Response Message: " + rapid.getMessage(errorCode, "en"));
        });
    }
})
.catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});
# See the JSON tab for all the available response properties

if response.errors.empty?
  if response.transaction_status.status?
    puts "Cancel authorisation successful! ID: #{response.transaction_status.transaction_id}"
  else
    puts "Response Message: #{response.transaction_status.processing_details.response_message}"
  end
else
  response.errors.each { |e| puts "Response message: "+ EwayRapid::RapidClient.user_display_message(e) }
end

The response from eWAY will contain details as to whether the transaction succeeded or failed

Response Field Descriptions

Field Name Max Length Data Type Description
ResponseCode 512 string The authorisation code for this transaction as returned by the bank
ResponseMessage 512 string One or more Response Codes that describes the result of the action performed.
TransactionStatus boolean Whether the cancel transaction succeeded
TransactionID 8 int A unique identifier that represents the transaction in eWAY’s system
Errors 255 string The error codes of any errors that occurred with the cancellation, these can be looked up in the Response Codes section.

Token Payments

Capture your customers details once, and securely store them on eWAY’s PCI DSS compliant servers for any time they wish to make a purchase in the future.

Capturing and updating a customer’s details can be done through any of the available payment methods by using the appropriate Method.

Token is also supported with MasterPass, Visa Checkout and PayPal (PayPal does require additional setup).

Create Token Customer with Direct Connection example

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
        "Customer": { 
           "Title": "Mr.", 
           "FirstName": "John", 
           "LastName": "Smith",
           "Country": "au",
           "CardDetails": { 
             "Name": "John Smith", 
             "Number": "4444333322221111", 
             "ExpiryMonth": "12", 
             "ExpiryYear": "25",
             "CVN": "123" 
           }
        }, 
        "Payment": {
           "TotalAmount": 0
        },
        "Method": "CreateTokenCustomer",
        "TransactionType": "Purchase"
        }' \
    https://api.sandbox.ewaypayments.com/Transaction
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <DirectPayment xmlns="https://api.ewaypayments.com/">
            <request>
                <Customer>
                    <Title>Mr.</Title>
                    <FirstName>John</FirstName>
                    <LastName>Smith</LastName>
                    <Country>au</Country>
                    <CardDetails>
                        <Number>4444333322221111</Number>
                        <Name>John Smith</Name>
                        <ExpiryMonth>12</ExpiryMonth>
                        <ExpiryYear>25</ExpiryYear>
                        <CVN>123</CVN>
                    </CardDetails>
                </Customer>
                <Payment>
                    <TotalAmount>0</TotalAmount>
                </Payment>
                <Method>CreateTokenCustomer</Method>
                <TransactionType>Purchase</TransactionType>
            </request>
        </DirectPayment>
    </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$customer = [
    'Title' => 'Mr.',
    'FirstName' => 'John',
    'LastName' => 'Smith',
    'Country' => 'au',
    'CardDetails' => [
        'Name' => 'John Smith',
        'Number' => '4444333322221111',
        'ExpiryMonth' => '12',
        'ExpiryYear' => '25',
        'CVN' => '123',
    ]
];

$response = $client->createCustomer(\Eway\Rapid\Enum\ApiMethod::DIRECT, $customer);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Customer customer = new Customer();
customer.setTitle("Mr.");
customer.setFirstName("John");
customer.setLastName("Smith");

Address address = new Address();
address.setCountry("au");
customer.setAddress(address);

CardDetails cardDetails = new CardDetails();
cardDetails.setName("John Smith");
cardDetails.setNumber("4444333322221111");
cardDetails.setExpiryMonth("12");
cardDetails.setExpiryYear("25");
cardDetails.setCVN("123");
customer.setCardDetails(cardDetails);

CreateCustomerResponse response = client.create(PaymentMethod.Direct, customer);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Customer customer = new Customer() {
    Title = "Mr.",
    FirstName = "John",
    LastName = "Smith",
    Address = new Address() 
    {
        Country = "au" 
    },
    CardDetails = new CardDetails()
    {
        Name = "John Smith",
        Number = "4444333322221111",
        ExpiryMonth = "11",
        ExpiryYear = "25",
        CVN = "123"
    } 
};

CreateCustomerResponse response = ewayClient.Create(PaymentMethod.Direct, customer);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createCustomer(rapid.Enum.Method.DIRECT, {
   "Title": "Mr.",
   "FirstName": "John",
   "LastName": "Smith",
   "Country": "au",
   "CardDetails": {
     "Name": "John Smith",
     "Number": "4444333322221111",
     "ExpiryMonth": "12",
     "ExpiryYear": "25",
     "CVN": "123"
   }
}).then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

customer = EwayRapid::Models::Customer.new
customer.title = 'Mr.'
customer.first_name = 'John'
customer.last_name = 'Smith'

address = EwayRapid::Models::Address.new
address.country = 'AU'
customer.address = address

card_details = EwayRapid::Models::CardDetails.new
card_details.name = 'John Smith'
card_details.number = '4444333322221111'
card_details.expiry_month = '05'
card_details.expiry_year = '25'
card_details.cvn = '123'
customer.card_details = card_details

response = client.create_customer(EwayRapid::Enums::PaymentMethod::DIRECT, customer)

Create Token Customer

To create a Token Customer, use the same process as a transaction in any of the available eWAY Rapid payment methods with the following details:

Remember to store the Token Customer ID for subsequent charges and updates!

Creating and charging a token customer at the same time is only possible using the Transparent Redirection, Responsive Shared Page or IFrame payment methods. To do this, set the Method to TokenPayment and include the Payment section with the TotalAmount to be charged or, if using an eWAY Rapid SDK, do a regular transaction and set the SaveCustomer flag to true.

Update Token Customer with Direct Connection example

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
        "Customer": { 
           "TokenCustomerID": 917758625852,
           "Title": "Ms.", 
           "FirstName": "Jane", 
           "LastName": "Smith",
           "Country": "au",
           "CardDetails": { 
             "Name": "Jane Smith", 
             "Number": "4444333322221111", 
             "ExpiryMonth": "12", 
             "ExpiryYear": "25",
             "CVN": "123" 
           }
        }, 
        "Payment": {
           "TotalAmount": 0
        },
        "Method": "UpdateTokenCustomer",
        "TransactionType": "Purchase"
        }' \
    https://api.sandbox.ewaypayments.com/Transaction
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <DirectPayment xmlns="https://api.ewaypayments.com/">
            <request>
                <Customer>
                    <TokenCustomerID>917758625852</TokenCustomerID>
                    <Title>Ms.</Title>
                    <FirstName>Jane</FirstName>
                    <LastName>Smith</LastName>
                    <Country>au</Country>
                    <CardDetails>
                        <Number>4444333322221111</Number>
                        <Name>Jane Smith</Name>
                        <ExpiryMonth>12</ExpiryMonth>
                        <ExpiryYear>25</ExpiryYear>
                        <CVN>123</CVN>
                    </CardDetails>
                </Customer>
                <Payment>
                    <TotalAmount>0</TotalAmount>
                </Payment>
                <Method>UpdateTokenCustomer</Method>
                <TransactionType>Purchase</TransactionType>
            </request>
        </DirectPayment>
    </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$customer = [
    'TokenCustomerID' => 917758625852,
    'Title' => 'Ms.',
    'FirstName' => 'Jane',
    'LastName' => 'Smith',
    'Country' => 'au',
    'CardDetails' => [
        'Name' => 'Jane Smith',
        'Number' => '4444333322221111',
        'ExpiryMonth' => '12',
        'ExpiryYear' => '25',
        'CVN' => '123',
    ]
];

$response = $client->updateCustomer(\Eway\Rapid\Enum\ApiMethod::DIRECT, $customer);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Customer customer = new Customer();
customer.setTitle("Ms.");
customer.setFirstName("Jane");
customer.setLastName("Smith");
customer.setTokenCustomerID("917758625852");

Address address = new Address();
address.setCountry("au");
customer.setAddress(address);

CardDetails cardDetails = new CardDetails();
cardDetails.setName("Jane Smith");
cardDetails.setNumber("4444333322221111");
cardDetails.setExpiryMonth("12");
cardDetails.setExpiryYear("25");
cardDetails.setCVN("123");
customer.setCardDetails(cardDetails);

CreateCustomerResponse response = client.update(PaymentMethod.Direct, customer);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

Customer customer = new Customer() {
    Title = "Ms.",
    FirstName = "Jane",
    LastName = "Smith",
    Address = new Address() 
    {
        Country = "au" 
    },
    CardDetails = new CardDetails()
    {
        Name = "Jane Smith",
        Number = "4444333322221111",
        ExpiryMonth = "12",
        ExpiryYear = "25",
        CVN = "123"
    },
    TokenCustomerID = "917758625852"
};

CreateCustomerResponse response = ewayClient.UpdateCustomer(PaymentMethod.Direct, customer);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.updateCustomer(rapid.Enum.Method.DIRECT, {
    "TokenCustomerID": "917758625852",
    "Title": "Mr.",
    "FirstName": "John",
    "LastName": "Smith",
    "Country": "au",
    "CardDetails": {
     "Name": "John Smith",
     "Number": "4444333322221111",
     "ExpiryMonth": "12",
     "ExpiryYear": "25",
     "CVN": "123"
    }
}).then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

customer = EwayRapid::Models::Customer.new
customer.token_customer_id = 917758625852
customer.title = 'Ms.'
customer.first_name = 'Jane'
customer.last_name = 'Smith'

address = EwayRapid::Models::Address.new
address.country = 'AU'
customer.address = address

card_details = EwayRapid::Models::CardDetails.new
card_details.name = 'Jane Smith'
card_details.number = '4444333322221111'
card_details.expiry_month = '05'
card_details.expiry_year = '25'
card_details.cvn = '123'
customer.card_details = card_details

response = client.update_customer(EwayRapid::Enums::PaymentMethod::DIRECT, customer)

Update Token Customer

To update a Token Customer, use the same process as a transaction in any of the available eWAY Rapid payment methods using the following details:

Charge Token Customer with Direct Connection example

curl --request POST \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    --header 'Content-Type: application/json' \
    --data '{
        "Customer": { 
           "TokenCustomerID": 917758625852
        }, 
        "Payment": {
           "TotalAmount": 1000
        },
        "Method": "ProcessPayment",
        "TransactionType": "Recurring"
        }' \
    https://api.sandbox.ewaypayments.com/Transaction
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <DirectPayment xmlns="https://api.ewaypayments.com/">
            <request>
                <Customer>
                    <TokenCustomerID>917758625852</TokenCustomerID>
                </Customer>
                <Payment>
                    <TotalAmount>1000</TotalAmount>
                </Payment>
                <Method>ProcessPayment</Method>
                <TransactionType>Recurring</TransactionType>
            </request>
        </DirectPayment>
    </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'Customer' => [
        'TokenCustomerID' => 917758625852,
    ],
    'Payment' => [
        'TotalAmount' => 1000,
    ],
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::RECURRING,
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction);
RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

Transaction transaction = new Transaction();

Customer customer = new Customer();
customer.setTokenCustomerID("917758625852");
transaction.setCustomer(customer);

PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setTotalAmount(1000);
transaction.setPaymentDetails(paymentDetails);

transaction.setTransactionType(TransactionType.Recurring);

CreateTransactionResponse response = client.create(PaymentMethod.Direct, transaction);
Transaction transaction = new Transaction()
{
    Customer = new Customer()
    {
        TokenCustomerID = "917758625852"
    },
    PaymentDetails = new PaymentDetails()
    {
        TotalAmount = 1000
    },
    TransactionType = TransactionTypes.Recurring
};

CreateTransactionResponse response = ewayClient.Create(PaymentMethod.Direct, transaction);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.createTransaction(rapid.Enum.Method.DIRECT, {
    "Customer": {
        "TokenCustomerID": 917758625852
    },
    "Payment": {
       "TotalAmount": 1000
    },
    "TransactionType": "Recurring"
}).then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

transaction = EwayRapid::Models::Transaction.new

transaction.customer = EwayRapid::Models::Customer.new
transaction.customer.token_customer_id = '917758625852'

payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
transaction.payment_details = payment_details

transaction.transaction_type = EwayRapid::Enums::TransactionType::RECURRING

response = client.create_transaction(EwayRapid::Enums::PaymentMethod::DIRECT, transaction)

Charge Token Customer

To charge a Token customer, there are two ways depending on whether the customer is initiating the transaction:

To process the transaction, the following details should be set:

Tokens can also be used in a pre-auth transaction by setting the Method to Authorise.

Query Token Customer

This is a direct call to the eWAY service allowing you to request the details of a Token Customer.

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.ewaypayments.com/Customer/{TokenCustomerID}
HTTP GET (XML) https://api.ewaypayments.com//Customer/?Filter_TokenCustomerID={TokenCustomerID}
HTTP POST (JSON) https://api.ewaypayments.com/DirectCustomerSearch.json
RPC (XML) https://api.ewaypayments.com/xml-rpc
RPC (JSON) https://api.ewaypayments.com/json-rpc

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.sandbox.ewaypayments.com/Customer/{TokenCustomerID}
HTTP GET (XML) https://api.sandbox.ewaypayments.com/Customer/?Filter_TokenCustomerID={TokenCustomerID}
HTTP POST (JSON) https://api.sandbox.ewaypayments.com/DirectCustomerSearch.json
RPC (XML) https://api.sandbox.ewaypayments.com/xml-rpc
RPC (JSON) https://api.sandbox.ewaypayments.com/json-rpc

Request Field Descriptions

Example Token Customer Query request

curl --request GET \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    https://api.sandbox.ewaypayments.com/Customer/917758625852
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <DirectCustomerSearch xmlns="https://api.ewaypayments.com/">
         <request>
            <TokenCustomerID>917758625852</TokenCustomerID>
         </request>
      </DirectCustomerSearch>
   </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$response = $client->queryCustomer(917758625852);

RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

long tokenId = Long.parseLong("917758625852");
QueryCustomerResponse response = client.queryCustomer(tokenId);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

QueryCustomerResponse response = ewayClient.QueryCustomer(918268990356);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.queryCustomer("917758625852")
.then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

response = client.query_customer('917758625852')
Field Name Field Type Max Length Data Type Description
TokenCustomerID R 16 string The Token Customer ID

Field Types: R – Required

Response Field Descriptions

Example Token Customer Query response

{
    "Customers": [{
        "CardDetails": {
            "Number": "444433XXXXXX1111",
            "Name": "Joel Smith",
            "ExpiryMonth": "12",
            "ExpiryYear": "25",
            "StartMonth": "",
            "StartYear": "",
            "IssueNumber": ""
        },
        "TokenCustomerID": 917758625852,
        "Reference": "",
        "Title": "Mr.",
        "FirstName": "Joel",
        "LastName": "Smith",
        "CompanyName": "",
        "JobDescription": "",
        "Street1": "",
        "Street2": null,
        "City": "",
        "State": "",
        "PostalCode": "",
        "Country": "au",
        "Email": "",
        "Phone": "",
        "Mobile": "",
        "Comments": "",
        "Fax": "",
        "Url": ""
    }],
    "Errors": null
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <DirectCustomerSearchResponse xmlns="https://api.ewaypayments.com/">
         <DirectCustomerSearchResult>
            <Customers>
               <DirectTokenCustomer>
                  <TokenCustomerID>917758625852</TokenCustomerID>
                  <Reference/>
                  <Title>Mr.</Title>
                  <FirstName>Joel</FirstName>
                  <LastName>Smith</LastName>
                  <CompanyName/>
                  <JobDescription/>
                  <Street1/>
                  <City/>
                  <State/>
                  <PostalCode/>
                  <Country>au</Country>
                  <Email/>
                  <Phone/>
                  <Mobile/>
                  <Comments/>
                  <Fax/>
                  <Url/>
                  <CardDetails>
                     <Number>444433XXXXXX1111</Number>
                     <Name>Joel Smith</Name>
                     <ExpiryMonth>12</ExpiryMonth>
                     <ExpiryYear>25</ExpiryYear>
                     <StartMonth/>
                     <StartYear/>
                     <IssueNumber/>
                  </CardDetails>
               </DirectTokenCustomer>
            </Customers>
         </DirectCustomerSearchResult>
      </DirectCustomerSearchResponse>
   </soap:Body>
</soap:Envelope>
<?php

// See the JSON tab for all the available properties

$tokenCustomerID = $response->Customers[0]->TokenCustomerID;
$maskedCard = $response->Customers[0]->CardDetails->Number;
// See the JSON tab for all the available properties

String firstName = response.getFirstName();
String maskedCard = response.getCardDetail().getNumber();
// See the JSON tab for all the available properties

string firstName = response.Customers[0].FirstName;
string maskedCard = response.Customers[0].CardDetails.Number;
.then(function (response) {
    var customerid = response.get('Customers[0].TokenCustomerID');
    var maskedCard = response.get('Customers[0].CardDetails.Number');
}).catch(function(reason) {
    reason.getErrors().forEach(function(error) {
        console.log("Response Messages: " + rapid.getMessage(error, "en"));
    });
});
# See the JSON tab for all the available properties

token_customer_id = response.token_customer_id
masked_card = response.card_detail.number

Customers

This set of fields contains the details of the customer.

Field Name Max Length Data Type Description
TokenCustomerID 16 long An eWAY-issued ID that represents the Token customer to be loaded for this action.
Reference 50 string The merchant’s reference for this customer
Title† 5 string The customer’s title
FirstName 50 string The customer’s first name.
LastName 50 string The customer’s last name
CompanyName 50 string The customer’s company name.
JobDescription 50 string The customer’s job description / title.
Street1 50 string The customer’s street address.
Street2 50 string The customer’s street address.
City 50 string The customer’s city / town / suburb.
State 50 string The customer’s state / county.
PostalCode 30 string The customer’s post / zip code.
Country† 2 string The customer’s country. A two letter ISO 3166-1 alpha-2 code as defined in the ISO 3166 standard. For more information see: http://www.iso.org/iso/country_names_and_code_elements
Email 50 string The customer’s email address
Phone 32 string The customer’s phone number.
Mobile 32 string The customer’s mobile phone number.
Comments 255 string Any comments the merchant wishes to add about the customer.
Fax 32 string The customer’s fax number.
Url 512 string The customer’s website.

Card Details

Field Name Max Length Data Type Description
Name 50 string The name of the card holder
Number 50 int The masked card number
ExpiryMonth 2 int The month that the card expires.
ExpiryYear 2 int The year that the card expires.
StartMonth* 2 int The month that the card is valid from
StartYear* 2 int The year that the card is valid from
IssueNumber* int The card’s issue number

*Applies to UK only

This API allows you to access the Settlement reports in MYeWAY by querying for the settlement summary, settlement transactions (individually) or both.

Live endpoints

Type Gateway URL
SDK “Production”
SOAP https://api.ewaypayments.com/soap.asmx
SOAP WSDL https://api.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.ewaypayments.com/Search/Settlement

Sandbox endpoints

Type Gateway URL
SDK “Sandbox”
SOAP https://api.sandbox.ewaypayments.com/soap.asmx
SOAP WSDL https://api.sandbox.ewaypayments.com/soap.asmx?WSDL
REST (GET) https://api.sandbox.ewaypayments.com/Search/Settlement

Report Modes

Request Field Descriptions

Basic Request

curl --request GET \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    https://api.sandbox.ewaypayments.com/Search/Settlement?SettlementDate=2015-02-02\&ReportMode=Both
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <SettlementSearch xmlns="https://api.ewaypayments.com/">
         <request>
            <SettlementDate>2015-02-02</SettlementDate>
            <ReportMode>Both</ReportMode>
         </request>
      </SettlementSearch>
   </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$search = [
    'ReportMode' => \Eway\Rapid\Enum\SettlementReportMode::BOTH,
    'SettlementDate' => '2015-02-02',
];

$response = $client->settlementSearch($search);
// Settlement reporting is not currently available through the eWAY Rapid Java library
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

SettlementSearchRequest search = new SettlementSearchRequest()
{
    ReportMode = SettlementSearchMode.Both,
    StartDate = "2015-02-02",
};

SettlementSearchResponse settlementResponse = ewayClient.SettlementSearch(search);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.settlementSearch({
  "ReportMode": rapid.Enum.SettlementReportMode.BOTH,
  "SettlementDate": "2015-02-02"
})
.then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

settlement_search = EwayRapid::Models::SettlementSearch.new
settlement_search.report_mode = 'Both'
settlement_search.settlement_date = '2015-02-02'

search_response = client.settlement_search(settlement_search)

Request with filtering

curl --request GET \
    --user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
    https://api.sandbox.ewaypayments.com/Search/Settlement?SettlementDate=2015-02-02\&ReportMode=Both\&CardType=VI\&Currency=AUD
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <SettlementSearch xmlns="https://api.ewaypayments.com/">
         <request>
            <SettlementDate>2015-02-02</SettlementDate>
            <ReportMode>Both</ReportMode>
            <CardType>VI</CardType>
            <Currency>AUD</Currency>
         </request>
      </SettlementSearch>
   </soap:Body>
</soap:Envelope>
<?php

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$search = [
    'ReportMode' => \Eway\Rapid\Enum\SettlementReportMode::BOTH,
    'SettlementDate' => '2015-02-02',
    'CardType' => 'VI',
    'Currency' => 'AUD',
];

$response = $client->settlementSearch($search);
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(apiKey, password, rapidEndpoint);

SettlementSearchRequest search = new SettlementSearchRequest()
{
    ReportMode = SettlementSearchMode.Both,
    StartDate = "2015-02-02",
    CardType = CardType.VI,
    Currency = "AUD"
};

SettlementSearchResponse settlementResponse = ewayClient.SettlementSearch(search);
var client = rapid.createClient(apiKey, password, rapidEndpoint);

client.settlementSearch({
  "ReportMode": rapid.Enum.SettlementReportMode.BOTH,
  "SettlementDate": "2015-02-02",
  "CardType": "VI",
  "Currency": "AUD"
})
.then(function (response) {

});
client = EwayRapid::RapidClient.new(api_key, password, endpoint)

settlement_search = EwayRapid::Models::SettlementSearch.new
settlement_search.report_mode = 'Both'
settlement_search.settlement_date = '2015-02-02'
settlement_search.card_type = Enums::CardType::VISA
settlement_search.currency = 'AUD'

search_response = client.settlement_search(settlement_search)

All parameters are passed after the URL as a GET request when using REST.

Field Name Field Type Data Type Description
ReportMode R string One of Both, SummaryOnly or TransactionOnly (see above)
SettlementDate* C string A settlement date will need to be entered to query. Note: if a date range is used, SettlementDate will be ignored
This should be formatted as YYYY-MM-DD
StartDate* C string This parameter set the start of a filtered date range. Note: if a date range is used, SettlementDate will be ignored
This should be formatted as YYYY-MM-DD
EndDate* C string This parameter set the end of a filtered date range. Note: if a date range is used, SettlementDate will be ignored
This should be formatted as YYYY-MM-DD
CardType O string The code for the card type to filter the option for. One of:
  • ALL - all cards
  • VI - Visa
  • MC - Mastercard
  • AX - AMEX
  • DC - Diners Club
  • JC - JCB
  • MD - Maestro UK
  • MI - Maestro International
  • SO - Solo
  • LA - Laser
  • DS - Discover
Currency O string The currency to filter the report by. The three digit ISO 4217 currency code should be used or ALL for all currencies. This should be in uppercase.
e.g. ALL, AUD, USD, GBP, NZD
Page O int The page number to retrieve
PageSize O int The number of records to retrieve per page

*One of SettlementDate or StartDate and EndDate is required

Example first response

{
    "SettlementSummaries": null, 
    "SettlementTransactions": null,
    "Errors": "If you are querying the settlement report with this date range for the first time, the data will be available in 60 mins approx. Thank you."
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <SettlementSearchResponse xmlns="https://api.ewaypayments.com/">
         <SettlementSearchResult>
            <Errors>If you are querying the settlement report with this date range for the first time, the data will be available in 60 mins approx. Thank you.</Errors>
         </SettlementSearchResult>
      </SettlementSearchResponse>
   </soap:Body>
</soap:Envelope>

Search Response for the first time

Settlement reports are enabled automatically the first time the API is called. The process takes 60 minutes, the first time the Settlement API is called for a merchant the message to the right is displayed.

Example settlement search response

{
    "SettlementSummaries": [{
        "SettlementID": "53e78b14-ac2c-4b1b-a099-a12c6d5f30bc",
        "Currency": "36",
        "CurrencyCode": "AUD",
        "TotalCredit": 97100,
        "TotalDebit": 320,
        "TotalBalance": 96780,
        "BalancePerCardType": [{
            "CardType": "VI",
            "NumberOfTransactions": 14,
            "Credit": 97100,
            "Debit": 320,
            "Balance": 96780
        }]
    }],
    "SettlementTransactions": [{
        "SettlementID": "53e78b14-ac2c-4b1b-a099-a12c6d5f30bc",
        "eWAYCustomerID": 87654321,
        "Currency": "36",
        "CurrencyCode": "AUD",
        "TransactionID": 11258912,
        "TxnReference": "0000000011258912",
        "CardType": "VI",
        "Amount": 100,
        "TransactionType": "1",
        "TransactionDateTime": "\/Date(1422795600000)\/",
        "SettlementDateTime": "\/Date(1422795600000)\/"
    }, {
        "SettlementID": "53e78b14-ac2c-4b1b-a099-a12c6d5f30bc",
        "eWAYCustomerID": 87654321,
        "Currency": "36",
        "CurrencyCode": "AUD",
        "TransactionID": 11259196,
        "TxnReference": "0000000011259196",
        "CardType": "VI",
        "Amount": 1000,
        "TransactionType": "1",
        "TransactionDateTime": "\/Date(1422795600000)\/",
        "SettlementDateTime": "\/Date(1422795600000)\/"
    }, {
        "SettlementID": "53e78b14-ac2c-4b1b-a099-a12c6d5f30bc",
        "eWAYCustomerID": 87654321,
        "Currency": "36",
        "CurrencyCode": "AUD",
        "TransactionID": 11260888,
        "TxnReference": "0000000011260888",
        "CardType": "VI",
        "Amount": 1000,
        "TransactionType": "8",
        "TransactionDateTime": "\/Date(1422795600000)\/",
        "SettlementDateTime": "\/Date(1422795600000)\/"
    }],
    "Errors": ""
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <SettlementSearchResponse xmlns="https://api.ewaypayments.com/">
         <SettlementSearchResult>
            <Errors/>
            <SettlementSummaries>
               <SettlementSummary>
                  <SettlementID>53e78b14-ac2c-4b1b-a099-a12c6d5f30bc</SettlementID>
                  <Currency>36</Currency>
                  <TotalCredit>97100</TotalCredit>
                  <TotalDebit>320</TotalDebit>
                  <TotalBalance>96780</TotalBalance>
                  <BalancePerCardType>
                     <BalanceSummaryPerCardType>
                        <CardType>VI</CardType>
                        <NumberOfTransactions>14</NumberOfTransactions>
                        <Credit>97100</Credit>
                        <Debit>320</Debit>
                        <Balance>96780</Balance>
                     </BalanceSummaryPerCardType>
                  </BalancePerCardType>
               </SettlementSummary>
            </SettlementSummaries>
            <SettlementTransactions>
               <SettlementTransaction>
                  <SettlementID>53e78b14-ac2c-4b1b-a099-a12c6d5f30bc</SettlementID>
                  <CurrencyCardTypeTransactionID>36:VI:11258912</CurrencyCardTypeTransactionID>
                  <eWAYCustomerID>87654321</eWAYCustomerID>
                  <Currency>36</Currency>
                  <TransactionID>11258912</TransactionID>
                  <TxnReference>0000000011258912</TxnReference>
                  <CardType>VI</CardType>
                  <Amount>100</Amount>
                  <TransactionType>1</TransactionType>
                  <TransactionDateTime>2015-02-02T00:00:00+11:00</TransactionDateTime>
                  <SettlementDateTime>2015-02-02T00:00:00+11:00</SettlementDateTime>
               </SettlementTransaction>
               <SettlementTransaction>
                  <SettlementID>53e78b14-ac2c-4b1b-a099-a12c6d5f30bc</SettlementID>
                  <CurrencyCardTypeTransactionID>36:VI:11259196</CurrencyCardTypeTransactionID>
                  <eWAYCustomerID>87654321</eWAYCustomerID>
                  <Currency>36</Currency>
                  <TransactionID>11259196</TransactionID>
                  <TxnReference>0000000011259196</TxnReference>
                  <CardType>VI</CardType>
                  <Amount>1000</Amount>
                  <TransactionType>1</TransactionType>
                  <TransactionDateTime>2015-02-02T00:00:00+11:00</TransactionDateTime>
                  <SettlementDateTime>2015-02-02T00:00:00+11:00</SettlementDateTime>
               </SettlementTransaction>
              <SettlementTransaction>
                  <SettlementID>53e78b14-ac2c-4b1b-a099-a12c6d5f30bc</SettlementID>
                  <CurrencyCardTypeTransactionID>36:VI:11260888</CurrencyCardTypeTransactionID>
                  <eWAYCustomerID>87654321</eWAYCustomerID>
                  <Currency>36</Currency>
                  <TransactionID>11260888</TransactionID>
                  <TxnReference>0000000011260888</TxnReference>
                  <CardType>VI</CardType>
                  <Amount>1000</Amount>
                  <TransactionType>8</TransactionType>
                  <TransactionDateTime>2015-02-02T00:00:00+11:00</TransactionDateTime>
                  <SettlementDateTime>2015-02-02T00:00:00+11:00</SettlementDateTime>
               </SettlementTransaction>
            </SettlementTransactions>
         </SettlementSearchResult>
      </SettlementSearchResponse>
   </soap:Body>
</soap:Envelope>

$totalCredit = $response->SettlementSummaries[0]['TotalCredit'];

foreach ($response->SettlementTransactions as $transaction) {
    $id = $transaction['TransactionID'];
    $cardType = $transaction['CardType'];
    $amount = $transaction['Amount'];
}
if (settlementResponse.Errors == null)
{
    foreach (var summary in settlementResponse.SettlementSummaries)
    {
        Console.WriteLine("Settlement ID " 
            + summary.SettlementID + " = " 
            + String.Format("{0:C}", summary.TotalBalance/100));
    }

    foreach (var transaction in settlementResponse.SettlementTransactions)
    {
        Console.WriteLine(transaction.TransactionDateTime.ToString("yyyy-MM-dd") + ": " 
            + transaction.TransactionID + " = " 
            + String.Format("{0:C}", transaction.Amount/100));
    }
}
else
{
    Console.WriteLine("Error message: " + settlementResponse.Errors);
}

.then(function (response) {
    var totalCredit = response.get('SettlementSummaries[0].TotalCredit');

    response.get('SettlementTransactions').forEach(function(transaction) {
        var id = transaction.TransactionID;
        var cardType = transaction.CardType;
        var amount = transaction.Amount;
    });
}).catch(function(reason) {
    console.log("Response Messages: " + reason.getErrors());
});
if search_response.errors.to_a.empty?
  search_response.settlement_summaries.each { |summary|
    print "ID: " + summary.settlement_id
  }
  search_response.settlement_transactions.each { |transaction|
    print "Transaction " + transaction.transaction_id.to_s
    print "Card Type " + transaction.card_type
    print "Amount $" + (transaction.amount / 100)
  }
else
  print search_response.errors
end

Response field descriptions

Field Name Data Type Description
SettlementID string The unique ID of the settlement
Currency string The numeric code for the currency of the settlement
CurrencyCode string The 3 character ISO 4217 code that represents the currency for this settlement.
TotalCredit int The total amount credited in the settlement in cents (e.g. $5.00 is 500)
TotalDebit int The total amount debited in this settlement in cents (e.g. $5.00 is 500)
TotalBalance int The total balance settled in this settlement in cents (e.g. $5.00 is 500)
CardType string The code of the card type of this settlement
  • ALL - all cards
  • VI - Visa
  • MC - Mastercard
  • AX - AMEX
  • DC - Diners Club
  • JC - JCB
  • MD - Maestro UK
  • MI - Maestro International
  • SO - Solo
  • LA - Laser
  • DS - Discover
NumberOfTransactions int The number of transactions in this settlement
Credit int The amount credited in this settlement
Debit int The amount debited in this settlement
Balance int The balance settled in this settlement
eWAYCustomerID int The eWAY Customer ID associated with this settlement transaction
TransactionID int The unique eWAY Transaction ID associated with this settlement transaction
TxnReference string The unique Transaction ID as returned from the bank
Amount int The amount of the settlement transaction in cents (e.g. $5.00 is 500)
TransactionType string A numeric representation of the transaction type:
  • 1 - Purchase
  • 4 - Refund
  • 8 - Capture
TransactionDateTime Date object (REST) The GMT date of the transaction represented as a JavaScript Date initializer
The date is a unix timestamp * 1000
string (SOAP) The date of the transaction represented as an ISO-8601 date time with timezone.
SettlementDateTime Date object (REST) The GMT date of the transaction settled as a JavaScript Date initializer
The date is a unix timestamp * 1000
string (SOAP) The date of the transaction represented as an ISO-8601 date time with timezone.
Errors string Any errors returned from this transaction

Recurring Payments

Recurring Payments is ideal for subscriptions or instalments, allowing you to automatically charge customers on a daily, weekly, fortnightly or monthly basis.

The eWAY Recurring Payments API is only available over a SOAP interface.

Authentication

    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au</Username>
            <Password>test</Password>
        </eWAYHeader>
    </soap:Header>

The Recurring Payments API requires the following credentials:

These are passed in the SOAP Header in a eWAYHeader block.

Endpoints

The following endpoints are used for Recurring Payments:

Type Gateway Endpoint
Live https://www.eway.com.au/gateway/rebill/manageRebill.asmx
Sandbox https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx

The WSDL for the SOAP service is located at:

Type WSDL Location
Live https://www.eway.com.au/gateway/rebill/manageRebill.asmx?WSDL
Sandbox https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx?WSDL

Create Rebill Customer

Example Create Rebill Customer request

As Recurring Payments does not support JSON, please see the SOAP tab.
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au</Username>
            <Password>test</Password>
        </eWAYHeader>
    </soap:Header>
    <soap:Body>
        <CreateRebillCustomer xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <customerTitle>Mr</customerTitle>
            <customerFirstName>Joe</customerFirstName>
            <customerLastName>Bloggs</customerLastName>
            <customerAddress>Bloggs Enterprise</customerAddress>
            <customerSuburb>Capital City</customerSuburb>
            <customerState>ACT</customerState>
            <customerCompany>Bloggs</customerCompany>
            <customerPostCode>2111</customerPostCode>
            <customerCountry>Australia</customerCountry>
            <customerEmail>test@eway.com.au</customerEmail>
            <customerFax>0298989898</customerFax>
            <customerPhone1>0297979797</customerPhone1>
            <customerPhone2></customerPhone2>
            <customerRef>Ref123</customerRef>
            <customerJobDesc></customerJobDesc>
            <customerComments>Please Ship ASASP</customerComments>
            <customerURL>www.eway.com.au</customerURL>
        </CreateRebillCustomer>
    </soap:Body>
</soap:Envelope>

In order to setup a recurring payment schedule, first a Rebill Customer must be created.

Request Field Descriptions

All parameters are passed after the URL as a GET request when using REST.

Field Name Field Type Max Length Data Type Description
customerTitle O 20 string The customer’s title.
customerFirstName R 50 string The customer’s first name.
customerLastName R 50 string The customer’s last name.
customerAddress O 255 string The customer’s address.
customerSuburb O 50 string The customer’s suburb.
customerState O 50 string The customer’s state.
customerCompany O 100 string The customer’s company name.
customerPostCode O 6 string The customer’s post/zip code.
customerCountry O 50 string The customer’s country.
customerEmail O 50 string The customer’s email address, must be correctly formatted if present.
customerFax O 20 string The customer’s fax number.
customerPhone1 O 20 string The customer’s phone number.
customerPhone2 O 20 string The customer’s second phone number.
customerRef O 20 string The merchant’s reference for this customer.
customerJobDesc O 50 string The customer’s job description / title.
customerComments O 255 string Any comments the merchant wishes to add about the customer.
customerURL O 255 string The customer’s website, which must be correctly formatted if present.

Field Types: O – Optional, R - Required

Response Field Descriptions

Example Successful Response

<CustomerDetails>
    <Result>Success</Result>
    <ErrorSeverity /> <ErrorDetails />
    <RebillCustomerID>60001545</RebillCustomerID>
</CustomerDetails> 

The response to create customer will contain the RebillCustomerID to identify the customer in future requests. If an error occurs, the Result will be Fail and the details appear in the ErrorDetails field.

Field Name Max Length Data Type Description
Result 10 string The result of the operation, either Success or Fail.
ErrorSeverity 50 string The severity of any errors. Blank if no error.
ErrorDescription 255 string Details about any error that occurred.
RebillCustomerID 8 string The Rebill Customer ID

Create Rebill Event

Example Create Rebill Event Request

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au</Username>
            <Password>test</Password>
        </eWAYHeader>
    </soap:Header>
    <soap:Body>
        <CreateRebillEvent xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <RebillCustomerID>60001545</RebillCustomerID>
            <RebillInvRef>ref123</RebillInvRef>
            <RebillInvDes></RebillInvDes>
            <RebillCCName>test</RebillCCName>
            <RebillCCNumber>4444333322221111</RebillCCNumber>
            <RebillCCExpMonth>07</RebillCCExpMonth>
            <RebillCCExpYear>07</RebillCCExpYear>
            <RebillInitAmt>100</RebillInitAmt>
            <RebillInitDate>08/06/2015</RebillInitDate>
            <RebillRecurAmt>100</RebillRecurAmt>
            <RebillStartDate>05/06/2015</RebillStartDate>
            <RebillInterval>1</RebillInterval>
            <RebillIntervalType>1</RebillIntervalType>
            <RebillEndDate>08/07/2017</RebillEndDate>
        </CreateRebillEvent>
    </soap:Body>
</soap:Envelope>

The Rebill Event defines the schedule for payments and store’s the customer’s card details.

Request Field Descriptions

Field Name Field Type Max Length Data Type Description
RebillCustomerID R 8 string The ID of the active Rebill Customer
RebillInvRef O 255 string The merchant’s reference number for this transaction.
RebillInvDes O 255 string A short description of the purchase that the customer is making.
RebillCCName R 50 string The customer’s card holder name.
RebillCCNumber R 19 string The customer’s card number.
RebillCCExpMonth R 2 string The customer’s card expiry month.
RebillCCExpYear R 4 string The customer’s card expiry year. Format can be either YY or YYYY (e.g. 19 or 2019)
RebillInitAmt R 10 string The initial payment amount in cents (e.g. $2.00 is 200). Enter 0 if an initial payment is not required.
RebillInitDate R 10 string The date of the initial payment. Enter today’s date if no payment is required. Format must be dd/mm/yyyy. The initial date must be the same or before RebillStartDate.
RebillRecurAmt R 10 string The recurring payment amount in cents (e.g. $2.00 is 200). The value must be greater than 0.
RebillStartDate R 10 string The date of the first recurring payment. Format must of dd/mm/yyyy. The date must be today or greater than today date and must be greater than RebillInitDate.
RebillInterval R 2 string The size of the interval between recurring payments (used in conjunction with RebillIntervalType). The value must be between 1 and 31 only
RebillIntervalType R 1 string The type of Interval. One of:
  • 1 = Days
  • 2 = Weeks
  • 3 = Months
  • 4 = Years
e.g. for every 3 weeks, enter 3 for RebillInterval and 2 for RebillIntervalType.
RebillEndDate R 10 string The date that recurring payments are to stop. Format must of dd/mm/yyyy. This date must be after RebillStartDate.

Field Types: O – Optional, R - Required

Response Field Descriptions

Example Successful Response

<RebillEventDetails>
    <Result>Success</Result>
    <ErrorSeverity />
    <ErrorDetails />
    <RebillCustomerID>60001545</RebillCustomerID>
    <RebillID>80001208</RebillID>
</RebillEventDetails>

The response to create customer will contain the RebillID to identify the rebilling event in future requests. If an error occurs, the Result will be Fail and the details appear in the ErrorDetails field.

Field Name Max Length Data Type Description
Result 10 string The result of the operation, either Success or Fail.
ErrorSeverity 50 string The severity of any errors. Blank if no error.
ErrorDescription 255 string Details about any error that occurred.
RebillCustomerID 8 string The Rebill Customer ID
RebillID 8 string The Rebill Event ID

Delete Rebill Customer

Example Delete Rebill Customer request

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au</Username>
            <Password>test</Password>
        </eWAYHeader>
    </soap:Header>
    <soap:Body>
        <DeleteRebillCustomer xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <RebillCustomerID>6000154</RebillCustomerID >
        </DeleteRebillCustomer>
    </soap:Body>
</soap:Envelope>

Rebill Customers can be remove only if they have no active rebill events.

Request Field Descriptions

Field Name Field Type Max Length Data Type Description
RebillCustomerID R string 8 The active Rebill Customer ID to delete

Field Types: O – Optional, R - Required











Response Field Descriptions

Example Successful Response

<CustomerDetails>
    <Result>Success</Result>
    <ErrorSeverity />
    <ErrorDetails />
    <RebillCustomerID>60001545</RebillCustomerID>
</CustomerDetails>
Field Name Max Length Data Type Description
Result 10 string The result of the operation, either Success or Fail.
ErrorSeverity 50 string The severity of any errors. Blank if no error.
ErrorDescription 255 string Details about any error that occurred.
RebillCustomerID 8 string The Rebill Customer ID





Delete Rebill Event

Example Delete Rebill Event request

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au</Username>
            <Password>test</Password>
        </eWAYHeader>
    </soap:Header>
    <soap:Body>
        <DeleteRebillEvent xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <RebillCustomerID>60001545</RebillCustomerID>
            <RebillID>80001208</RebillID>
        </DeleteRebillEvent>
    </soap:Body>
</soap:Envelope>

Request Field Descriptions

Field Name Field Type Max Length Data Type Description
RebillCustomerID R string 8 The active Rebill Customer ID to delete
RebillID R string 8 The active Rebill Event ID to delete

Field Types: O – Optional, R - Required













Response Field Descriptions

Example Successful Response

<RebillEventDetails>
    <Result>Success</Result>
    <ErrorSeverity />
    <ErrorDetails />
    <RebillCustomerID>60001545</RebillCustomerID>
    <RebillID>80001208</RebillID>
</RebillEventDetails>
Field Name Max Length Data Type Description
Result 10 string The result of the operation, either Success or Fail.
ErrorSeverity 50 string The severity of any errors. Blank if no error.
ErrorDescription 255 string Details about any error that occurred.
RebillCustomerID 8 string The Rebill Customer ID
RebillID 8 string The Rebill Event ID





Query Rebill Customer

Example Query Rebill Customer request

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au</Username>
            <Password>test</Password>
        </eWAYHeader>
    </soap:Header>
    <soap:Body>
        <QueryRebillCustomer xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <RebillCustomerID>6000154</RebillCustomerID>
        </QueryRebillCustomer>
    </soap:Body>
</soap:Envelope>

Request Field Descriptions

Field Name Field Type Max Length Data Type Description
RebillCustomerID R string 8 The active Rebill Customer ID to query

Field Types: O – Optional, R - Required













Response Field Descriptions

Example Successful Response

<CustomerDetails>
    <Result>Success</Result>
    <ErrorSeverity />
    <ErrorDetails />
    <CustomerRef>8989</CustomerRef>
    <CustomerTitle>Mr</CustomerTitle>
    <CustomerFirstName>Joe</CustomerFirstName>
    <CustomerLastName>Blogg</CustomerLastName>
    <CustomerCompany>eWAY</CustomerCompany>
    <CustomerJobDesc></CustomerJobDesc>
    <CustomerEmail>test@eway.com.au</CustomerEmail>
    <CustomerAddress>Capital City</CustomerAddress>
    <CustomerSuburb>Phillips</CustomerSuburb>
    <CustomerState>act</CustomerState>
    <CustomerPostCode>2607</CustomerPostCode>
    <CustomerCountry>Australia</CustomerCountry>
    <CustomerPhone1>0298989898</CustomerPhone1>
    <CustomerPhone2>989898989</CustomerPhone2>
    <CustomerFax>0298989898</CustomerFax>
    <CustomerURL>eway.com</CustomerURL>
    <CustomerComments>test</CustomerComments>
</CustomerDetails>
Field Name Max Length Data Type Description
Result 10 string The result of the operation, either Success or Fail.
ErrorSeverity 50 string The severity of any errors. Blank if no error.
ErrorDescription 255 string Details about any error that occurred.
CustomerTitle 20 string The customer’s title.
CustomerFirstName 50 string The customer’s first name.
CustomerLastName 50 string The customer’s last name.
CustomerAddress 255 string The customer’s address.
CustomerSuburb 50 string The customer’s suburb.
CustomerState 50 string The customer’s state.
CustomerCompany 100 string The customer’s company name.
CustomerPostCode 6 string The customer’s post/zip code.
CustomerCountry 50 string The customer’s country.
CustomerEmail 50 string The customer’s email address.
CustomerFax 20 string The customer’s fax number.
CustomerPhone1 20 string The customer’s phone number.
CustomerPhone2 20 string The customer’s second phone number.
CustomerRef 20 string The merchant’s reference for this customer.
CustomerJobDesc 50 string The customer’s job description / title.
CustomerComments 255 string Any comments about the customer.
CustomerURL 255 string The customer’s website.

Query Rebill Event

Example query Rebill Event request

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au </Username>
            <Password>test</Password>
        </eWAYHeader>
    </soap:Header>
    <soap:Body>
        <QueryRebillEvent xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <RebillCustomerID>60001545</RebillCustomerID>
            <RebillID>80001227</RebillID>
        </QueryRebillEvent>
    </soap:Body>
</soap:Envelope>

Request Field Descriptions

Field Name Field Type Max Length Data Type Description
RebillCustomerID R string 8 The active Rebill Customer ID to query
RebillID R string 8 The active Rebill Event ID to query

Field Types: O – Optional, R - Required









Response Field Descriptions

Example Successful Response

<RebillEventDetails>
    <Result>Success</Result>
    <ErrorSeverity />
    <ErrorDetails />
    <RebillCustomerID>60001545</RebillCustomerID>
    <RebillID>80001208</RebillID>
    <RebillInvRef>Ref123</RebillInvRef>
    <RebillInvDesc />
    <RebillCCName>test</RebillCCName>
    <RebillCCNumber>44443XXXXXXX1111</RebillCCNumber>
    <RebillCCExpMonth>07</RebillCCExpMonth>
    <RebillCCExpYear>07</RebillCCExpYear>
    <RebillInitAmt>100</RebillInitAmt>
    <RebillInitDate>08/06/2007</RebillInitDate>
    <RebillRecurAmt>100</RebillRecurAmt>
    <RebillStartDate>05/06/2007</RebillStartDate>
    <RebillInterval>1</RebillInterval>
    <RebillIntervalType>1</RebillIntervalType>
    <RebillEndDate>08/07/2007</RebillEndDate>
</RebillEventDetails>
Field Name Max Length Data Type Description
Result 10 string The result of the operation, either Success or Fail.
ErrorSeverity 50 string The severity of any errors. Blank if no error.
ErrorDescription 255 string Details about any error that occurred.
RebillCustomerID R 8 string
RebillInvRef O 255 string
RebillInvDes O 255 string
RebillCCName R 50 string
RebillCCNumber R 19 string
RebillCCExpMonth R 2 string
RebillCCExpYear R 4 string
RebillInitAmt R 10 string
RebillInitDate R 10 string
RebillRecurAmt R 10 string
RebillStartDate R 10 string
RebillInterval R 2 string
RebillIntervalType R 1 string
RebillEndDate R 10 string

Update Rebill Customer

Example Update Rebill Customer request

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au</Username>
            <Password>test</Password>
        </eWAYHeader>
    </soap:Header>
    <soap:Body>
        <UpdateRebillCustomer xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <RebillCutomerID>60001545</RebillCutomerID>
            <customerTitle>Mr</customerTitle>
            <customerFirstName>Joe</customerFirstName>
            <customerLastName>Bloggs Enterprise</customerLastName>
            <customerAddress>Capital City</customerAddress>
            <customerSuburb>Capital City</customerSuburb>
            <customerState>ACT</customerState>
            <customerCompany>Bloggs</customerCompany>
            <customerPostCode>2111</customerPostCode>
            <customerCountry>Australia</customerCountry>
            <customerEmail>test@eway.com.au</customerEmail>
            <customerFax>0298989898</customerFax>
            <customerPhone1>0297979797</customerPhone1>
            <customerPhone2></customerPhone2>
            <customerRef>Ref123</customerRef>
            <customerJobDesc>bloggs</customerJobDesc>
            <customerComments>Please Ship ASASP</customerComments>
            <customerURL>http://www.eway.com.au</customerURL>
        </UpdateRebillCustomer>
    </soap:Body>
</soap:Envelope>

Request Field Descriptions

Field Name Field Type Max Length Data Type Description
RebillCustomerID R string 8 The active Rebill Customer ID to query
customerTitle O 20 string The customer’s title.
customerFirstName R 50 string The customer’s first name.
customerLastName R 50 string The customer’s last name.
customerAddress O 255 string The customer’s address.
customerSuburb O 50 string The customer’s suburb.
customerState O 50 string The customer’s state.
customerCompany O 100 string The customer’s company name.
customerPostCode O 6 string The customer’s post/zip code.
customerCountry O 50 string The customer’s country.
customerEmail O 50 string The customer’s email address, must be correctly formatted if present.
customerFax O 20 string The customer’s fax number.
customerPhone1 O 20 string The customer’s phone number.
customerPhone2 O 20 string The customer’s second phone number.
customerRef O 20 string The merchant’s reference for this customer.
customerJobDesc O 50 string The customer’s job description / title.
customerComments O 255 string Any comments the merchant wishes to add about the customer.
customerURL O 255 string The customer’s website, which must be correctly formatted if present.

Field Types: O – Optional, R - Required

Response Field Descriptions

Example Successful Response

<CustomerDetails>
    <Result>Success</Result>
    <ErrorSeverity />
    <ErrorDetails />
    <RebillCustomerID>60001545</RebillCustomerID> 
</CustomerDetails> 
Field Name Max Length Data Type Description
Result 10 string The result of the operation, either Success or Fail.
ErrorSeverity 50 string The severity of any errors. Blank if no error.
ErrorDescription 255 string Details about any error that occurred.
RebillCustomerID R 8 string





Update Rebill Event

Example Update Rebill Event request

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au</Username>
            <Password>test</Password>
        </eWAYHeader>
    </soap:Header>
    <soap:Body>
        <UpdateRebillEvent xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <RebillCustomerID>60001545</RebillCustomerID>
            <RebillID>80001208</RebillID>
            <RebillInvRef>Ref123</RebillInvRef>
            <RebillInvDes></RebillInvDes>
            <RebillCCName>test</RebillCCName>
            <RebillCCNumber>44443XXXXXXX1111</RebillCCNumber>
            <RebillCCExpMonth>07</RebillCCExpMonth>
            <RebillCCExpYear>07</RebillCCExpYear>
            <RebillInitAmt>100</RebillInitAmt>
            <RebillInitDate>08/06/2007</RebillInitDate>
            <RebillRecurAmt>100</RebillRecurAmt>
            <RebillStartDate>05/06/2007</RebillStartDate>
            <RebillInterval>1</RebillInterval>
            <RebillIntervalType>1</RebillIntervalType>
            <RebillEndDate>08/07/2007</RebillEndDate>
        </UpdateRebillEvent>
    </soap:Body>
</soap:Envelope>

Request Field Descriptions

Field Name Field Type Max Length Data Type Description
RebillCustomerID R 8 string The ID of the active Rebill Customer
RebillInvRef O 255 string The merchant’s reference number for this transaction.
RebillInvDes O 255 string A short description of the purchase that the customer is making.
RebillCCName R 50 string The customer’s card holder name.
RebillCCNumber R 19 string The customer’s card number. This can be masked in the same way as returned by Query Rebill Event (e.g. 44443XXXXXX1111).
RebillCCExpMonth R 2 string The customer’s card expiry month.
RebillCCExpYear R 4 string The customer’s card expiry year. Format can be either YY or YYYY (e.g. 19 or 2019)
RebillInitAmt R 10 string The initial payment amount. Enter 0 if an initial payment is not required.
RebillInitDate R 10 string The date of the initial payment. Enter today’s date if no payment is required. Format must be dd/mm/yyyy. The initial date must be the same or before RebillStartDate.
RebillRecurAmt R 10 string The recurring payment amount. The value must be greater than 0.
RebillStartDate R 10 string The date of the first recurring payment. Format must of dd/mm/yyyy. The date must be today or greater than today date and must be greater than RebillInitDate.
RebillInterval R 2 string The size of the interval between recurring payments (used in conjunction with RebillIntervalType). The value must be between 1 and 31 only
RebillIntervalType R 1 string The type of Interval. One of:
  • 1 = Days
  • 2 = Weeks
  • 3 = Months
  • 4 = Years
e.g. for every 3 weeks, enter 3 for RebillInterval and 2 for RebillIntervalType.
RebillEndDate R 10 string The date that recurring payments are to stop. Format must of dd/mm/yyyy. This date must be after RebillStartDate.

Field Types: O – Optional, R - Required

Example Successful Response

<RebillEventDetails>
    <Result>Success</Result>
    <ErrorSeverity />
    <ErrorDetails />
    <RebillCustomerID>60001545</RebillCustomerID>
    <RebillID>80001208</RebillID>
</RebillEventDetails>

Response Field Descriptions

Field Name Max Length Data Type Description
Result 10 string The result of the operation, either Success or Fail.
ErrorSeverity 50 string The severity of any errors. Blank if no error.
ErrorDescription 255 string Details about any error that occurred.
RebillCustomerID 8 string The Rebill Customer ID
RebillID 8 string The Rebill Event ID





Query Next Transaction

Example Query Next Transaction request

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au</Username>
            <Password>test123</Password>
        </eWAYHeader>
    </soap:Header>
    <soap:Body>
        <QueryNextTransaction xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <RebillCustomerID>60001545</RebillCustomerID>
            <RebillID>80001208</RebillID>
        </QueryNextTransaction>
    </soap:Body>
</soap:Envelope>

To find the details for the next transaction for an event.

Request Field Descriptions

Field Name Field Type Max Length Data Type Description
RebillCustomerID R string 8 The active Rebill Customer ID to query
RebillID R string 8 The active Rebill Event ID to query

Field Types: O – Optional, R - Required









Example Successful Response

<soap:Body>
    <QueryNextTransactionResponse xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
        <QueryNextTransactionResult>
            <TransactionDate>2008-12-11T00:00:00</TransactionDate>
            <CardHolderName>Test Card </CardHolderName>
            <ExpiryDate>12/10</ExpiryDate>
            <Amount>250</Amount>
        </QueryNextTransactionResult>
    </QueryNextTransactionResponse>
</soap:Body>

Response Field Descriptions

Field Name Data Type Description
TransactionDate dateTime The date of the next transaction.
e.g. 2015-08-14
CardHolderName string The card holder’s name
ExpiryDate string The date of card expiry, formatted as mm/yy
e.g. 05/19
Amount string The amount in cents






Query Transactions

Search a Rebill Event’s past and/or future transactions.

Example Query Transaction request

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <eWAYCustomerID>87654321</eWAYCustomerID>
            <Username>test@eway.com.au</Username>
            <Password>test123</Password>
        </eWAYHeader>
    </soap:Header>
    <soap:Body>
        <QueryTransactions xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
            <RebillCustomerID>60001545</RebillCustomerID>
            <RebillID>80001208</RebillID>
            <startDate>2009-01-01</startDate>
            <endDate>2012-01-01</endDate>
            <status>Future</status>
        </QueryTransactions>
    </soap:Body>
</soap:Envelope>

Request Field Descriptions

Field Name Field Type Data Type Description
RebillCustomerID R string The active Rebill Customer ID to query
RebillID R string The active Rebill Event ID to query
startDate O dateTime Return transactions starting from this date. Format: YYYY-MM-DD.
e.g. 2015-07-21
endDate O dateTime Return transactions before this date. Format: YYYY-MM-DD.
e.g. 2016-07-21
status O string To return transactions for only the specified status.
One of Future, Pending, Successful or Failed

Field Types: O – Optional, R - Required

Response Field Descriptions

Example Successful Response

<soap:Body>
    <QueryTransactionsResponse xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
        <QueryTransactionsResult>
            <rebillTransaction>
                <TransactionDate>2009-01-23T00:00:00+11:00</TransactionDate>
                <Amount>33600</Amount>
                <Status>Successful</Status>
                <Type>Initial</Type>
                <TransactionNumber>33603360</TransactionNumber>
                <TransactionError>10,Approved</TransactionError>
            </rebillTransaction>
            <rebillTransaction>
                <TransactionDate>2009-01-30T00:00:00+11:00</TransactionDate>
                <Amount>33600</Amount>
                <Status>Failed</Status>
                <Type>Recurring</Type>
                <TransactionNumber>0</TransactionNumber>
                <TransactionError>eWAY Error: Invalid Expiry Date. Your credit card has not been billed for this transaction.</TransactionError>
            </rebillTransaction>
        </QueryTransactionsResult>
    </QueryTransactionsResponse>
</soap:Body>
Field Name Data Type Description
TransactionDate dateTime The date of the transaction in the format YYYY-MM-DD
Amount string The amount in cents.
e.g. $2.00 is 200
Status string The transaction status.
One of Future, Pending, Successful or Failed
Type string The transaction type.
One of Recurring or Initial
TransactionNumber string The eWAY transaction identifier for the transaction. Empty for pending and future transactions
TransactionError string The transaction result description.
e.g. 10,Approved or 05,Declined.
Empty for pending and future transactions

eWAY Pay Now button

Payments made even easier!

Now you can let your customers purchase from your website with a Pre-Coded Pay Now Button.

We have already done the work for you - we give you the HTML, and all you need to do is copy and paste it onto your site. Your customers will then be able to click the Pay Now Button with the purchase amount displayed, and pay you using Visa, MasterCard, AMEX, or Diners Club, without leaving your site!

Browser Support

This has been tested in Chrome 36, Firefox 30, IE 9, 10, 11. Windows Safari, iOS Safari. There is a known issue with IE8 and below.

Getting Started

Start using the eWAY Pay Now Button in 3 easy steps:

1. Get the button code

<script src="https://secure.ewaypayments.com/scripts/eCrypt.min.js"
  class="eway-paynow-button"
  data-publicapikey="XXX-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
  data-amount="1000"
  data-currency="AUD" > 
</script>

2. Add the Button to your website

Select the pages across your website that you would like to place the Pay Now Button.

All you need to do is paste the HTML code that you received in Step 1 on the desired web pages and edit the amount (remember, the amount is in cents, so for $5.00 use 500).

Your customers are now able to click the Pay Now button on your website to make a payment to you.

3. Start receiving payments

Once your customers have clicked the Pay Now Button, a secure payment window will then slide down on your website, allowing the customer to enter their credit card details and click Pay.

Your customer will get an almost immediate response confirming the payment has been processed. To check the status of the payment, you can log in to MYeWAY or use the server side code to perform a Transaction Query

Configuration Attributes

Change the button text
You can add the data-label attribute to the script to change the text on the button:

<script src="https://secure.ewaypayments.com/scripts/eCrypt.min.js"
 class="eway-paynow-button"
 data-publicapikey="XXX-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
 data-amount="100"
 data-label="Buy me now!"
 data-currency="AUD" >
</script>

Change the colours
You can change the colours of the button using the data-buttoncolor attributes

<script src="https://secure.ewaypayments.com/scripts/eCrypt.min.js"
  class="eway-paynow-button"
  data-publicapikey="XXX-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
  data-amount="500"
  data-currency="AUD"
  data-buttoncolor="#d9edf7"
  data-buttonerrorcolor="#f2dede"
  data-buttonprocessedcolor="#dff0d8"
  data-buttondisabledcolor="#f5f5f5"
  data-buttontextcolor="#000000" >
</script> 

Add some extra detail to the transaction
You can set fields to pass extra details with the transaction such as invoice description, invoice reference, customer number and customer email. The customer fields can also be made editable with the data-allowedit attribute.

<script src="https://secure.ewaypayments.com/scripts/eCrypt.min.js"
  class="eway-paynow-button"
  data-publicapikey="XXX-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
  data-amount="500"
  data-currency="AUD"
  data-invoiceref="INV-001"
  data-invoicedescription="Coffee coffee"
  data-email="caffinate@eway.com.au"
  data-phone="1800 10 65 65"
  data-allowedit="true" >
</script> 

Redirect on payment
Once a payment has been completed, the page can be set to redirect using data-resulturl. The redirected page will have the Access Code added as a URL parameter so the transaction can be looked up using the standard result request process.

<script src="https://secure.ewaypayments.com/scripts/eCrypt.min.js"
  class="eway-paynow-button"
  data-publicapikey="XXX-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
  data-amount="500"
  data-currency="AUD"
  data-resulturl="http://www.eway.com.au/shared-demo/results.aspx" >
</script> 

Form submission
If the button is placed in a form, then by setting the data-submitform attribute to yes the form will automatically submit once the transaction is complete. The Access Code will be added as a hidden form field with