Skip to content

Commit

Permalink
Kushki: Add Brazil as supported country
Browse files Browse the repository at this point in the history
Unit
17 tests, 109 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Remote
18 tests, 57 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
  • Loading branch information
Alma Malambo committed Jul 14, 2023
1 parent b135d18 commit 97f2037
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* CheckoutV2: Parse the AVS and CVV checks more often [aenand] #4822
* NMI: Add shipping_firstname, shipping_lastname, shipping_email, and surcharge fields [jcreiff] #4825
* Borgun: Update authorization_from & message_from [almalee24] #4826
* Kushki: Add Brazil as supported country [almalee24] #4829

== Version 1.131.0 (June 21, 2023)
* Redsys: Add supported countries [jcreiff] #4811
Expand Down
2 changes: 1 addition & 1 deletion lib/active_merchant/billing/gateways/kushki.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class KushkiGateway < Gateway
self.test_url = 'https://api-uat.kushkipagos.com/'
self.live_url = 'https://api.kushkipagos.com/'

self.supported_countries = %w[CL CO EC MX PE]
self.supported_countries = %w[BR CL CO EC MX PE]
self.default_currency = 'USD'
self.money_format = :dollars
self.supported_cardtypes = %i[visa master american_express discover diners_club alia]
Expand Down
15 changes: 14 additions & 1 deletion test/remote/gateways/remote_kushki_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ def test_successful_purchase
assert_match %r(^\d+$), response.authorization
end

def test_successful_purchase_brazil
response = @gateway.purchase(@amount, @credit_card, { currency: 'BRL' })
assert_success response
assert_equal 'Succeeded', response.message
assert_match %r(^\d+$), response.authorization
end

def test_successful_purchase_with_options
options = {
currency: 'USD',
Expand Down Expand Up @@ -137,13 +144,19 @@ def test_failed_purchase
end

def test_successful_authorize
# Kushki only allows preauthorization for PEN, CLP, and UF.
response = @gateway.authorize(@amount, @credit_card, { currency: 'PEN' })
assert_success response
assert_equal 'Succeeded', response.message
assert_match %r(^\d+$), response.authorization
end

def test_successful_authorize_brazil
response = @gateway.authorize(@amount, @credit_card, { currency: 'BRL' })
assert_success response
assert_equal 'Succeeded', response.message
assert_match %r(^\d+$), response.authorization
end

def test_approval_code_comes_back_when_passing_full_response
options = {
full_response: true
Expand Down

0 comments on commit 97f2037

Please sign in to comment.