Integrating eWAY and Salesforce using Chargent

Connect eWAY and Salesforce with Chargent

See all eWAY transactions, manage refunds, send payment links and more, all inside Salesforce with Chargent, the top rated payments app on the Salesforce AppExchange.

Not yet a Chargent customer?

Contact us for a no-obligation 30 day trial, and see for yourself!


eWAY processes payments globally for companies in 8 different countries, with a particular focus on Australia, New Zealand, and the United Kingdom. Founded in 1998, their innovative platform, ecommerce technology, and personalized support has led them to handle 25% of online payments in Australia.

With Chargent Payment Processing for Salesforce’s eWAY connection, you can now process payments through your eWAY account directly from Salesforce, no integration or complicated setup required. If you are an eWAY and Salesforce customer, follow the steps below and get started with a free trial today.

Prior to setting up eWAY in Salesforce

  1. Install both the Base Package and the Chargent Orders Transaction Package into your Salesforce org.
  2. Configure Chargent according to the Installation and Setup Guide.

Obtain your eWAY Sandbox API key and Password

  1. Log into your Sandbox account for AustraliaNew Zealand, or the United Kingdom
  2. Click on My Account and then go to User Security > Manage Roles
    • Enter a Role Name (such as “API Key”) and
    • Click Create New Role
    • Click Continue
  3. Go Back to My Account > User Security > Manage Users
    • Click Create New User
    • Under Security Role select API Key
    • Complete all required fields including the password and click Create User
    • Click Continue
    • Select API Key on the left side of the new user
  4. Click View API Key to see and copy the API key to use in Chargent (Be sure to use the Rapid API Key and NOT the Pay Now key).eWay SandboxeWay Sandbox

Configure eWAY Sandbox Settings

  1. Go to Settings > Sandbox and make sure PCI and Refunds checkboxes are checked in the Direct Payment Method section of the menu.
  2. Choose your Transaction Responses setting
    • Always Approve: Transactions will always approve. Note that invalid card numbers, expired cards, negative amounts will still trigger a decline.
    • Always Decline: Transactions will always be declined.
    • Use Cents Value: Depending on the cents value passed through the gateway the result will either return as transaction successful or failed. Example: $10.00 will return a response code 00 – Transaction Approved. View the full list of Response Codes to see which ones will pass a successful transaction on the test gatewayeWay Direct Payment

Setting up eWAY in Salesforce

Add an eWAY Gateway record in Salesforce using Chargent’s Gateway Wizard.

  1. Click on the App Launcher on the top left side in Salesforce.
    eWay App Launcher
  2. Select Chargent as the App
  3. Select the Chargent Settings Tab
  4. Choose Chargent Setup Wizard
    eWay chargent setting
  5. Do you have a Payment Gateway account – Select Yes
  6. Select eWAY as your Payment gateway.
  7. Select Test Transactions for testing or Live Transactions if you are looking to process real payments.
  8. Follow the prompts to configure your gateway.

You will need the following information:

  • Add your credentials based on your Sandbox (Test) or Production Live eWAY account.
    • API Key from above
    • Password that you selected for the API user

Other information that will be asked:

  • Will you be using tokenization? (recommended)
  • What currency will you be using? (AUD, USD, etc..)
  • What payment methods will you be accepting?
  • Credit cards and/or ACH (direct debit – not currently enabled for eWAY)
    • What Credit Card types will you be accepting? (Visa, Mastercard, etc…)
  • Payment Console Setup (Premium feature for Platform Edition)
    • Show Charge Button
    • Show / Create Update Token Button
    • Show Authorize Button

Testing using Chargent Anywhere

Testing with Payment Console

To test using the Payment Console, you want to navigate to any record in your Sandbox that has the Chargent Anywhere Component enabled.

  1. Click the [PaymentConsole] button
  2. If you are using multiple gateways select your gateway from the dropdown otherwise continue to step 3
  3. Enter all the Billing Information and click [Next]
  4. Enter in a test credit card number, expiration date, and CVC code based on the eWay test credit cards below.
  5. Click the [Charge] button.

You should receive a green box showing Approved.

eWay Transaction Successful

Testing using Payment Request

To test using a Payment Request you want to be sure you have the Chargent Payment Request feature set up as outlined in our documentation.

  1. Click the [Send Payment Request] button
  2. If you have multiple Payment Request templates set up you will first choose what template you want to use.
  3. Enter an email address where you want to send the test Payment Request along with any amount.
  4. Enter a Contact name (Optional)
  5. Click the [Send Request] button

Send Payment Request

When you receive the email, click the secure link for the Payment Request. Use one of eWay test credit cards testing numbers to complete the payform and submit the payment.

Card Bank Payment

You should receive a green box confirmation

Card Bank payment

eWAY Test Cards

The Sandbox allows you to test any valid Visa/MasterCard credit card, however eWAY recommends the following test cards:

  • Visa 4444333322221111
  • MasterCard 5105105105105100

View Transactions in eWAY Sandbox

In your eWAY Sandbox account click on the Home tab.

eWay Transaction

Understanding the Response

If you receive any errors from eWAY, or for more information about the eWAY responses that are saved in the Chargent Transaction record in Salesforce, please see the eWAY Response Codes.

All the data in the Chargent Transaction record in Salesforce comes from eWAY (except for the Transaction name, beginning with TRX-000XXX, which is autogenerated). For more information please see the documentation on Chargent Transactions.

eWay Transaction Response

Complete any additional Salesforce configuration your organization requires

