lib/active_merchant/billing/gateways/mundipagg.rb in activemerchant-1.103.0 vs lib/active_merchant/billing/gateways/mundipagg.rb in activemerchant-1.104.0

- old
+ new

@@ -196,10 +196,11 @@ add_billing_address(post, 'voucher', options) end def voucher?(payment) return false if payment.is_a?(String) + %w[sodexo vr].include? card_brand(payment) end def headers { @@ -299,10 +300,11 @@ error_string end def authorization_from(response, action) return "#{response['customer']['id']}|#{response['id']}" if action == 'store' + response['id'] end def parse_auth(auth) auth.split('|') @@ -311,10 +313,13 @@ def post_data(parameters = {}) parameters.to_json end def error_code_from(response) - STANDARD_ERROR_CODE[:processing_error] unless success_from(response) + return if success_from(response) + return response['last_transaction']['acquirer_return_code'] if response['last_transaction'] + + STANDARD_ERROR_CODE[:processing_error] end end end end