Add-ons and ModulesPayPal Express Checkout PSP

PayPal Express Checkout PSP

Sana Commerce 8.1
Your provider

Configure a Test PayPal Express Checkout Payment Module

In order to add the PayPal Express Checkout Payment Module to a project, please undertake the following steps:

Step 1: Copy the 'Sana.Commerce.Payment.PayPal.ExpressCheckout.dll', 'Sana.Commerce.Payment.PayPal.ExpressCheckout.pdb' and 'Sana.Commerce.Payment.PayPal.ExpressCheckout.xml' files from the PayPal release to the 'Frontend/Bin' folder of Sana Commerce.

Step 2: Configure the Sana Commerce frontend to use the PayPal Express Checkout payment module. This configuration is performed in the Starter Site's 'web.config' file:

  • Locate the 'PayPal Express Checkout configuration section.txt' file, which contains the PayPal Express Checkout payment module configuration section.
  • Copy the whole text of this file into the <payment-configuration> section of the 'web.config' file, so it will look as follows:
<module name="PayPalExpressCheckout" type="Sana.Commerce.Payment.PayPal.ExpressCheckout.ExpressCheckoutPaymentModule, Sana.Commerce.Payment.PayPal.ExpressCheckout">
  <settings>
    <clear/>
    <add name="IsFramed" value="false" isRequestParameter="false" />
    <add name="ResponseUseXml" value="false" isRequestParameter="false" />
    <add name="ResponseUsePost" value="false" isRequestParameter="false" />
    <add name="DebugDomains" value="localhost" isRequestParameter="false" />
    <add name="DebugConfirmUrl" value="checkout/PaymentConfirm.aspx?id={0}" isRequestParameter="false" />
    <add name="IpCheck" value="216.113.191.110|216.113.191.33|173.0.82.105|127.0.0.1" isRequestParameter="false" />
    <add name="FailurePage" value="checkout/orderfailed.aspx?id={0}" isRequestParameter="false" />
    <add name="PaymentPage" value="https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout" isRequestParameter="true" />
    <add name="ApiEndpoint" value="https://api-3t.sandbox.paypal.com/nvp" isRequestParameter="false" />
    <add name="USER" value="…" isRequestParameter="true" />
    <add name="PWD" value="…" isRequestParameter="true" />
    <add name="SIGNATURE" value="…" isRequestParameter="true" />
    <add name="RETURNURL" value="checkout/ordersubmit.aspx?id={0}" isRequestParameter="true" />
    <add name="CANCELURL" value="checkout/ordercancelled.aspx?id={0}" isRequestParameter="true" />
    <add name="NOTIFYURL" value="checkout/paymentconfirm.aspx?id={0}" isRequestParameter="true" />
  </settings>
</module>
For an explanation of these configuration values, please read this chapter and the chapter 'PayPal Express Checkout Specific Configuration Values' below.

Step 3: Configure the PayPal Express Checkout payment method. There are two ways to do this:

  • Configure the PayPal Express Checkout payment method in the backoffice. For more information read this chapter.
  • Configure the PayPal Express Checkout payment method by running the 'ConfigurePayPalExpressCheckoutInDB.sql' SQL script in the Sana Commerce database.

    The 'ConfigurePayPalExpressCheckoutInDB.sql' SQL script will add the 'PayPal' payment method.

    This payment method will be available for all countries configured in the system. No translations for the payment method will be set by this script - this should be done manually. After the script has been run, all fields should be checked for the correct values.

    Before running the script make sure that you have changed the '@siteId' variable (if needed) to match the appropriate website identifier.


Step 4: Create a PayPal Sandbox account at developer.paypal.com. This will create a sandbox environment to test Express Checkout.

Step 5: Create a preconfigured seller account in the sandbox environment under the 'Test Accounts' menu.

Step 6: Modify the USER, PWD and SIGNATURE configuration values to the user, password and signature of the sandbox seller account, which can be found under the 'API Credentials' menu.

Step 7: Create one or more (preconfigured) buyer accounts in the sandbox environment under the 'Test Accounts' menu. These accounts can be used to make test payments in the sandbox environment.

Step 8: Customize the look and feel of the Express Checkout pages. This can be done by logging in with the seller account at sandbox.paypal.com and configuring custom styles under 'My Account -> Profile -> Custom Payment Pages'.

In order to receive feedback from PayPal via the Instant Payment Notification (IPN) service, it must be enabled for the seller sandbox account:

Step 1: Log in with the seller sandbox account at sandbox.paypal.com.

Step 2: Click on 'Profile' under the 'My Account' tab.

Step 3: On the 'Profile' page, go to 'Instant Payment Notification Preferences'.

Step 4: Click on 'Choose IPN Settings' and enable IPN. The Notification URL has to be entered, but won't be used, so the value does not matter.

In order to test the payment flow in the development environment, there are two possible scenarios:

  • The development machine/server cannot be accessed externally by the PayPal IPN server (most common scenario). In this case add all domains used by the development server in the 'DebugDomains' setting in the Starter Site's 'web.config'. Multiple domains can be separated by the ',' character.

    These settings will make it possible to test the whole flow of a test payment, when the confirm page cannot be reached by PayPal. These settings are for the debugging purposes only and should not be used in any live situation.

  • The development machine/server can be accessed externally by the PayPal IPN server. In this case you can configure PayPal to test the payment flow. Remove the 'DebugDomains' setting from the payment module configuration.

    If there are problems with the PayPal Express Checkout payment module make sure that URL which you use as the IPN callback (NOTIFYURL) is on port 80 (or port 443 if you have an SSL certificate installed) and is publically accessible and exists within a firewall that does not prevent PayPal from connecting with it.


  • Test the payment/checkout flow to see if everything works, using the newly configured payment methods and the correct payment statuses that are set.
Add-ons and ModulesPayPal Express Checkout PSP