Skip to content

Commit

Permalink
Revert "Add the fundingDestination field and fundingSource to authori…
Browse files Browse the repository at this point in the history
…ze call"

This reverts commit 9a46606.
  • Loading branch information
rachelkirk authored Jan 7, 2025
1 parent 9a46606 commit 50d1387
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 56 deletions.
10 changes: 0 additions & 10 deletions lib/active_merchant/billing/gateways/adyen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ def authorize(money, payment, options = {})
add_data_lodging(post, options)
add_metadata(post, options)
add_recurring_detail_reference(post, options)
add_fund_source(post, options)
add_fund_destination(post, options)
commit('authorise', post, options)
end

Expand Down Expand Up @@ -789,7 +787,6 @@ def add_fund_source(post, options)

post[:fundSource] = {}
post[:fundSource][:additionalData] = fund_source[:additional_data] if fund_source[:additional_data]
post[:fundSource][:shopperEmail] = fund_source[:shopper_email] if fund_source[:shopper_email]

if fund_source[:first_name] && fund_source[:last_name]
post[:fundSource][:shopperName] = {}
Expand All @@ -802,13 +799,6 @@ def add_fund_source(post, options)
end
end

def add_fund_destination(post, options)
return unless fund_destination = options[:fund_destination]

post[:fundDestination] = {}
post[:fundDestination][:additionalData] = fund_destination[:additional_data] if fund_destination[:additional_data]
end

def add_metadata(post, options = {})
return unless options[:metadata]

Expand Down
19 changes: 0 additions & 19 deletions test/remote/gateways/remote_adyen_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -440,25 +440,6 @@ def test_successful_authorize_with_no_address
assert_equal 'Authorised', response.message
end

def test_successful_authorize_with_fund_source_and_fund_destination
fund_options = {
fund_source: {
additional_data: { fundingSource: 'Debit' },
first_name: 'Payer',
last_name: 'Name',
billing_address: @us_address,
shopper_email: '[email protected]'
},
fund_destination: {
additional_data: { walletIdentifier: '12345' }
}
}

response = @gateway.authorize(@amount, @credit_card, @options.merge!(fund_options))
assert_success response
assert_equal 'Authorised', response.message
end

def test_successful_authorize_with_credit_card_no_name
credit_card_no_name = ActiveMerchant::Billing::CreditCard.new({
number: '4111111111111111',
Expand Down
27 changes: 0 additions & 27 deletions test/unit/gateways/adyen_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -661,33 +661,6 @@ def test_risk_data_sent
end.respond_with(successful_authorize_response)
end

def test_fund_source_and_fund_destination_sent
fund_options = {
fund_source: {
additional_data: { fundingSource: 'Debit' },
first_name: 'Payer',
last_name: 'Name',
billing_address: @us_address,
shopper_email: '[email protected]'
},
fund_destination: {
additional_data: { walletIdentifier: '12345' }
}
}

stub_comms do
@gateway.authorize(@amount, @credit_card, @options.merge(fund_options))
end.check_request do |_endpoint, data, _headers|
fund_source = JSON.parse(data)['fundSource']
fund_destination = JSON.parse(data)['fundDestination']
assert_equal '[email protected]', fund_source['shopperEmail']
assert_equal 'Payer', fund_source['shopperName']['firstName']
assert_equal 'Name', fund_source['shopperName']['lastName']
assert_equal 'Debit', fund_source['additionalData']['fundingSource']
assert_equal '12345', fund_destination['additionalData']['walletIdentifier']
end.respond_with(successful_authorize_response)
end

def test_manual_capture_sent
stub_comms do
@gateway.authorize(@amount, @credit_card, @options.merge(manual_capture: 'true'))
Expand Down

0 comments on commit 50d1387

Please sign in to comment.