0

After an exhaustive online search, I can't find an answer to my problem: where do I place the code snippets PayPal provides to implement PayPal parallel payments in Drupal 7's Express Checkout module? I went to this site to find the code snippets to paste into my site's code, but unfortunately, I can't figure out what file to paste the code snippets into in the Express Checkout module. I've read all of the instructions on PayPal, and being a relative beginner at Drupal (and a total beginner at PayPal), I can't figure out what to do next.

I am trying to allow users of my website to buy downloadable files provided by other users. When they do so, I want to take a small commission for posting their materials on my site. I understand that chained payments is also an option people use for this type of scenario, but considering my inexperience with PayPal, I think that parallel payments is the better of the two options.

In case it matters, I'm working in PayPal's sandbox mode. I've downloaded the paypalplatform.php file and I think I'm supposed to upload this to the main Express Checkout folder (but I'm not sure?), and I understand how to get my sandbox API credentials from PayPal, but I'm pretty much clueless from that point on.

The two specific snippets I'm having trouble with are these:

1.) The one in step 3a, where the instructions say "Insert this code snippet into the section of your code that initiates the preapproval flow on your website." What code initiates the preapproval flow? Is it contained in a file in the Express Checkout folder somewhere? In which file is it located, and specifically, where in the code should I paste the snippet provided by PayPal?

2.) The snippet provided in step 4c, where the instructions say "Insert this code snippet into the section of your code that initiates a PARALLEL PAYMENT on your website." Again, where is this code located? Is it in a file in the Express Checkout folder? In which file is it located, and specifically, where in the code should I paste the snippet?

Any help anyone can give me would be much appreciated. Thank you.

1 Answer 1

1

The short answer is that there isn't just a place to "paste the snippet." That integration wizard is hopelessly simplistic. Support for a new payment method within Drupal Commerce would require more than simply adding code to a page, because presumably you'll want some sort of local record of any payment action taking place. For that to happen, you have to work with the Drupal / Drupal Commerce APIs as well.

In Drupal Commerce, these integrations are handled through payment method modules. We have documentation for writing them in the developer guide on DrupalCommerce.org. Additionally, if you're PayPal Express Checkout, you should switch to using the 2.x branch of the main PayPal project, http://drupal.org/project/commerce_paypal, as it has a complete implementation of the Express Checkout payment method and has been verified by PayPal.

2
  • Thanks for the quick response, Ryan! I'll take another look at the developer guide and switch back to using the main PayPal project. I'll let you know if I run into any issues.
    – Drupguy
    May 28, 2013 at 0:11
  • thanks for this sorry for my english well i want PayPal parallel payments in dynamic way i use token on receiver filed but its not working (token is from store entity filed ie paypal id ) well give me suggestion for that
    – Naveen
    Jun 25, 2016 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.