-
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.
Element: fix bug with billing address email
Enables the `add_address` method to successfully find `email` whether it is nested at the top level of the `options` hash or within the `billing_address` object CER-330
- Loading branch information
Showing
4 changed files
with
18 additions
and
0 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 |
---|---|---|
|
@@ -50,6 +50,12 @@ def test_successful_purchase_with_shipping_address | |
assert_equal 'Approved', response.message | ||
end | ||
|
||
def test_successful_purchase_with_billing_email | ||
response = @gateway.purchase(@amount, @credit_card, @options.merge(email: '[email protected]')) | ||
assert_success response | ||
assert_equal 'Approved', response.message | ||
end | ||
|
||
def test_successful_purchase_with_card_present_code | ||
response = @gateway.purchase(@amount, @credit_card, @options.merge(card_present_code: 'Present')) | ||
assert_success response | ||
|
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 |
---|---|---|
|
@@ -296,6 +296,16 @@ def test_successful_purchase_with_merchant_descriptor | |
assert_success response | ||
end | ||
|
||
def test_successful_purchase_with_billing_email | ||
response = stub_comms do | ||
@gateway.purchase(@amount, @credit_card, @options.merge(email: '[email protected]')) | ||
end.check_request do |_endpoint, data, _headers| | ||
assert_match '<BillingEmail>[email protected]</BillingEmail>', data | ||
end.respond_with(successful_purchase_response) | ||
|
||
assert_success response | ||
end | ||
|
||
def test_successful_credit_with_extra_fields | ||
credit_options = @options.merge({ ticket_number: '1', market_code: 'FoodRestaurant', merchant_supplied_transaction_id: '123' }) | ||
stub_comms do | ||
|