imgproductsuk_rapidapi3-1

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.

API SNIPPETS

Pre Coded 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!

API Reference:

Pay Now Button

1. Get the HTML Code

  1. Login to your Live account or your Sandbox account
  2. Click 'My Account'
  3. Click "Client Side Encryption"
  4. Read the instructions to implement your Pay Now Buttons on your website. If you don't have your login details, please select 'Forgotten Password'.

Note: The HTML code is not interchangeable between Sandbox and your Live account. Each platform has separate Pay Now HTML code.

<script src="https://secure.ewaypayments.com/
    scripts/eCrypt.js"
    class="eway-paynow-button"
    data-publicapikey="XXX-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    data-amount="1000"
    data-currency="SGD" > 
</script>
					

2. Add button to your website

  1. Select the pages across your website that you would like to place the Pay Now Button.
  2. 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). 
  3. Your customers are now able to click the Pay Now button on your website to make a payment to you.
Add the eWAY Pay Now button to your website

3. Start receiving payments

Once your customers have clicked the Pay Now Button on your website, a secure payment window will then slide down on your website, allowing the customer to securely enter their credit card details and click Pay Now.

Your customer will get an almost immediate response confirming the payment has been processed. This means the card has been accepted for processing, and you are one step closer to your sales goals! To check the status of the payment, you can log in to MYeWAY or use the server side code and Rapid 3.1 API.

Pay Now Button

Customise the button for what you need!

Now you’ve got the eWAY Pay Now Button on your website, you can tweak it to suit your needs.

Change the button text


You can add the line data-label to the script to change the text on the button.
<script src="https://secure.ewaypayments.com/
    scripts/eCrypt.js"
    class="eway-paynow-button"
    data-publicapikey="XXX-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    data-amount="1000"
	data-label=""Buy me now!"
    data-currency="SGD" > 
</script>
 

Change the colour

<script src="https://secure.ewaypayments.com/
    scripts/eCrypt.js"
    class="eway-paynow-button"
    data-publicapikey="XXX-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    data-amount="1000"
	data-label="Buy me now!"
	data-buttoncolor="blue"
    data-currency="SGD" > 
</script>

Add some extra detail to the transaction


You can set an Invoice Reference and Invoice Description so that you can see what the transaction was for. These are added with the lines data-invoiceref and data-invoicedescription

<script src="https://secure.ewaypayments.com/
    scripts/eCrypt.js"
    class="eway-paynow-button"
    data-publicapikey="XXX-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    data-amount="1000"
	data-label="Buy me now!"
	data-invoiceref="INV-001"
	data-invoicedescription="Awesome Product"
    data-currency="SGD" > 
</script>
 

Get your customer’s contact details


You can add fields to collect your customer’s email and phone number by the data-allowedit="true" line

<script src="https://secure.ewaypayments.com/
    scripts/eCrypt.js"
    class="eway-paynow-button"
    data-publicapikey="XXX-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    data-amount="1000"
	data-label="Buy me now!"
	data-invoiceref="INV-001"
	data-invoicedescription="Awesome Product"
	data-allowedit="true"
    data-currency="SGD" > 
</script>
 

Advanced usage

The eWAY Pay Now Button also has a range of more advanced functionality, such as auto submitting forms and page redirection. There is more detail on these in our developer’s documentation.