lib/active_merchant/billing/gateways/blue_snap.rb in activemerchant-1.105.0 vs lib/active_merchant/billing/gateways/blue_snap.rb in activemerchant-1.106.0

- old
+ new

@@ -7,10 +7,12 @@ self.live_url = 'https://ws.bluesnap.com/services/2' self.supported_countries = %w(US CA GB AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE AR BO BR BZ CL CO CR DO EC GF GP GT HN HT MF MQ MX NI PA PE PR PY SV UY VE) self.default_currency = 'USD' self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club, :maestro, :naranja, :cabal] + self.currencies_without_fractions = %w(BYR CLP ILS JPY KRW VND XOF) + self.currencies_with_three_decimal_places = %w(BHD JOD KWD OMR TND) self.homepage_url = 'https://home.bluesnap.com/' self.display_name = 'BlueSnap' TRANSACTIONS = { @@ -186,11 +188,12 @@ add_credit_card(doc, payment_method) end end def add_amount(doc, money, options) - doc.amount(amount(money)) - doc.currency(options[:currency] || currency(money)) + currency = options[:currency] || currency(money) + doc.amount(localized_amount(money, currency)) + doc.currency(currency) end def add_personal_info(doc, payment_method, options) doc.send('first-name', payment_method.first_name) doc.send('last-name', payment_method.last_name)