forked from activemerchant/active_merchant
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Amount Allocations object as Marketplace API is deprecated
- Loading branch information
1 parent
b70928f
commit 3ee6d13
Showing
3 changed files
with
60 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,14 @@ def setup | |
email: '[email protected]', | ||
processing_channel_id: 'pc_lxgl7aqahkzubkundd2l546hdm' | ||
} | ||
@options_for_verify = @options.merge({ | ||
amount_allocations: [ | ||
{ | ||
id: 'ent_123', | ||
amount: 0 | ||
} | ||
] | ||
}) | ||
@additional_options = @options.merge( | ||
card_on_file: true, | ||
transaction_indicator: 2, | ||
|
@@ -1130,21 +1138,21 @@ def test_failed_void_via_oauth | |
end | ||
|
||
def test_successful_verify | ||
response = @gateway.verify(@credit_card, @options) | ||
response = @gateway.verify(@credit_card, @options_for_verify) | ||
assert_success response | ||
assert_match %r{Succeeded}, response.message | ||
end | ||
|
||
def test_successful_verify_via_oauth | ||
response = @gateway_oauth.verify(@credit_card, @options) | ||
response = @gateway_oauth.verify(@credit_card, @options_for_verify) | ||
assert_success response | ||
assert_match %r{Succeeded}, response.message | ||
assert_not_nil response.responses.first.params['access_token'] | ||
assert_not_nil response.responses.first.params['expires'] | ||
end | ||
|
||
def test_failed_verify | ||
response = @gateway.verify(@declined_card, @options) | ||
response = @gateway.verify(@declined_card, @options_for_verify) | ||
assert_failure response | ||
assert_match %r{request_invalid: card_number_invalid}, response.message | ||
end | ||
|
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