Dynamically assigning Payment gateway

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Carolharry
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Wed Dec 17, 2008 9:13 am

Dynamically assigning Payment gateway

Post by Carolharry » Tue Mar 17, 2009 12:29 pm

Hi All,

In this forum to implement multiple currencies charging,it was suggested to write custom payment gateways for each currency.
viewtopic.php?f=42&t=9477&p=40874&hilit=+carol#p40874

After doing this I am able to configure on in admin multiple gateways. But the code is taking the latest gateway that was added through the user interface.
Like I added Payflowpro USA
Payflow PRO UK
PayFlow pro AUS.
For all orders it's taking payflowpro AUS. How can I dynamically assign a payment gateway to the order.

For example. If order is from UK he is displayed all products prices in POUNDS. His order should pass through Payflow pro UK.

When the user is from UK by default Ablecommerce is choosing AUS gateway , bcz that 's the latest gateway added.
How to over come this. Please suggest. It's urgent.

Thanks a lot,
Carol

Carolharry
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Wed Dec 17, 2008 9:13 am

Re: Dynamically assigning Payment gateway

Post by Carolharry » Wed Mar 18, 2009 9:53 am

Can anyone reply to this post please. I am not finding source file where we can assign gateway dynamically.

Thanks a lot.
Carol

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Re: Dynamically assigning Payment gateway

Post by sohaib » Wed Mar 18, 2009 10:04 am

Payment gateways are linked to payment methods. The payment method that is used to make the payment will determine the payment gateway used. One way to handle your desired requirements could be to create separate payment methods for separate countries and then in the payment methods on checkout, only display the payment method that is applicable to the current user.
For example you can have two payment methods 'Visa' and 'Visa' (Yes you can have same name for multiple payment methods). Link first Visa method to a payment gateway that accepts USD payments. Link second Visa method to a payment gateway that accepts EUR payments.
On checkout page, do a little bit of customization to check which 'Visa' payment method you need to display.

Alternatively, what you are looking to do right now can also be done. That is dynamically assigning a payment gateway. In that case you will have the same payment method but just before the checkout you will set its payment gateway to your desired gateway. This customization will probably go in CheckingOut even in OnePageCheckout page. However I suggest not to use this approach. On high volume checkouts this could cause problem.

Carolharry
Commander (CMDR)
Commander (CMDR)
Posts: 121
Joined: Wed Dec 17, 2008 9:13 am

Re: Dynamically assigning Payment gateway

Post by Carolharry » Wed Mar 18, 2009 10:42 am

Awesome!....Thank you so much shohaib.

Appreciate a lot!

niall08
Commander (CMDR)
Commander (CMDR)
Posts: 175
Joined: Tue Dec 09, 2008 10:29 am

Re: Dynamically assigning Payment gateway

Post by niall08 » Thu Apr 23, 2009 2:21 am

But how do you pass the total cost of the transaction in the user's selected currency to the new payment gateway? Our primary currency is GBP and this is the amount passed regardless of the payment gateway (i.e. the payment gateway is hardcoded to use Euros, but the actual amount being passed is the GBP - meaning that the payment would be for far less than it should)??? Should the payment.amount be edited in the checkout code?

And, assuming the local currency amount can be passed, how does the admin reporting (e.g. Manage > Orders) and the user's receipt tally with this currency and amount??

I can understand the creation of hard-coded payment gatewatys etc, but the payment amount being passed is still in your primary currency.. AND the admin reporting is still in your primary currency too..

Post Reply