lib/active_merchant/billing/gateways/cenpos.rb in activemerchant-1.114.0 vs lib/active_merchant/billing/gateways/cenpos.rb in activemerchant-1.116.0
- old
+ new
@@ -11,71 +11,71 @@
self.supported_countries = %w(AD AI AG AR AU AT BS BB BE BZ BM BR BN BG CA HR CY CZ DK DM EE FI FR DE GR GD GY HK HU IS IL IT JP LV LI LT LU MY MT MX MC MS NL PA PL PT KN LC MF VC SM SG SK SI ZA ES SR SE CH TR GB US UY)
self.default_currency = 'USD'
self.money_format = :dollars
self.supported_cardtypes = %i[visa master american_express discover]
- def initialize(options={})
+ def initialize(options = {})
requires!(options, :merchant_id, :password, :user_id)
super
end
- def purchase(amount, payment_method, options={})
+ def purchase(amount, payment_method, options = {})
post = {}
add_invoice(post, amount, options)
add_payment_method(post, payment_method)
add_customer_data(post, options)
commit('Sale', post)
end
- def authorize(amount, payment_method, options={})
+ def authorize(amount, payment_method, options = {})
post = {}
add_invoice(post, amount, options)
add_payment_method(post, payment_method)
add_customer_data(post, options)
commit('Auth', post)
end
- def capture(amount, authorization, options={})
+ def capture(amount, authorization, options = {})
post = {}
add_invoice(post, amount, options)
add_reference(post, authorization)
add_customer_data(post, options)
commit('SpecialForce', post)
end
- def void(authorization, options={})
+ def void(authorization, options = {})
post = {}
add_void_required_elements(post)
add_reference(post, authorization)
add_remembered_amount(post, authorization)
add_tax(post, options)
add_order_id(post, options)
commit('Void', post)
end
- def refund(amount, authorization, options={})
+ def refund(amount, authorization, options = {})
post = {}
add_invoice(post, amount, options)
add_reference(post, authorization)
add_customer_data(post, options)
commit('SpecialReturn', post)
end
- def credit(amount, payment_method, options={})
+ def credit(amount, payment_method, options = {})
post = {}
add_invoice(post, amount, options)
add_payment_method(post, payment_method)
commit('Credit', post)
end
- def verify(credit_card, options={})
+ def verify(credit_card, options = {})
MultiResponse.run(:use_first_response) do |r|
r.process { authorize(100, credit_card, options) }
r.process(:ignore_result) { void(r.authorization, options) }
end
end
@@ -196,21 +196,21 @@
end
envelope(xml.target!)
end
def envelope(body)
- <<~EOS
+ <<~XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:acr="http://schemas.datacontract.org/2004/07/Acriter.ABI.CenPOS.EPayment.VirtualTerminal.Common" xmlns:acr1="http://schemas.datacontract.org/2004/07/Acriter.ABI.CenPOS.EPayment.VirtualTerminal.v6.Common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<tem:ProcessCreditCard>
<tem:request>
#{body}
</tem:request>
</tem:ProcessCreditCard>
</soapenv:Body>
</soapenv:Envelope>
- EOS
+ XML
end
def parse(xml)
response = {}