Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransFirst Express: Fix blank address2 values #3231

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Cybersource: Send tokenization data when card is :master [pi3r] #3230
* Bluesnap: Omit state codes for unsupported countries [therufs] #3229
* Adyen: Pass updateShopperStatement, industryUsage [curiousepic] #3233
* TransFirst Transaction Express: Fix blank address2 values [britth] #3231

== Version 1.94.0 (May 21, 2019)
* Mundipagg: Fix number lengths for both VR and Sodexo [dtykocki] #3195
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def add_contact(doc, fullname, options)
end
end
doc['v1'].addrLn1 billing_address[:address1] if billing_address[:address1]
doc['v1'].addrLn2 billing_address[:address2] if billing_address[:address2]
doc['v1'].addrLn2 billing_address[:address2] unless billing_address[:address2].blank?
doc['v1'].city billing_address[:city] if billing_address[:city]
doc['v1'].state billing_address[:state] if billing_address[:state]
doc['v1'].zipCode billing_address[:zip] if billing_address[:zip]
Expand All @@ -559,7 +559,7 @@ def add_contact(doc, fullname, options)
doc['v1'].ship do
doc['v1'].fullName fullname unless fullname.blank?
doc['v1'].addrLn1 shipping_address[:address1] if shipping_address[:address1]
doc['v1'].addrLn2 shipping_address[:address2] if shipping_address[:address2]
doc['v1'].addrLn2 shipping_address[:address2] unless shipping_address[:address2].blank?
doc['v1'].city shipping_address[:city] if shipping_address[:city]
doc['v1'].state shipping_address[:state] if shipping_address[:state]
doc['v1'].zipCode shipping_address[:zip] if shipping_address[:zip]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup

@amount = 100
@declined_amount = 21
@credit_card = credit_card('4485896261017708')
@credit_card = credit_card('4485896261017708', verification_value: 999)
@check = check

billing_address = address({
Expand Down Expand Up @@ -76,6 +76,26 @@ def test_successful_purchase_with_only_required
assert_equal 'CVV matches', response.cvv_result['message']
end

def test_successful_purchase_without_address2
# Test that empty string in `address2` doesn't cause transaction failure
options = @options.dup
options[:shipping_address] = {
address1: '450 Main',
address2: '',
zip: '85284',
}

options[:billing_address] = {
address1: '450 Main',
address2: '',
zip: '85284',
}

response = @gateway.purchase(@amount, @credit_card, options)
assert_success response
assert_equal 'Succeeded', response.message
end

def test_successful_purchase_without_cvv
credit_card_opts = {
:number => 4485896261017708,
Expand Down