1

Braintree does not support partial payments in a single order authorization with more than one shipment when I set auto_capture_on_dispatch = true in Spree. It works for the first capture attempt but on second attempt will raise below error.

 Gateway Error
 --- !ruby/object:ActiveMerchant::Billing::Response
params:
 braintree_transaction: 
 message: Cannot submit for settlement unless status is authorized. (91507)
 success: false 

I think this error can be solved if instead of authorizing the order total amount Spree authorized each shipment separately having different transaction at the end. In other words, to create as many payment authorization as shipments in a single order. Is this technically possible? Can someone put me in the right track on this? How can I implement this approach in Spree?

I am looking multiples Spree code lines and let me tell you Spree is not vanilla cake.

https://github.com/spree/spree/blob/master/core/app/models/spree/order/checkout.rb#L82

https://github.com/spree/spree/blob/master/core/app/models/spree/order/payments.rb#L22

https://github.com/spree/spree/blob/master/core/app/models/spree/payment/processing.rb#L10

https://github.com/spree/spree/blob/master/core/app/models/spree/payment.rb#L215

https://github.com/spree/spree/blob/master/core/app/models/spree/shipment.rb#L183

https://github.com/spree/spree/blob/master/core/app/models/spree/shipment_handler.rb#L20

Thank you a lot in advance.

aminhs
  • 45
  • 6

0 Answers0