Skip to content

Commit

Permalink
Provide transaction_id and source in try_void
Browse files Browse the repository at this point in the history
The previous implementation was missing these fields,
which might be useless for some implementations but there's
no reason no to pass them along.
elia authored and kennyadsl committed Jan 18, 2023
1 parent cdb4efc commit 57625a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/app/models/spree/payment_method.rb
Original file line number Diff line number Diff line change
@@ -181,9 +181,9 @@ def supports?(_source)
# @return [ActiveMerchant::Billing::Response|FalseClass]
def try_void(payment)
void_attempt = if payment.payment_method.payment_profiles_supported?
void(nil, nil, { originator: payment })
void(payment.transaction_id, payment.source, { originator: payment })
else
void(nil, { originator: payment })
void(payment.transaction_id, { originator: payment })
end

return void_attempt if void_attempt.success?

0 comments on commit 57625a5

Please sign in to comment.