Alter order amount based on payment method

How can I alter the order amount after user selects a payment method?
I've been looking really hard in api reference but couldn't manage

Posted: Jan 14, 2012


rfay Randy Fay on January 17, 2012

I don't think we have a good way to do this yet. It's the same problem as an order-level discount. There are lots of things that need this. A custom line item with a small bit of code would allow providing the fee.

cogno on February 26, 2012

I'm looking for the same thing; sounds like I've got awhile to wait if the API doesn't even support it yet. Anyway, for reference, drupal.org/project/uc_pma is the Ubercart analogue, but it would be awesome if DC had this too.

I'd donate cookies to someone if they'd work on this.

EDIT: It's been suggested that I can just use Rules for this, but have no idea which event to build my rule around, or even what strategy is best to employ to make this happen... Suggestions?

Jeff Purtle on March 29, 2012

I need help with this exact issue too.

I posted two similar questions and hope you could easily answer it.

My Event Registration page is almost done except for price adjustment with Rules.

For example, on that page the 6 items under "Conference Fee: $250" are SKUs that total $337.

I believe I am very close except for my desired action to subtract only $87 from the total.

It needs to be a flat amount and not a percentage or amount off the unit price of each item. I need the set amount so that if other items are added to the cart it won't take off money from those items. I want it to show a "Discount" amount between the Subtotal and Total.

I have watched a bunch of videos on Rules and DC and think it should be possible. But, I don't know how or what I am missing.
Do I have to do something with an entity? Or, create a new line item type for a discount? Or, can this all be done with Rules?

Randy Fay told me about this forum post and said the following:
"Right now, I don't think there has been a good module developed to do order-level discounts. What's required for this is a special line item (like used for shipping) that does nothing but present a discount. It shouldn't be a hard module, but I don't think anybody has done it."

I would be help contribute a little money to someone could get this done soon.
I need it done asap though.


Jeff Purtle on March 29, 2012

I wonder if I can use Commerce Coupon and it's Action to
Create Coupon Line Item

Has anyone done that?
Just an idea. I am playing with it now.