activemerchant / active_merchant

Active Merchant is a simple payment abstraction library extracted from Shopify. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gateways.
http://activemerchant.org
MIT License
4.54k stars 2.5k forks source link

Question about braintree blue refund implementation #3399

Open daisy1754 opened 5 years ago

daisy1754 commented 5 years ago

Currently braintree blue refund is implemented in following way:

  1. try refund
  2. it it fails, try void https://github.com/activemerchant/active_merchant/blob/1d84209e9d37c12c3591a6372bf381ee08294251/lib/active_merchant/billing/gateways/braintree_blue.rb#L102

Is there any reason library is not fetching the transaction status and then do either refund or void? Current implementation is causing error response and seems a bit weird.

I'm happy to send a pull request to change behaviour but wanted to check if this is intentional. [EDIT: I no longer remember about this, so probably cannot send PR by myself]

martinstreicher commented 4 years ago

@daisy1754 What field in the Braintree Blue purchase transaction response represents the transaction_id to be used in the refund? Is it the network_transaction_id field found in the transaction response?

daisy1754 commented 4 years ago

@martinstreicher quite honestly I don't remember

martinstreicher commented 4 years ago

No worries. I found it. It's the authorization field in the response.

curiousepic commented 1 year ago

Marking this "of interest" before a cleanup of stale issues