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. 

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

Endpoint: https://api.sandbox.ewaypayments.com/AccessCodesShared
Headers:
                      Authorization: Basic (see Authentication in the API reference)
                      Content-Type: application/json

1
2
3
4
5
6
7
8
9
{
    "Payment": {
        "TotalAmount": 1000
    },
    "RedirectUrl": "http://www.example.org/",
    "CancelUrl": "http://www.example.org/",
    "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

1
eCrypt.showModalPayment

. 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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    var ewayConfig = {
      sharedPaymentUrl: "https://secure-au.sandbox.ewaypayments.com/sharedpage/sharedpayment?AccessCode=44DD7aVwPYUP..."
    };

    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>Pay with eWAY</button>

Request the result

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

    Endpoint: https://api.sandbox.ewaypayments.com/AccessCode/44DD7aVwPYUPemGRfVatk_5vJimEbHveG…
    Headers:
    Authorization: Basic (see Authentication in the API reference)
    Content-Type: application/json

For more details, check out the Rapid iFrame API reference

Become an eWAY merchant today.

With 24/7 support, over 250 integrations and 20+ years experience – the team at eWAY are here to provide you with the leading all-in-one payments solution.