15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'app/models/spree/payment_method/store_credit.rb', line 15
def authorize(amount_in_cents, store_credit, gateway_options = {})
if store_credit.nil?
ActiveMerchant::Billing::Response.new(false, Spree.t('store_credit_payment_method.unable_to_find'), {}, {})
else
action = -> (store_credit) do
store_credit.authorize(
amount_in_cents / 100.0.to_d,
gateway_options[:currency],
action_originator: gateway_options[:originator]
)
end
handle_action_call(store_credit, action, :authorize)
end
end
|