diff --git a/CHANGELOG b/CHANGELOG index 46848793398..bfded0368f9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,6 +23,7 @@ * Adyen: Update split refund method [yunnydang] #5218 * Adyen: Remove raw_error_message [almalee24] #5202 * Elavon: Remove old Stored Credential method [almalee24] #5219 +* PayTrace: Update MultiResponse for Capture [almalee24] #5203 == Version 1.137.0 (August 2, 2024) * Unlock dependency on `rexml` to allow fixing a CVE (#5181). diff --git a/lib/active_merchant/billing/gateways/pay_trace.rb b/lib/active_merchant/billing/gateways/pay_trace.rb index d4a159d1d87..0ce064a009b 100644 --- a/lib/active_merchant/billing/gateways/pay_trace.rb +++ b/lib/active_merchant/billing/gateways/pay_trace.rb @@ -95,7 +95,7 @@ def authorize(money, payment_or_customer_id, options = {}) def capture(money, authorization, options = {}) if visa_or_mastercard?(options) - MultiResponse.run do |r| + MultiResponse.run(:use_first_response) do |r| r.process { commit(ENDPOINTS[:capture], build_capture_request(money, authorization, options)) } r.process { commit(ENDPOINTS[:"level_3_#{options[:visa_or_mastercard]}"], send_level_3_data(r, options)) } end diff --git a/test/remote/gateways/remote_pay_trace_test.rb b/test/remote/gateways/remote_pay_trace_test.rb index 611fec465a3..cea698408c3 100644 --- a/test/remote/gateways/remote_pay_trace_test.rb +++ b/test/remote/gateways/remote_pay_trace_test.rb @@ -263,7 +263,8 @@ def test_successful_authorize_and_capture_with_level_3_data assert_success capture transaction_id = auth.authorization - assert_equal "Visa/MasterCard enhanced data was successfully added to Transaction ID #{transaction_id}. 2 line item records were created.", capture.message + assert_equal capture.authorization, transaction_id + assert_equal 'Your transaction was successfully captured.', capture.message end def test_failed_authorize