Needs work
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Payment
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Jun 2012 at 15:15 UTC
Updated:
13 Jun 2016 at 17:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
artkon commentedPatch for 7.x-1.3
Comment #2
artkon commentedComment #3
rszrama commentedI can't commit the patch as is to the 1.x branch, because it represents a significant API change that would be quite disruptive to sites depending on the current event. However, if you're up to resubmitting the patch, I'd be happy to add the condition code to check if an order has already been marked paid in full before. To determine if an order has been paid in full then without a separate event, you can just use the events pertaining to after a payment transaction has been saved / updated.
Comment #4
artkon commentedMakes sense, here is the patch for the additional condition to check for order first paid in full.
Comment #5
artkon commentedComment #6
damien tournoud commentedI think it would make slightly more sense to allow you to execute an action that says "forget that the order has been paid in full before" (ie. basically resetting
$order->data['commerce_payment_order_paid_in_full_invoked']). I don't see how the new condition is actually useful in your use-case.Comment #7
artkon commentedWell, I reverted back to just using the entity rules "After saving a new commerce payment transaction" and condition "Order balance comparison" <= 0. Partly agree with Damien, don't really need the added condition because the previous mentioned condition takes care of that so I would be ok without it. One other suggestion might be to add another rules event "Order paid in full" on top of "Order paid in full for first time" but that just might be too much.
Comment #8
rszrama commentedUpdating the title and tagging.
Comment #9
rszrama commentedThe solution here will be a real simple action that can be modeled off of the commerce_order_update_status action in commerce_order.rules.inc. (Naturally, it will only need the first parameter, and as we discussed and you can review in rules.api.php, you should set the save property for the order parameter to TRUE.) The callback itself should only need to unset the variable in the $order->data array Damien points to above.
Comment #10
nullvariable commentedAttached is a patch that adds a rules action to revoke paid in full status on an order. The action does not clear payments from the order. Just the paid in full status.
Comment #12
rszrama commentedInstead of language re: revocation, let's use language about unsetting (code) / resetting (UI) an order's paid in full status.
Machine-name / execute callback: commerce_order_unset_paid_in_full
Label: Reset an order's paid in full status
Comment #13
nullvariable commentedrevised patch is attached
Comment #14
rszrama commentedOne minor change - for string literals inside of t(), we don't want to include any escape characters unless absolutely necessary. That helps simplify translation. Instead, in cases where you have an apostrophe or single quote, use double quotes to wrap the string literal.
Comment #15
nullvariable commentedrevised patch to fix quotes/escaping issue
Comment #16
nullvariable commentedComment #19
nullvariable commentedfixed encoding
Comment #20
nullvariable commented