Setup Ucommerce to Include PayEx as a Payment Method
Ucommerce comes with built-in support for PayEx payments. This guide will walk you through getting Ucommerce to work with PayEx for payment processing.
Authorization, acquire (capture), refund, or cancel (void) are available for all plans with PayEx.
Settings in Ucommerce
Add a new payment method, under “Ucommerce –> Settings –> Orders –> Payment Methods”. You can call it whatever you like, here I have used “PayEx”.
Click the newly created node and select “PayEx” in the Service drop down list. Fill out the rest of the required information, like where it’s available from under the “Access” tab, pricing and the language tabs. When you are done click “Save”.
That’s everything in the Ucommerce interface.
Settings in PayEx Merchant Admin Panel
Changes needed in the PayEx Merchant Admin, so it will work with Ucommerce.
Ip filter
-
Click ”Merchant profile”.
-
Type in the external ip address of the webserver running the shop.
-
Click “Save”.
Merchant access list
-
Click “Merchant access list” in the menu to the left.
-
Click the “PxOrder.PxOrder” link, so it will be expanded and make sure the following is checked. If they aren’t checked, please contact PayEx support and get them to do it.
· Cancel2
· Complete
· Capture3
· Credit3
Editing the PayEx.config File
Now we need to edit the PayEx.config file.
You will find the PayEx.config file in the following location, where “rootdir” is the directory on the computer where you installed Umbraco: “rootdir\umbraco\UCommerce\Configuration\PayEx.config”. Usually “rootdir” is c:\inetpub.
Some of the below information are found in the PayEx Merchant Admin, so start by logging in you aren’t already.
Finding debug
If set to “True” you will be prompted to click a button before posting the information to “PayEx” otherwise it will do an autosubmit using Javascript. When running in production, you will want this set to “False”.
Finding testMode
This will most likely be a “False” unless you are using a test account.
Finding callbackUrl
Leave this at “(auto)” if in doubt.
Finding acceptUrl
Url the user is returned to after successfully authorizing her credit card.
Finding cancelUrl
Url the user is returned to if she cancels a purchase.
Finding accountNumber
-
Click “Merchant profile”.
-
Copy the “Merchant account” number.
Finding key
The Md5 key is created in the administration panel.
-
Click “Merchant profile” in the menu to the left.
-
Click “New encryption key”.
-
Copy the encryption key.
-
If you click “Save encryption key”, please note that it will overwrite the old one. It’s not possible to get the old key from the admin interface, so keep it in a safe place.
Executing a Pipeline on Callback
Running a pipeline once payment is authorized can be helpful if you need to complete the order once the customer returns to your site.
To run a “pipeline” once the callback if received and processed, you need to modify the database. If you used the name “PayEx” for the payment method name, you can run this SQL query in the SQL Server Management Studio.
UPDATE Ucommerce_PaymentMethod SET Pipeline = 'Checkout' WHERE Name = 'PayEx'
or just edit it manually in SQL Server Management Studio.
Now the default piplline that comes with Ucommerce will be run after each successful callback. This sets the Basket to an Order, gives it an OrderNumber, and other things.
Optional: Enable Acquire, Cancel, and Refund in Ucommerce Back Office
To be able to acquire, cancel, and refund payments you need to enable two pipeline tasks in the ToCompletedOrder pipeline and ToCancelled pipeline.
The pipeline configuration is found in /umbraco/ucommerce/pipelines.
ToCancelled.config
ToCompletedOrder.config
FAQ
· Test mode – Make sure test mode if turned off when going live.