You are here: Order System > Checkout Process > Payment Processing > Creating a PayPal PayflowPro Credit Card Provider

Creating a PayPal PayflowPro Credit Card Provider

Setting Up the Paypal PayflowPro Credit Card Provider

This guide shows how you can implement PayflowPro in EPiServer Commerce and also provides general tips which will help in implementing any custom payment gateway.

1. Download the following projects, PaypalProvider and PaypalConfiguration from this zip file: PayPalProvider.zip

Include them in your solution.

2. Get a trial version of the nSoftware at http://www.nsoftware.com/download/paypal.aspx (you will need a license).

3. Fix any reference issues with the new psmurojects. You will need to point to your own ecf/nsoftware dlls:

For the PaypalConfiguration project:

For the PaypalProvider project:

6. Add a reference to both of the new projects to the admin and front end interfaces.

7. Create a new folder in the admin project Apps/Order/Payments/Plugins/ folder called "PayPal".

8. Copy the ConfigurePayment.ascx from the admin folder of the PaypalConfiguration project (and *not* the corresponding .ascx.cs and .cs.designer files) into this new folder. This will provide the admin configuration for Paypal instances.

9. Create a new folder in the front end project in the [Theme]/BusinessControls/CheckoutControls/plugins/payment called "PayPal".

10. Copy the PaymentMethod.ascx file into this new folder. This creates a place in the checkout process to enter information about a credit that will be processed by the paypal provider.

Step 10 assumes you are using the checkout design or at least the payment provider method used in the default site provided by Mediachase to access the EPiServer Commerce API and checkout workflows. Most developers will create their own custom checkout. In this case, the important thing to know is that its simple purpose is to collect credit card information and provide it back to the checkout process to add a payment to the Cart instance. When you are creating your own checkout and adding the functionality where payments are added to the cart, the Payment instance has two fields relating to your Paypal payment method that need to be set based on back end configuration: PaymentMethodId and PaymentMethodName.
The first is the PaymentMethodId from the PaymentMethod db table that corresponds to the PayPal provider. The second is the SystemKeyword field from the same table row. This information can be retrieved using the Mediachase.Commerce.Orders.Managers.PaymentManager object.
See an example of these approaches in the following two places in the B2CSampleSite SDK site:
/Templates/Everything/BusinessControls/CheckoutControls/CheckoutPaymentModule.ascx.cs, OnInit method..CheckoutWizard.ascx.cs, OnNextButtonClick method.

11. Compile the solution.

12. Open the Commerce Manager instance for this code base.

13. Go to Administration/Order System/Payments/Language.

14. Click New for Payment Methods.

15. Specify the following properties and then press OK:

You can leave the rest of the settings to their default values.

16. If you are using the checkout wizard provided in the B2CSampleSite, you will now see the paypal provider as a payment option during checkout. However, you will not be able to complete a checkout with a PayPal payment because the PayPal account configuration is not done yet.

17. For testing purpose, you will need to setup a PayPal test account. The directions for this are provided at nSoftware here http://www.nsoftware.com/kb/showentry.aspx?entry=04010501

These directions are slightly out of date with the revised Paypal interface/option, below are some additional tips.

Testing Your Implementation

The PayPal Test Environment is located here: https://developer.paypal.com/us/cgi-bin/devscr?cmd=_sandbox-acct-session (you must be logged in)

Make sure to setup the account as a PayPal Pro account and note the following:

Directions for Setting Up a Test Credit Card

  1. Log in to your Sandbox Account.
  2. Click Profile.
  3. Click on Credit Cards under Financial Information.
  4. Click the Add button, as if you are adding a credit card to the account. Use the credit card number that is automatically generated here as the credit card of your buyer.

Do not click on the Add Card button as this will add the credit card to your Sandbox account. If it is added to your Sandbox account, it cannot be used to make a non-PayPal account payment.

A list of error codes relating to the PayPal provider transaction can be found here: https://cms.paypal.com/uk/cgi-bin?cmd=_render-content&content_ID=developer/e_howto_api_nvp_errorcodes&bn_r=o

Test Within Commerce Manager

Once you have setup your test environment and test credit card, go back to Commerce Manager and re-open the new payment method you created earlier.

Go to the Parameters tab and provide the ID and signature created with your test Paypal account. For the Processing URL, specify "https://api-3t.sandbox.paypal.com/nvp".

Once you press OK, you are successfully setup and you should be able to begin submitting test Paypal transactions.

Additional Resources

There are a number of payment provider options available for EPiServer Commerce. Find out more about these options in the following sections of this documentation:

This Paypal provider is set up to work for the US. This is only because the country code in EPiServer Commerce does not match the ISO 3166 code list used by Paypal. The class PayPalCountryCodeLookup in the Paypal provider provided above allows you to easily map the country codes you would like to be able to use. The EPiServer Commerce country codes can be found in the Country table. A lookup reference for country codes can be found here: http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=39718.

 


Version: EPiServer Commerce 1 R2 SP2| Last updated: 2012-06-29 | Copyright © EPiServer AB | Send feedback to us