lib/active_merchant/billing/gateways/monei.rb in activemerchant-1.104.0 vs lib/active_merchant/billing/gateways/monei.rb in activemerchant-1.105.0
- old
+ new
@@ -258,14 +258,14 @@
# Private: Parse XML response from Monei servers
def parse(body)
xml = Nokogiri::XML(body)
{
- :unique_id => xml.xpath('//Response/Transaction/Identification/UniqueID').text,
- :status => translate_status_code(xml.xpath('//Response/Transaction/Processing/Status/@code').text),
- :reason => translate_status_code(xml.xpath('//Response/Transaction/Processing/Reason/@code').text),
- :message => xml.xpath('//Response/Transaction/Processing/Return').text
+ :unique_id => xml.xpath('//Response/Transaction/Identification/UniqueID').text,
+ :status => translate_status_code(xml.xpath('//Response/Transaction/Processing/Status/@code').text),
+ :reason => translate_status_code(xml.xpath('//Response/Transaction/Processing/Reason/@code').text),
+ :message => xml.xpath('//Response/Transaction/Processing/Return').text
}
end
# Private: Send XML transaction to Monei servers and create AM response
def commit(xml)
@@ -309,29 +309,29 @@
end
# Private: Translate Monei status code to native ruby symbols
def translate_status_code(code)
{
- '00' => :success,
- '40' => :neutral,
- '59' => :waiting_bank,
- '60' => :rejected_bank,
- '64' => :waiting_risk,
- '65' => :rejected_risk,
- '70' => :rejected_validation,
- '80' => :waiting,
- '90' => :new
+ '00' => :success,
+ '40' => :neutral,
+ '59' => :waiting_bank,
+ '60' => :rejected_bank,
+ '64' => :waiting_risk,
+ '65' => :rejected_risk,
+ '70' => :rejected_validation,
+ '80' => :waiting,
+ '90' => :new
}[code]
end
# Private: Translate AM operations to Monei operations codes
def tanslate_payment_code(action)
{
- :purchase => 'CC.DB',
- :authorize => 'CC.PA',
- :capture => 'CC.CP',
- :refund => 'CC.RF',
- :void => 'CC.RV'
+ :purchase => 'CC.DB',
+ :authorize => 'CC.PA',
+ :capture => 'CC.CP',
+ :refund => 'CC.RF',
+ :void => 'CC.RV'
}[action]
end
end
end
end