-
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.
Use [email protected] when option[:email] is an empty string (#3462)
We've had some cases where email ends up being sent as an empty string and the current logic only checks for it's existence, not for its value. We should use [email protected] for both `nil` and `""`.
- Loading branch information
Pierre Nespo
authored
Dec 2, 2019
1 parent
0ba8ab7
commit 0843472
Showing
3 changed files
with
10 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
* Adyen: Add gateway specific field for splits [leila-alderman] #3448 | ||
* Adyen: Add `unstore` and `storeToken` actions with '/Recurring' endpoint [deedeelavinder][davidsantoso] #3438 | ||
* Barclaycard Smartpay: Add functionality to set 3DS exemptions via API [britth] #3457 | ||
* Use [email protected] when option[:email] is an empty string [pi3r] #3462 | ||
|
||
== Version 1.102.0 (Nov 14, 2019) | ||
* Quickbooks: Make token refresh optional with allow_refresh flag [britth] #3419 | ||
|
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 |
---|---|---|
|
@@ -469,7 +469,7 @@ def add_address(xml, payment_method, address, options, shipTo = false) | |
xml.tag! 'company', address[:company] unless address[:company].blank? | ||
xml.tag! 'companyTaxID', address[:companyTaxID] unless address[:company_tax_id].blank? | ||
xml.tag! 'phoneNumber', address[:phone] unless address[:phone].blank? | ||
xml.tag! 'email', options[:email] || '[email protected]' | ||
xml.tag! 'email', options[:email].presence || '[email protected]' | ||
xml.tag! 'ipAddress', options[:ip] unless options[:ip].blank? || shipTo | ||
xml.tag! 'driversLicenseNumber', options[:drivers_license_number] unless options[:drivers_license_number].blank? | ||
xml.tag! 'driversLicenseState', options[:drivers_license_state] unless options[:drivers_license_state].blank? | ||
|
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 |
---|---|---|
|
@@ -717,6 +717,14 @@ def test_does_not_throw_on_invalid_xml | |
assert_failure response | ||
end | ||
|
||
def test_address_email_has_a_default_when_email_option_is_empty | ||
stub_comms do | ||
@gateway.authorize(100, @credit_card, email: '') | ||
end.check_request do |endpoint, data, headers| | ||
assert_match('<email>[email protected]</email>', data) | ||
end.respond_with(successful_capture_response) | ||
end | ||
|
||
private | ||
|
||
def pre_scrubbed | ||
|