lib/active_merchant/billing/gateways/borgun.rb in activemerchant-1.131.0 vs lib/active_merchant/billing/gateways/borgun.rb in activemerchant-1.133.0
- old
+ new
@@ -170,11 +170,11 @@
Response.new(
success,
message_from(success, pairs),
pairs,
- authorization: authorization_from(pairs),
+ authorization: authorization_from(pairs, options),
test: test?
)
end
def success_from(response)
@@ -183,24 +183,26 @@
def message_from(succeeded, response)
if succeeded
'Succeeded'
else
- response[:message] || "Error with ActionCode=#{response[:actioncode]}"
+ response[:message] || response[:status_errormessage] || "Error with ActionCode=#{response[:actioncode]}"
end
end
- def authorization_from(response)
- [
+ def authorization_from(response, options)
+ authorization = [
response[:dateandtime],
response[:batch],
response[:transaction],
response[:rrn],
response[:authcode],
response[:transtype],
response[:tramount],
response[:trcurrency]
].join('|')
+
+ authorization == '|||||||' ? nil : authorization
end
def split_authorization(authorization)
dateandtime, batch, transaction, rrn, authcode, transtype, tramount, currency = authorization.split('|')
[dateandtime, batch, transaction, rrn, authcode, transtype, tramount, currency]