lib/active_merchant/billing/gateways/culqi.rb in activemerchant-1.114.0 vs lib/active_merchant/billing/gateways/culqi.rb in activemerchant-1.116.0

- old
+ new

@@ -18,20 +18,20 @@ self.supported_countries = ['PE'] self.default_currency = 'PEN' self.money_format = :dollars self.supported_cardtypes = %i[visa master diners_club american_express] - def initialize(options={}) + def initialize(options = {}) requires!(options, :merchant_id, :terminal_id, :secret_key) super end - def purchase(amount, payment_method, options={}) + def purchase(amount, payment_method, options = {}) authorize(amount, payment_method, options) end - def authorize(amount, payment_method, options={}) + def authorize(amount, payment_method, options = {}) if payment_method.is_a?(String) action = :tokenpay else action = :authorize end @@ -43,44 +43,44 @@ add_checksum(action, post) commit(action, post) end - def capture(amount, authorization, options={}) + def capture(amount, authorization, options = {}) action = :capture post = {} add_credentials(post) add_invoice(action, post, amount, options) add_reference(post, authorization) add_checksum(action, post) commit(action, post) end - def void(authorization, options={}) + def void(authorization, options = {}) action = :void post = {} add_credentials(post) add_invoice(action, post, nil, options) add_reference(post, authorization) add_checksum(action, post) commit(action, post) end - def refund(amount, authorization, options={}) + def refund(amount, authorization, options = {}) action = :refund post = {} add_credentials(post) add_invoice(action, post, amount, options) add_reference(post, authorization) add_checksum(action, post) commit(action, post) end - def verify(credit_card, options={}) + def verify(credit_card, options = {}) MultiResponse.run(:use_first_response) do |r| r.process { authorize(1000, credit_card, options) } r.process(:ignore_result) { void(r.authorization, options) } end end @@ -88,11 +88,11 @@ def verify_credentials response = void('0', order_id: '0') response.message.include? 'Transaction not found' end - def store(credit_card, options={}) + def store(credit_card, options = {}) action = :tokenize post = {} post[:partnerid] = options[:partner_id] if options[:partner_id] post[:cardholderid] = options[:cardholder_id] if options[:cardholder_id] add_credentials(post) @@ -101,10 +101,10 @@ add_checksum(action, post) commit(action, post) end - def invalidate(authorization, options={}) + def invalidate(authorization, options = {}) action = :invalidate post = {} post[:partnerid] = options[:partner_id] if options[:partner_id] add_credentials(post) post[:token] = authorization