Custom Gateways

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
hawkeye
Ensign (ENS)
Ensign (ENS)
Posts: 12
Joined: Fri Apr 23, 2010 7:54 pm

Custom Gateways

Post by hawkeye » Wed May 19, 2010 1:02 pm

Hello,

I found this on the forums from awhile back
viewtopic.php?f=47&t=5926&start=25
sohaib wrote:Payment gateways that depend on call-back notifications require some extra work. They are not as straightforward to implement as the ones that support direct processing.

During the checkout control needs to be transferred to the payment gateway sites that work using call-back notifications. Once the payment is completed on the payment processor's web site the control is returned back to a page on your store.

So you basically need to do two more things
- Write code that transfers the control during checkout to the payment provider's website.
- Write a page or pages in your store that receives call-backs from your payment provider.

In order to write a code that transfers control to the payment processor during checkout the proper way to do it is to create a new payment method (say My-CustomPaymentGateway-Method) and write a corresponding payment form control for that payment method. See controls in Website/Checkout/PaymentForms for examples. Your payment form should display whatever is appropriate for making payment using your processor and once the user chooses to make payment using this processor, transfer the control to the processors web-site along with all the parameters that are required. Once the payment is completed by the user on the processors web-site the processor will send notification back to your store on a URL that you would have configured.

The second part is to write the code that handles the call-back notifications from your processor. You can write a new page for this purpose or you can make appropriate modifications in some existing page.
I did what was mentioned above, creating my own payment form. The form redirects the user to the the payment processors page, and then I have another page waiting for a response. However, I'm not inheriting from AC Payment Gateway class at all, and I'm wondering how it would even fit in with this scenario and if it's even necessary. I looked at PayPal but I don't want the client to be redirected on the receipt page but as soon as the choose to pay with the selected method. The main reason I didn't use the AC gateway code was because I have to send the request using a separate form with hidden values and I didn't see how this would fit in with the AC gateway code. So, I guess my questions are what have others done in this scenario and is it really necessary to use the AC gateway code?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Custom Gateways

Post by mazhar » Thu May 20, 2010 5:56 am

Well for payment gateway integration where you need to redirect the customer to provider pages you are not exactly required to make use of AbleCommerce gateway code. Although I think making use of AbleCommerce gateway code will be helpful because you can configure different settings via merchant panel. For your integration you can make use of AbleCommrce gateway code, all you required is to specify None for supported transactions means that it will not support any transaction. This means it will be only able to collect settings from user no actual processing at all. You can put your custom methods in same file as well where you can build and return hidden forms etc. Most probably it could be some that take an order object build the hidden form and then will redirect it to URL that might be a setting configured by user.

hawkeye
Ensign (ENS)
Ensign (ENS)
Posts: 12
Joined: Fri Apr 23, 2010 7:54 pm

Re: Custom Gateways

Post by hawkeye » Thu May 20, 2010 10:16 am

thanks Mazhar

oa2a
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Wed Oct 01, 2014 7:12 am

Custom Gateway not being detected

Post by oa2a » Mon Oct 20, 2014 6:59 pm

Hello,
I followed the instructions by creating a new custom gateway, compiled the class and added the .dll to the bin folder of the Ablecommerce website. However it is not showing on the Add Gateways list through admin site. Attached is is the custom gateway code that I am trying to use. Please advise what is missing and how to correct it. Thanks in advance.

Post Reply