lib/active_merchant/billing/gateways/nexio.rb in nexio_activemerchant-0.1.0 vs lib/active_merchant/billing/gateways/nexio.rb in nexio_activemerchant-0.1.1
- old
+ new
@@ -36,29 +36,32 @@
OneTimeToken.new(token, Time.parse(expiration), fraud_url)
end
def purchase(money, payment, options = {})
post = build_payload(options)
+ post[:processingOptions] ||= {}
+ post[:processingOptions][:verboseResponse] = true if test?
add_invoice(post, money, options)
add_payment(post, payment, options)
add_order_data(post, options)
commit('process', post)
end
def authorize(money, payment, options = {})
purchase(money, payment, options.merge(payload: options.fetch(:payload, {}).merge(isAuthOnly: true)))
end
- def capture(_money, _authorization, _options = {})
- commit('capture', post)
+ def capture(money, authorization, _options = {})
+ commit('capture', { id: authorization, data: { amount: amount(money).to_f } })
end
- def refund(_money, _authorization, _options = {})
- commit('refund', post)
+ def refund(money, authorization, _options = {})
+ commit('refund', { id: authorization, data: { amount: amount(money).to_f } })
end
+ alias credit refund
- def void(_authorization, _options = {})
- commit('void', post)
+ def void(authorization, _options = {})
+ commit('void', { id: authorization })
end
def verify(credit_card, options = {})
MultiResponse.run(:use_first_response) do |r|
r.process { authorize(100, credit_card, options) }