Active
Project:
Commerce Marketplace Paypal
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 May 2015 at 15:58 UTC
Updated:
25 May 2015 at 09:44 UTC
Jump to comment: Most recent
When using parallel payment with a fee for the marketplace, as expected, a new transaction to pay the fee is created if there is at least 2 stores (or orders) in the the cart.
But if you have only one store (or order) in the cart the new transaction is not created. It seem's that the standard PayPal WPS is selected to process the payment.
I attached the 2 PayPal payment pages to illustrate the 2 cases.
I'm currently searching where standard WPS and adaptive payments are selected... but I'm a bit lost and need some help...
| Comment | File | Size | Author |
|---|---|---|---|
| Paying one product from Marchand Neuf.png | 111.65 KB | cedric_a | |
| Paying two products from Marchand Neuf and Marchand Quatre.png | 100.45 KB | cedric_a |
Comments
Comment #1
maciej.zgadzaj commentedAh right, that actually works how it was originally planned, switch to Adaptive Payments only when the number of orders is greater than 1, otherwise stick to original WPS. But it's true, this way it won't work with commission for single orders...
To give you some background to how it works - Commerce Marketplace PayPal WPS switches PayPal API from standard WPS to Adaptive Payments when
$order->data['commerce_marketplace_payment_parallel']is set toTRUE.And it is being set to
TRUEin commerce_marketplace_payment_redirect_pane_checkout_form(), but only if the number of orders is higher than one.So I guess for the moment your best bet would be to alter checkout redirect form and add that extra property to the order there.
I might add some extra configuration option later on to Marketplace WPS for force using Adaptive Payments even if there is only one order being checked out.
Comment #2
giorgio79 commentedFantastic, look forward to this feature (or bug fix) :).
I am looking for adaptive payments all the way including orders with a single item. Found this dated solution as well https://github.com/amitaibu/commerce-paypal-chained
Comment #3
giorgio79 commentedAnd another one whose code could be used :) https://www.drupal.org/node/2082691
Comment #4
cedric_a@giorgio79 you should try the Commerce Marketplace PayPal module, the fees are working with chained payments, my issue is about parallel payments only.
@maciej.zgadzaj Thank you for the help, following what you said, I'm now blocked by the lack of the adaptive payment settings :
Notice : Undefined index: marketplace_adaptive dans commerce_marketplace_paypal_wps_adaptive_get_paykey() (ligne 129 dans .../modules/commerce_marketplace_paypal/modules/wps/commerce_marketplace_paypal_wps.adaptive.inc).How can I load these settings properly in the form ?
Here is my code for now :
Comment #5
cedric_aI found where 'marketplace_adaptive' settings are reseted from the form, see my comments cedric_a below :
The 'if' statement is maybe not sufficient for the parallel payment with a fee now ?
Should we add
&& commerce_marketplace_order_count($orders) > 1