Tags/topics: 
2
Answers
Vote up!
0
Vote down!

using the cart to have two different payment flows

I have 2 sections on a site that I would like to use drupal commerce for.

1. The reward section: in this section, a user earns points (userpoints module) for various actions. These points can be redeemed for rewards whose price is also displayed in points.

2. The donation section: there is a listing of 1. charitable projects & 2. charities. A user can donate a variable amount to either.
These donations would have to be collected using a payment gateway.

My question is:

1. would it be possible to define a completely different flow for each situation so that a donation cant be done using points and vice versa. so, when a user puts a reward into the cart, the payment is done using points. when a user clicks on the 'donate' button, the payment is done with a gateway and there is no overlap.

2. is there any problem that can be anticipated ?

Asked by: Alan Lobo
on September 24, 2014

2 Answers

Vote up!
0
Vote down!

Alan,

Since all payment options run through the Rules system to be displayed, if there's a condition here that would work, then you could potentially make your payment gateways appear / disappear:

It appears to me that you could use the condition "Order contains products of particular types" to change the visibility of the payment options.

STEP BY STEP: To change your payment option visibility

1. Navigate to /admin/commerce/config/payment-methods

2. Click Edit

3. Click "Add Condition"

4. Profit.

Josh Miller
Answer by: Josh Miller
Posted: Sep 24, 2014
Vote up!
0
Vote down!

Thanks a ton Josh.

it worked like a charm. I now have two flows depending on the contents of the cart.

Answer by: Alan Lobo
Posted: Sep 30, 2014