Once you are generating responses from eWAY and seeing the transaction records, you may wish to finalize other Salesforce configuration items, such as:

  • Email receipts from Salesforce and/or eWAY
  • Automated processes in Salesforce driven by transactions
  • Reporting
  • Other requirements of your organization

Sending Live Transactions from a Salesforce Sandbox

When Chargent is installed in a Salesforce Sandbox, transactions are typically sent to the payment gateway’s test / sandbox / development environment, regardless of whether Chargent’s Test Endpoint checkbox is checked. This is done as a security precaution, to prevent real transactions from being accidentally sent from a Salesforce Sandbox.

When Chargent is installed in a production or developer Salesforce org, checking the Test Endpoint checkbox on the Gateway record will route transactions to the test environments provided by the gateway.

Note: Some gateways use the same endpoint for live and test environments. For these gateways, the Chargent application does not prevent live transaction processing. As such, it is best practice to deactivate your live gateway records in orgs used for testing.

If you wish to send live transactions from a Salesforce Sandbox, as a final step in testing, simply use Chargent’s Endpoint Override field on the Gateway record, and enter the production endpoint of your chosen gateway there.

Here is the production endpoint URL for Chargent’s integration with eWAY:

Note that the full endpoint URL must be entered in the Endpoint Override field, and the domain must be present in the Remote Site Settings (for standard Chargent integrations it should be already present).

Going Live with eWAY in Salesforce

Now that you have tested the connection from Salesforce to eWAY, and completed any related configuration steps, you are ready to move into the production phase with Chargent and eWAY.

Go to the eWAY Sandbox gateway record you created earlier, and uncheck the Active field, or delete the record entirely if you choose.

Obtain your Live eWAY API Key and Password

  • Log into your MyeWAY account
  • Hover over the My Account tab at the top of the page, then click Get Connected.
  • Your API Key is already generated and available in the API Key field at the top of the page. You can simply click the Copy To Clipboard button to copy the API Key ready to be pasted into the Chargent Gateway record.
  • To get a password, click Generate Password. A password can only be viewed once after it has been generated, so be sure to copy it (you can use the same Copy To Clipboard button to copy it).

If you previously generated an API Key and Password through the ‘User Security’ section you can manage as follows:

  • Click on My Account and then go to User Security > Manage Roles
  • Enter a Role Name (such as “API Key”) and click Create New Role
  • Go Back to My Account > User Security > Manage Roles
  • Click on Security Role to assign the security role API KEY to the user you will create.
  • Complete all the required fields, including an email address that is NOT the login for MYeWAY, then click Create User
  • Select Actions on the left side of the new user
  • Click View API Key to see and copy the API key to use in Chargent
  • Be sure to use the Rapid API Key and NOT the Pay Now key.

eWay MyeWay

Add the Live Gateway record for eWAY in Salesforce based on either the Gateway Setup Wizard or version 5.40 or earlier instructions above.

Testing the Live eWAY Gateway

We recommend testing at least one real transaction to ensure everything is working correctly in Salesforce, and your merchant account is set up with your bank properly.

You can run a small transaction on your own credit card, and then Void it from the transaction record in Salesforce.

Please note that extensive testing is recommended for the eWAY Sandbox only, as transaction fees may be incurred in the Live environment.

chargent to eway

eWAY Order Source

eWay requires the Salesforce field Order Source to be set in order to process one time charges, or recurring billing using tokenization. For eWAY payments from Chargent, the Order Source field should be set to Telephone. This will send the transaction to eWAY as MOTO, which will allow the token and card information to be stored in eWAY. This allows the token to be used in place of the credit card.

eWAY Token Payments

Chargent supports eWAY Token Payments, which allows you to securely store your customer’s account number and other cardholder data with eWAY, and use an associated token in Salesforce for future payments.

PCI compliance scope is reduced since you are not storing the credit card numbers in Salesforce.

You can enable eWAY Token Payments manually if you didn’t already select that option when you initially set up your eWAY gateway.

  1. Go to the App Launcher and search for the Gateway Object.
  2. Select the Gateway Object and the eWAY gateway.
  3. Click Edit and set the following.
    • Check the Use Tokenization checkbox in the Chargent Gateway record you have set up for eWAY
    • Set the Credit Card Handling field (unless you are using Payment Console)
      • Never Clear: Chargent will not remove any card data automatically.
      • Clear After Successful Charge: Chargent will clear the credit card number, expiration dates and card security code only after a successful charge is run.
      • Clear After All Transactions: The credit card number, expiration date and card security code will be erased after any transaction (Charge, Void, Refund)
      • Clear When Token Present (Recommended): Only when a token is present in the token field, will the credit card number, expiration date and card security code be cleared.

The eWAY token is stored in Chargent’s Token field in Salesforce after your first successful transaction, and the credit card fields are handled as you specified in the preceding step.

Note that if you are using Chargent’s API, Payment Console or Payment Request, credit cards are never saved to Salesforce but are instead tokenized in memory.

Salesforce to eWAY Field Mapping

Here are some relevant fields and their mappings between the Chargent software in Salesforce and the eWAY system.

Salesforce Direction eWAY
Gateway ID < Transaction Number
Invoice Number > Invoice Reference
Order Information > Invoice Description
Salesforce record ID (of Chargent Order, Opportunity, or Case) > Your Reference Number

Congratulations! You have successfully integrated Salesforce and the eWAY Payment Gateway using Chargent. You can now process one-time or recurring credit card payments through eWAY directly from Salesforce.