-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Worldpay: Update where to pass shopperIPAddress
For NetworkTokens shopperIPAddress should be passed after the stored credentials fields. And for Fast Access transactions shopperIPAddress should be passed within paymentDetails Remote 117 tests, 498 assertions, 2 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 98.2906% passed Unit 134 tests, 743 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed
- Loading branch information
Alma Malambo
committed
Dec 4, 2024
1 parent
bd5245f
commit 925404b
Showing
4 changed files
with
43 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,8 @@ def setup | |
|
||
@options = { | ||
order_id: generate_unique_id, | ||
email: '[email protected]' | ||
email: '[email protected]', | ||
ip: '127.0.0.1' | ||
} | ||
|
||
@level_two_data = { | ||
|
@@ -1037,35 +1038,32 @@ def test_failed_visa_account_funding_transfer_acquirer_error | |
assert_equal '20', credit.error_code | ||
end | ||
|
||
# These three fast_fund_credit tests are currently failing with the message: Disbursement transaction not supported | ||
# It seems that the current sandbox setup does not support testing this. | ||
|
||
# def test_successful_fast_fund_credit_on_cft_gateway | ||
# options = @options.merge({ fast_fund_credit: true }) | ||
def test_successful_fast_fund_credit_on_cft_gateway | ||
options = @options.merge({ fast_fund_credit: true }) | ||
|
||
# credit = @cftgateway.credit(@amount, @credit_card, options) | ||
# assert_success credit | ||
# assert_equal 'SUCCESS', credit.message | ||
# end | ||
credit = @cftgateway.credit(@amount, @credit_card, options) | ||
assert_success credit | ||
assert_equal 'SUCCESS', credit.message | ||
end | ||
|
||
# def test_successful_fast_fund_credit_with_token_on_cft_gateway | ||
# assert store = @gateway.store(@credit_card, @store_options) | ||
# assert_success store | ||
def test_successful_fast_fund_credit_with_token_on_cft_gateway | ||
assert store = @gateway.store(@credit_card, @store_options) | ||
assert_success store | ||
|
||
# options = @options.merge({ fast_fund_credit: true }) | ||
# assert credit = @cftgateway.credit(@amount, store.authorization, options) | ||
# assert_success credit | ||
# end | ||
options = @options.merge({ fast_fund_credit: true }) | ||
assert credit = @cftgateway.credit(@amount, store.authorization, options) | ||
assert_success credit | ||
end | ||
|
||
# def test_failed_fast_fund_credit_on_cft_gateway | ||
# options = @options.merge({ fast_fund_credit: true }) | ||
# refused_card = credit_card('4444333322221111', name: 'REFUSED') # 'magic' value for testing failures, provided by Worldpay | ||
def test_failed_fast_fund_credit_on_cft_gateway | ||
options = @options.merge({ fast_fund_credit: true }) | ||
refused_card = credit_card('4444333322221111', name: 'REFUSED') # 'magic' value for testing failures, provided by Worldpay | ||
|
||
# credit = @cftgateway.credit(@amount, refused_card, options) | ||
# assert_failure credit | ||
# assert_equal '01', credit.params['action_code'] | ||
# assert_equal "A transaction status of 'ok' or 'PUSH_APPROVED' is required.", credit.message | ||
# end | ||
credit = @cftgateway.credit(@amount, refused_card, options) | ||
assert_failure credit | ||
assert_equal '01', credit.params['action_code'] | ||
assert_equal "A transaction status of 'ok' or 'PUSH_APPROVED' is required.", credit.message | ||
end | ||
|
||
def test_transcript_scrubbing | ||
transcript = capture_transcript(@gateway) do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -844,6 +844,17 @@ def test_capture_using_order_id_embedded_with_token | |
assert_success response | ||
end | ||
|
||
def test_successful_fast_fund_credit | ||
options = @options.merge({ fast_fund_credit: true, email: '[email protected]' }) | ||
|
||
stub_comms do | ||
@gateway.credit(@amount, @credit_card, options) | ||
end.check_request do |_endpoint, data, _headers| | ||
assert_match(/<FF_DISBURSE-SSL>/, data) | ||
assert_match(/<shopperEmailAddress>/, data) | ||
end.respond_with(successful_visa_credit_response) | ||
end | ||
|
||
def test_successful_visa_credit | ||
response = stub_comms do | ||
@gateway.credit(@amount, @credit_card, @options) | ||
|