lib/active_merchant/billing/gateways/nexio.rb in nexio_activemerchant-0.2.4 vs lib/active_merchant/billing/gateways/nexio.rb in nexio_activemerchant-0.2.5
- old
+ new
@@ -252,10 +252,11 @@
cvv_result: build_cvv_result(payload['cvcResults']),
test: test?,
network_transaction_id: payload['id']
)
rescue ResponseError => e
+ logger&.error e.response.body
error_payload = parse(e.response.body)
Response.new(
false,
error_payload['message'],
{},
@@ -275,11 +276,11 @@
def authorization_from(payload)
payload.fetch('id', nil)
end
def post_data(_action, parameters = {})
- parameters.to_json
+ { merchantId: options[:merchant_id] }.merge(parameters).to_json
end
def commit_action_url(action, _parameters)
path = case action
when 'webhook' then '/webhook/v3/config'
@@ -304,11 +305,11 @@
return if data.blank?
CVVResult.new(data.fetch('gatewayMessage', {}).fetch('cvvresponse', nil))
end
- def build_payload(options)
- { data: { customer: {} } }.merge!(options.fetch(:payload, {}))
+ def build_payload(params)
+ { data: { customer: {} } }.merge!(params.fetch(:payload, {}))
end
def base_headers(custom = {})
{ Authorization: "Basic #{options[:auth_token]}" }
end