Creating a New Payment Method

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
I'm a .Net Developer and I want to develop a couple of payment methods that are currently not supported by NOP Commerce. Specifically Elevon (Nova). I have been looking around the forum but I was unable to find any information on the process of creating a new payment method. I have been muddling around the code on my own, but I was curious if I could get my hands on any documentation to speed up my development time.

John
14 years ago
Hi John,

The best thing to is to write a simple application first to test sending transactions to your payment gateway and understanding how to handle the response.

Next you can then set up your project in the same way as the others.

> Expand the Payment solution folder and create a new C# class library project
> Name your project Nop.Payment.PaymentGatewayName (e.g. Nop.Payment.PayPal)
> Delete the default class that is created in the project and create a new one named YourPaymentGatewayNamePaymentProcessor i.e. PayPalPaymentProcessor.
> Make your class implement IPaymentMethod (you will need to add references to Nop.BusinessLogic and probably Nop.Common)
> In Visual Studio you can right click the interface name and select implement interface. This will create all the method stubs for you.

Generally you will have two types of integration

1. A fully integrated payment processor where you take the credit card details on your store and then securely transmit the details to your payment gateway
2. A redirect payment processor where the customer is redirected to another site to complete the transaction.

For type 1 you are mainly concerned with the ProcessPayment method. This is typically where you take in the paymentInfo object, send off the request to the payment gateway, get a response and return a result. Have a look at the AuthorizeNet example for this.

For type 2 you are mainly concerned with the PostProcessPayment method. Here you will typically build up some parameters to pass to the payment gateway during the redirection. Normally you will also need to create some notification pages (I prefer to create httphandlers) on your site that your payment gateway will redirect the customer to and these will update your order status. Look at the PayPal Standard implementation for this type of processor.

Providing you can get a working example together outside of nopCommerce then really its just a case of adapting it to fit nopCommerce.

Hope this helps

Ben
14 years ago
That helps greatly. Thanks as I begin to implement the new payment process I'll leave some notes on this thread.
13 years ago
I'm trying to do this as well..

It's a bit daunting!


As far as I understand it, a payment gateway is composed of the following


/returnfile.aspx   -  Route directory page to deal with payment provider response

/templates/payment/paymenttemplate.ascx  -  template for inputting payment details

/administration/payment/configure.ascx   -  configuration options page for admin backend

(source code only) /Payment/Nop.payment.Myprovider/paymentprocessor.cs  - the actual payment processing code


I'm not exactly sure what the best procedure is to create all this and have it registered within the project and all the appropriate namespaces created...  

I'd LOVE some documentation right now :(

For the record I'm trying to hook it up with Barclays EPDQ
13 years ago
Have you looked at this for an Elevon solution?

https://www.internetsecure.com/Elavon/ShowPage.asp?page=SCAN&q=7
13 years ago
Hi,

I am evaluating the credit card payment processing for my site. Elavon via Costco seems to be a very cost effective way to process credit cards.

Guys, nay more details on your integration with Elavon. Could you please post more details. I am developing my own site, so need help or direction.

Thanks,
13 years ago
I am not sure if anyone has had success with an Elavon payment method as nobody has posted one yet. I have been using Elavon via Virtual Merchant for a few years with no complaints and I would like to stay with them.

I have recently been in contact with a developer (from the forum) in hopes that they can create the payment method. I am just awaiting a reply. I am sure we are not the only ones in search of a payment method for Elavon!
13 years ago
Mike C,

Thanks for the reply. Please keep us posted on the latest on this. It will be very helpfull to have a module for Elavon made available for payment processing.

Regards,
13 years ago
I WANT TO ASK 2 QUESTIONS

1- WHEN I WRITE CODE FOR PAYMENT , MUST I COMPILE SHOP SOLUTION ALL OR JUST COMPILE PAYMENT IS ENOUGH ?

2- IN , TEMPLATES/PAYMENT/MYMETHOD/XXX.ASCX FILES ARE automatically created or we create manually ?
13 years ago
Payment modules are projects on their own.
Copy and paste one that is there then modify it.
Built that project. Then go back to nop project
Add new reference for payment module in website.
Add in templates, etc same as one you copied and edit.
A
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.