Interchange

PayPal Pro Payments Module

Overview

PayPal’s Website Payments Pro solution offers an alternative to traditional credit card transaction processing, coupled with the ability to accept PayPal payments using the “Express Checkout” feature.

Prerequisites

  • SOAP::Lite
  • PayPal Developer Account (sandbox)
  • Full rights to the Interchange installation and configuration directories

Integrating with Interchange

Normal credit card transactions (Visa, Mastercard, Amex, and Discover) can be accomplished with the PaypalPro.pm PERL payment module installed in the Interchange lib/Vend/Payment directory.

Express checkout transactions must be used with normal card processing as part of the PayPal merchant agreement (see the PayPal Integration guide for rules on placement and operation). This is treated as a separate payment method, with its own unique entry in order.profile. The UserTag paypal_api.tag communicates with the PayPal API to set the transaction parameters and read responses. The file payment.html can be used for this.

Configuration & Testing

  1. Download the files (at left) and install PaypalPro.pm in lib/Vend/Payment directory, and paypal_api.tag in the global usertag directory.
  2. Reqest a PayPal certificate, if you have not already. Also, under “Website Payment Preferences” for your PayPal account, ensure the contact telephone number is required.
  3. Copy the PayPal SSL certificates into a directory readable by the user that runs Interchange, such as /var/lib/interchange
  4. Edit the interchange.cfg file, adding the line:
    Require module Vend::Payment::PaypalPro
  5. Edit the catalog.cfg file, adding the following (set sandbox and PAYPAL_TEST to 1 for testing with the sandbox and of course use your assigned API username and password):
    Route  paypalpro        user            "test_api1.testdomain.com"
    Route  paypalpro        secret          "password"
    Route  paypalpro        keyfile         "/var/lib/interchange/paypal_cert.pem"
    Route  paypalpro        sandbox         1
    
    Variable        PAYPAL_KEY      /var/lib/interchange/paypal_cert.pem
    Variable        PAYPAL_USER     test_api1.testdomain.com
    Variable        PAYPAL_PASS     password
    Variable        PAYPAL_TEST     1
  6. Setup an order profile in etc/profiles.order as follows:
    __NAME__                            paypal
    
    __COMMON_ORDER_PROFILE__
    
    &fatal = yes
    email=required
    email=email
    
    &set = prof_mode_accepted [var PAYPAL_ACCEPTED]
    prof_mode_accepted=required This site doesn't accept paypal orders.
    [cgi set="" name=no_paypal_token]
    [if !scratch paypal_token]
    no_paypal_token=mandatory Please login to PayPal using the Login button.
    [/if]
    &set=mv_payment PayPal ID [scratch paypal_payerid]
    &final = yes
    &setcheck=mv_email [value email]
    
    __END__
  7. Edit etc/log_transaction for some processing for the paypal order profile:
    [elsif value mv_order_profile eq paypal]
    	[tmp paypal_ec_result][paypal_api
    		token="[scratch paypal_token]"
    		action="dorequest"
    		invoiceid="[value mv_order_number]"][/tmp]
    	[if scratch paypal_ec_result]
    		[set paypal_token][/paypal_token]
    	[else]
    		PayPal transaction FAILED.
    		[calc]
    			die errmsg(
    				"PayPal charge could not be completed. %sn",
    				errmsg($Session->{payment_error}),
    				);
    		[/calc]
    	[/else]
    	[/if]
    [/elsif]
  8. Copy the payment.html file into the pages/ord directory and edit settings as needed. Add the “paypal” payment option to the checkout page.
  9. Foundation-based stores will need to change the global variable MV_PAYMENT_MODE to paypalpro
  10. Test using the PayPal sandbox.

9 Responses to “PayPal Interchange Module”


  1. 1 Bill August 24, 2007 at 1:54 pm

    I’m receiving errors when attempting to download the Paypalpro.pm, paypal_api.tag, and payment.html files mentioned in this article.

  2. 2 enlilmeta December 11, 2009 at 5:45 pm

    Lots of folks write about this topic but you said some true words.

  3. 3 www.rebelmouse.com February 12, 2014 at 11:49 pm

    It’s appropriate time to make some plans for the future and it is time to be happy.
    I have read this post and if I could I want to suggest you some interesting things or advice.
    Perhaps you can write next articles referring to this
    article. I wish to read even more things about it!

  4. 4 amazon July 4, 2018 at 1:21 pm

    With havin so much content and articles do you ever run into any problems of plagorism
    or copyright infringement? My blog has a lot of unique content I’ve
    either created myself or outsourced but it appears a lot of it is
    popping it up all over the web without my authorization. Do you know
    any solutions to help reduce content from being stolen?
    I’d truly appreciate it.

  5. 5 touran December 1, 2018 at 8:50 am

    For more info around the new Chrysler Lifetime Powertrain Warranty customers may visit , , and .
    Your local mechanic might not understand how you desire your car
    or truck modified, in order that is the reason it is necessary that you can look for
    your individual parts. Auto industry analysts assert the automaker has to keep coming track of vehicles such
    as the Astra, Antara, and Corsa to fit the current lineup.

  6. 6 branding and marketing agency February 23, 2019 at 8:44 am

    Start calling them up today making your company rise in almost no time at all.
    We’ve witnessed many a company meltdown as a result of
    lowered barriers to entry. Unless you manage a large umbrella company, your brand needs to be specific.

  7. 7 Betsy September 11, 2019 at 2:09 am

    Some truly prime posts on this site, saved to bookmarks.


  1. 1 dissertation in mba finance Trackback on July 19, 2021 at 1:08 am
  2. 2 http://thesis-1996.somee.com/edit-my-essay/page-207-2021-06-02.html Trackback on July 20, 2021 at 8:51 am

Leave a comment




Topics