All-in-One API Integration

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


Rapid iFrame

Get the best of both worlds, with the security of eWAY's hosted Responsive Shared Page and the smooth user experience of completing a payment without leaving your website. The eWAY Rapid iFrame presents a secured, hosted payment page in an iframe which helps to reduce the scope for PCI compliance. 

API Reference:

Rapid IFrame

Implementing the iframe 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 iframe to the customer and handle the response.
  3. Once the transaction has been processed, request the results from eWAY using the Access Code.

Simple JSON REST Example

  1. Request a Shared Payment URL

    Authorization: Basic (see Authentication in the API reference)
    Content-Type: application/json

    		"Payment": {
    			"TotalAmount": 1000
    		"RedirectUrl": "",
    		"CancelUrl": "",
    		"Method": "ProcessPayment",
    		"TransactionType": "Purchase"
  2. Display the iframe

    ​On the page accepting payment, use the eWAY JavaScript to open the iframe. This can be triggered in any way that is convenient: via a button or even just the page loading.

    To open the iframe call the function

    . It accepts two arguments:
    • A config object containing the Shared Payment URL
    • A callback function which accepts three arguments: a result, the transaction ID and errors.

    Note: The result returned to the callback only tells if the iframe opened successfully. To determine the transaction result, a server side request is required in the next step.

        <script src=""></script>
            var ewayConfig = {
              sharedPaymentUrl: ""
            function resultCallback(result, transactionID, errors) {
              if (result == "Complete") {
                window.location.href = "?AccessCode=44DD7aVwPYUPe...";
              } else if (result == "Error") {
                alert("There was a problem completing the payment: " + errors);
        <button onClick="eCrypt.showModalPayment(ewayConfig, resultCallback);">Pay with eWAY</button> 
  3. Request the result

    Once the transaction has been completed, the customer is redirect to your website and you can request the result:

    Authorization: Basic (see Authentication in the API reference)
    Content-Type: application/json

For more details, check out the Rapid iFrame API reference