Skip to content

Commit

Permalink
Merge pull request #4 from appfolio/feature/litle-token-with-cardhold…
Browse files Browse the repository at this point in the history
…er-name

Add cardholder name to purchase request with litle token
  • Loading branch information
César Camacho authored Sep 20, 2019
2 parents 01e3260 + 4812da6 commit 0801bcd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/active_merchant/billing/gateways/litle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,13 @@ def add_stored_credential_params_used(doc, options)
end

def add_billing_address(doc, payment_method, options)
return if payment_method.is_a?(String)

doc.billToAddress do
if check?(payment_method)
doc.name(payment_method.name)
doc.firstName(payment_method.first_name)
doc.lastName(payment_method.last_name)
elsif payment_method.is_a?(String)
doc.name(options[:name]) if options[:name].present?
else
doc.name(payment_method.name)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/active_merchant/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ActiveMerchant
VERSION = '1.97.0'
VERSION = '1.98.0'
end
3 changes: 2 additions & 1 deletion test/unit/gateways/litle_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ def test_passing_merchant_data

def test_passing_litle_token
stub_comms do
@gateway.purchase(@amount, '121212121212', month: '01', year: '20')
@gateway.purchase(@amount, '121212121212', month: '01', year: '20', name: 'Jason Voorhees')
end.check_request do |endpoint, data, headers|
assert_match(%r(<expDate>0120<), data)
assert_match(%r(<name>Jason Voorhees<), data)
end.respond_with(successful_purchase_response)
end

Expand Down

0 comments on commit 0801bcd

Please sign in to comment.