lib/helpers/controller_helpers.rb in wepay-rails-2.1.0 vs lib/helpers/controller_helpers.rb in wepay-rails-2.2.0
- old
+ new
@@ -39,21 +39,22 @@
# :charge_tax No A boolean value (0 or 1). If set to 1 and the account has a relevant tax entry (see /account/set_tax), then tax will be charged.
def init_checkout_and_send_user_to_wepay(params, access_token=nil)
wepay_gateway = WepayRails::Payments::Gateway.new(access_token)
response = wepay_gateway.perform_checkout(params)
- if response['checkout_uri'].blank?
+ if response[:checkout_uri].blank?
raise WepayRails::Exceptions::WepayCheckoutError.new("An error occurred: #{response.inspect}")
end
params.merge!({
- :access_token => wepay_gateway.access_token,
- :checkout_id => response['checkout_id']
+ :access_token => wepay_gateway.access_token,
+ :checkout_id => response[:checkout_id],
+ :security_token => response[:security_token]
})
WepayCheckoutRecord.create(params)
- redirect_to response['checkout_uri'] and return
+ redirect_to response[:checkout_uri] and return
end
end
end
end