Experimental project

This is a sandbox project, which contains experimental code for developer use only.

This module is supposed to create a (really) simple marketplace for Drupal Commerce.
commerce_paypal_simple module is used to transfer money using PayPal Simple Adaptive Payment API.
The payment method should not be used with the regular product order payments, It is just a place holder so that I can create payment transactions.
Payment process: The buyer pays the website, website pays the seller.

It provides an interface that allows the sellers to confirm that they've shipped the product for the buyer and specify shipping data that can be seen by the buyer.
When the buyer confirms receiving the product, a rule event is triggered and an action creates a payback order for the seller, then another action takes this order as an argument and creates a transaction using PayPal Simple Adaptive Payment API which transfers the money from the paypal account defined in the "Transfer payback order total to seller paypal account" Rules action to the paypal account of the seller (field_paypal_email of user entity).
You can use the Rules action "Transfer payback order total to seller paypal account" in a Drupal commerce
marketplace to transfer money from sender account (defined as rules action parameter) to the seller paypal
account (field_paypal_email on user entity).

Installation guide:

  1. Disable "User orders" view
  2. Install commerce_paypal_simple and commerce_payback modules
  3. Create a rule with "Buyer confirmed receiving the product" event and "Create payback order for the line item" and "Transfer payback order total to seller paypal account" actions.
    Sender email in "Transfer payback order total to seller paypal account" action must be identical to API_USERNAME of paypal configuration. Marketplace fee is a decimal number. 0.05 means that 5% of the order amount will be kept as marketplace fee and the remaining 95% will be transfered to the seller's paypal account.
  4. Grant "View own sell reports" , "View own purchase reports" , "View own orders" , "Change own commerce order status" in commerce payback section of permissions page to authenticated users (or whatever role that you want).
  5. commerce_paypal_simple module depends on PayPal Adaptive Payments NVP SDK.
    Download it from https://www.x.com/sites/default/files/PayPal_Platform_PHP_Nvp_SDK_0.zip
    extract it and copy php_nvp_sdk/Lib/ to sites/all/libraries/paypal .
    If you do this right, You'll find CallerService.php in sites/all/libraries/paypal/
    Now open sites/all/libraries/paypal/Config/Config.php and change the values of
    API_ENDPOINT (this is the server address, default value is sandbox, live server is https://svcs.paypal.com/)
    APPLICATION_ID (more info at http://www.wp-instantpay.com/application-id/ - no need to change this for sandbox server)
    DEVICE_IPADDRESS (no need to change for sandbox usage)

    according to your own config and save the file.

Project information