Shorten ppx_auth_response inside paypal_finish
This commit is contained in:
parent
78360afc5c
commit
5ff0bbe4e0
|
@ -116,11 +116,8 @@ module Spree
|
||||||
opts = { :token => params[:token], :payer_id => params[:PayerID] }.merge all_opts(@order, params[:payment_method_id], 'payment' )
|
opts = { :token => params[:token], :payer_id => params[:PayerID] }.merge all_opts(@order, params[:payment_method_id], 'payment' )
|
||||||
gateway = paypal_gateway
|
gateway = paypal_gateway
|
||||||
|
|
||||||
if Spree::Config[:auto_capture]
|
method = Spree::Config[:auto_capture] ? :purchase : :authorize
|
||||||
ppx_auth_response = gateway.purchase((@order.total*100).to_i, opts)
|
ppx_auth_response = gateway.send(method, (@order.total*100).to_i, opts)
|
||||||
else
|
|
||||||
ppx_auth_response = gateway.authorize((@order.total*100).to_i, opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
paypal_account = Spree::PaypalAccount.find_by_payer_id(params[:PayerID])
|
paypal_account = Spree::PaypalAccount.find_by_payer_id(params[:PayerID])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue