The payment tab on the order management page (admin/commerce/orders/%commerce_order/payment) allows for adding a Paypal WPP payment, but I would like to allow for initiating a refund. Are there any plans for this?

There is some discussion about order (or line item) cancellations and refunds in general (not tied to a specific payment gateway) in this Drupal Commerce issue: http://drupal.org/node/1419784#comment-5815272.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev

Just wanna say I'm totally down with adding this, but I doubt it'll get into the 1.0 release. I'll add it in any minor release, though - there are equivalent features in the Authorize.Net, CyberSource, and other integrations if whoever gets this needs an example to look at.

olteanu5000’s picture

Status: Active » Needs review
FileSize
7.36 KB

Try the attached patch for the functionality.

Exploratus’s picture

I'm surprised didnt get much action. Is this patch still valid? Worth the try?

kimberlydb’s picture

Issue summary: View changes
FileSize
115.65 KB

Works well, the only issue I have is when i have multiple partial payments on an order and try to refund a partial amount on a partial transaction, it doesn't do the math quite correctly and I get an error complaining about payment status. That's a rare situation for me though, so otherwise works quite well.

In the screenshot I had 3 credit card payments of $1.15, $1.00, and $1.00. I tried to refund $0.50 on the bottom $1.00 payment and it takes the order total ($3.15 - 0.5) rather than the transaction total (1 - 0.5) so now even though it correctly refunded $0.5 through paypal, it reflects an incorrect amount making it appear like the customer has a balance.

rszrama’s picture

Status: Needs review » Needs work

On a real cursory examination, this patch needs to be re-rolled to remove mention of voiding. Voids are performed against authorizations before they are captured, not against captured transactions. I think everything can just be reduced to "refund" and it'd be ok - though I have yet to test this in a sandbox env't.

webadpro’s picture

FileSize
9.68 KB

Hi,

I would like to submit a new patch.

This patch takes a different approach than applying the refund directly on the original transaction.

Each refund creates a new transaction which is attached to the original transaction.

jmu3’s picture

#6 works well

Thank you @webadpro.