lib/active_merchant/billing/gateways/payex.rb in activemerchant-1.114.0 vs lib/active_merchant/billing/gateways/payex.rb in activemerchant-1.116.0
- old
+ new
@@ -28,11 +28,11 @@
capture: '6'
}
SOAP_ACTIONS = {
initialize: { name: 'Initialize8', url: 'pxorder/pxorder.asmx', xmlns: 'http://external.payex.com/PxOrder/' },
- purchasecc: { name: 'PurchaseCC', url: 'pxconfined/pxorder.asmx', xmlns: 'http://confined.payex.com/PxOrder/', confined: true},
+ purchasecc: { name: 'PurchaseCC', url: 'pxconfined/pxorder.asmx', xmlns: 'http://confined.payex.com/PxOrder/', confined: true },
cancel: { name: 'Cancel2', url: 'pxorder/pxorder.asmx', xmlns: 'http://external.payex.com/PxOrder/' },
capture: { name: 'Capture5', url: 'pxorder/pxorder.asmx', xmlns: 'http://external.payex.com/PxOrder/' },
credit: { name: 'Credit5', url: 'pxorder/pxorder.asmx', xmlns: 'http://external.payex.com/PxOrder/' },
create_agreement: { name: 'CreateAgreement3', url: 'pxagreement/pxagreement.asmx', xmlns: 'http://external.payex.com/PxAgreement/' },
delete_agreement: { name: 'DeleteAgreement', url: 'pxagreement/pxagreement.asmx', xmlns: 'http://external.payex.com/PxAgreement/' },
@@ -115,11 +115,11 @@
#
# authorization - The authorization returned from the successful authorize transaction.
# options - A standard ActiveMerchant options hash
#
# Returns an ActiveMerchant::Billing::Response object
- def void(authorization, options={})
+ def void(authorization, options = {})
send_cancel(authorization)
end
# Public: Refunds a purchase transaction
#
@@ -153,11 +153,11 @@
def store(creditcard, options = {})
requires!(options, :order_id)
amount = amount(1) # 1 cent for authorization
MultiResponse.run(:first) do |r|
r.process { send_create_agreement(options) }
- r.process { send_initialize(amount, true, options.merge({agreement_ref: r.authorization})) }
+ r.process { send_initialize(amount, true, options.merge({ agreement_ref: r.authorization })) }
order_ref = r.params['orderref']
r.process { send_purchasecc(creditcard, order_ref) }
end
end
@@ -339,13 +339,13 @@
properties['hash_'] = Digest::MD5.hexdigest(data.join(''))
end
def build_xml_request(soap_action, properties)
builder = Nokogiri::XML::Builder.new
- builder.__send__('soap12:Envelope', {'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
+ builder.__send__('soap12:Envelope', { 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
- 'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope'}) do |root|
+ 'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope' }) do |root|
root.__send__('soap12:Body') do |body|
body.__send__(soap_action[:name], xmlns: soap_action[:xmlns]) do |doc|
properties.each do |key, val|
doc.send(key, val)
end
@@ -387,11 +387,10 @@
response = parse(ssl_post(url, request, headers))
Response.new(success?(response),
message_from(response),
response,
test: test?,
- authorization: build_authorization(response)
- )
+ authorization: build_authorization(response))
end
def build_authorization(response)
# agreementref is for the store transaction, everything else gets transactionnumber
response[:transactionnumber] || response[:agreementref]