X-Cart:EWay - Hosted payment
eWAY is the leading Internet payment gateway provider operating in Australia, New Zealand, United Kingdom and Europe. eWAY connects your website directly to your bank to process your customers online credit card payments instantly. Allowing your business to securely trade 24/7 all over the globe, truly automating the website payment component of your business.
Obtaining an eWay Account
If you have not registered an account with eWay yet, you should do it before you start setting up eWay in X-Cart. To open an account, go to the eWay website at https://eway.secure.force.com/join/SignUpInfoUK and follow the instructions on the screen. After you have registered an account, you can set up eWay in the X-Cart Admin area.
Setting up eWay
To use eWay as one of the payment options in the store:
- Log in to the X-Cart Admin area.
- Go to the Payment methods section (Administration menu -> Payment methods) and scroll down to the Payment gateways form.
- Select eWay from the drop-down list and click the Add button.
After you have clicked on Add, eWay will be added to the list of the available payment methods.Note: If you set up a payment method providing online credit card payment processing and do not intend to process credit card payments manually, you should disable the default "Credit Card" payment method, that requires manual payment processing, by unselecting the check-box next to the payment method's name. Additionally, you can change the default "Credit Card" payment method's name to "Credit Card (offline)", and change the online payment method's name to "Credit Card". This will help you to avoid any confusion between these two payment methods.The $store_cc variable in the config.php file must be set to false in case you disable the default 'Credit Card' payment method and do not intend to process credit card payments manually.
- Click on the Configure link. This opens the configuration page for eWay.
- Adjust the configuration settings for eWay and click the Update button to apply the changes.
- Return URL: The URL to which eWay must land customers back to X-Cart after a payment has been processed.
- Instance ID: Enter the name of your merchant account with eWay.
- Currency: Choose the currency in which you wish to accept payments through eWay.
- Test/Live mode: Choose the mode in which the gateways must operate.
The "test:approved" mode means that you can submit test orders and perform test transaction, and all the transactions will always be approved by the eWay test environment. The "test:declined" mode means that you can submit test orders and perform test transaction, and all the transactions will always be declined by the eWay test environment. In both modes money will not be withdrawn from credit cards.
The "live" mode is the full functioning mode with real transactions and charges. It must be used when only you are ready to go live.
- Automatically redirect back to the store: Choose Yes if your customers should be forced to return to your store automatically, or choose No if customers should be able to return to the store manually by clicking a special button on the side of eWay.
- Order prefix: Enter a prefix that will be automatically added to IDs of orders placed in your store and paid through eWay.
Having a prefix ensures that orders will have unique IDs and will never coincide with orders placed in another online store of yours that also uses eWay as a payment option.
- Return to the list of payment methods and activate eWay by selecting the check box next to the gateway's name.
- Click the Update button.
- Adjust the configuration setting in the eWay back-office.
- Log in to your eWay account at http://www.eWay.com/support/admin/.
- Click on Configuration options link opposite your Installation ID.
- Select the following check boxes: Callback enabled? and Use callback response?.
- Set the Callback URL http://www.example.com/xcart/payment/cc_eWay.php replacing the http://www.example.com/xcart/ part with the true URL of your X-Cart store.
After you have configured and activated the gateway, your customers will be able to choose eWay as a payment option.
1) Мodify the '<xcart_dir>/payment/cc_eway_uk.php' file:
- find this line:
$url = 'https://www.ewaygateway.com:443/Gateway/UK/Results.aspx?'; . func_http_build_query($post);
- and change it to:
$url = 'https://au.ewaygateway.com:443/Result/?'; . func_http_build_query($post); // for Australian merchants
- OR change it to:
$url = 'https://nz.ewaygateway.com:443/Result/?'; . func_http_build_query($post); // for New Zealand merchants
- also, find this line:
$url = 'https://payment.ewaygateway.com:443/Request/?'; . func_http_build_query($post);
- and change it to:
$url = 'https://au.ewaygateway.com:443/Request/?'; . func_http_build_query($post); // for Australian merchants
- OR change it to:
$url = 'https://nz.ewaygateway.com:443/Request/?'; . func_http_build_query($post); // for New Zealand merchants
2) Update the payment method name in the database - execute the following SQL-query:
UPDATE xcart_ccprocessors SET module_name = 'eWay - Hosted payment' WHERE module_name = 'eWay UK (Hosted payment page)';
Use phpMyAdmin utility supplied by your hosting company, or "Patch/Upgrade" utility in X-Cart admin back-end to do it.
3) Go to your X-Cart admin back-end, "Payment methods" page, disable the older "eWAY - Shared payment" payment method.
4) Add, configure and enable the newer "eWay - Hosted payment" payment method.