lib/helpers/controller_helpers.rb in wepay-rails-0.1.56 vs lib/helpers/controller_helpers.rb in wepay-rails-0.1.57
- old
+ new
@@ -84,11 +84,10 @@
# :auto_capture No A boolean value (0 or 1). Default is 1. If set to 0 then the payment will not automatically be released to the account and will be held by WePay in payment state 'reserved'. To release funds to the account you must call /checkout/capture
# :require_shipping No A boolean value (0 or 1). If set to 1 then the payer will be asked to enter a shipping address when they pay. After payment you can retrieve this shipping address by calling /checkout
# :shipping_fee No The amount that you want to charge for shipping.
# :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(parms)
- create_checkout = wepay_gateway.perform_checkout(parms)
- response = JSON.parse(create_checkout.body)
+ response = wepay_gateway.perform_checkout(parms)
raise WepayRails::Exceptions::InitializeCheckoutError.new("A problem occurred while trying to checkout. Wepay didn't send us back a checkout uri") unless response && response.has_key?('checkout_uri')
redirect_to response['checkout_uri'] and return
end
end
end
\ No newline at end of file