Module: PayFu::PaypalHelper

Defined in:
app/helpers/pay_fu/paypal_helper.rb

Instance Method Summary collapse

Instance Method Details

#redirect_to_paypal_gateway(options = {}) ⇒ Object



3
4
5
6
# File 'app/helpers/pay_fu/paypal_helper.rb', line 3

def redirect_to_paypal_gateway(options={})
  host = ActiveMerchant::Billing::Base.mode == "test" ? "www.sandbox.paypal.com" : "www.paypal.com"
  redirect_to URI.encode("https://#{host}/cgi-bin/webscr?cmd=_ext-enter&redirect_cmd=_xclick&charset=utf-8&business=#{PayFu::CONFIGS["paypal"]["email"]}&currenct_code=USD&item_name=#{options[:item_name]}&amount=#{options[:amount]}")
end