lib/active_merchant/billing/gateways/forte.rb in activemerchant-1.61.0 vs lib/active_merchant/billing/gateways/forte.rb in activemerchant-1.62.0
- old
+ new
@@ -46,11 +46,11 @@
def capture(money, authorization, options={})
post = {}
add_invoice(post, options)
post[:transaction_id] = transaction_id_from(authorization)
- post[:authorization_code] = authorization_code_from(authorization)
+ post[:authorization_code] = authorization_code_from(authorization) || ""
post[:action] = "capture"
commit(:put, post)
end
@@ -209,10 +209,10 @@
def message_from(response)
response["response"]["response_desc"]
end
def authorization_from(response)
- [response["transaction_id"], response["authorization_code"]].join("#")
+ [response.try(:[], "transaction_id"), response.try(:[], "response").try(:[], "authorization_code")].join("#")
end
def endpoint
"/accounts/act_#{@options[:account_id]}/locations/loc_#{@options[:location_id]}/transactions/"
end