Skip to content

Commit

Permalink
remove ntid override
Browse files Browse the repository at this point in the history
  • Loading branch information
aenand committed May 6, 2024
1 parent c4965a9 commit 798b331
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
2 changes: 1 addition & 1 deletion lib/active_merchant/billing/gateways/worldpay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def add_stored_credential_using_normalized_fields(xml, options)
stored_credential_params = generate_stored_credential_params(is_initial_transaction, reason)

xml.storedCredentials stored_credential_params do
xml.schemeTransactionIdentifier network_transaction_id(options) if network_transaction_id(options) && !is_initial_transaction
xml.schemeTransactionIdentifier options[:stored_credential][:network_transaction_id] if options[:stored_credential][:network_transaction_id] && !is_initial_transaction
end
end

Expand Down
16 changes: 0 additions & 16 deletions test/unit/gateways/worldpay_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -315,22 +315,6 @@ def test_authorize_passes_ip_and_session_id
assert_success response
end

def test_authorize_prefers_non_normal_ntid
stored_credential_params = stored_credential(:used, :recurring, :merchant, network_transaction_id: '3812908490218390214124')
options = @options.merge(
stored_credential_transaction_id: '000000000000020005060720116005060'
)

options.merge!({ stored_credential: stored_credential_params })
response = stub_comms do
@gateway.authorize(@amount, @credit_card, options)
end.check_request do |_endpoint, data, _headers|
assert_match(/<storedCredentials usage\=\"USED\" merchantInitiatedReason\=\"RECURRING\"\>/, data)
assert_match(/<schemeTransactionIdentifier\>000000000000020005060720116005060\<\/schemeTransactionIdentifier\>/, data)
end.respond_with(successful_authorize_response)
assert_success response
end

def test_authorize_passes_stored_credential_options
options = @options.merge(
stored_credential_usage: 'USED',
Expand Down

0 comments on commit 798b331

Please sign in to comment.