Module: EZPaypal::Config
- Defined in:
- lib/config.rb
Class Method Summary (collapse)
- + (Object) EndPoint
- + (Object) Setting
-
+ (Object) Setup(options)
Setup config.
Class Method Details
+ (Object) EndPoint
14 15 16 |
# File 'lib/config.rb', line 14 def self.EndPoint @endpoint end |
+ (Object) Setting
7 8 9 |
# File 'lib/config.rb', line 7 def self.Setting @setting end |
+ (Object) Setup(options)
Setup config
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/config.rb', line 23 def self.Setup () # Setup account setting @setting={ "USER" => ["user"], "PWD" => ["password"], "SIGNATURE" => ["signature"], "VERSION" => ["version"] || 84.0, "CUSTOMERSERVICENUMBER" => ["customer_service_tel"] } # Setup endpoint express_checkout_endpoint = { "sandbox" => "https://api-3t.sandbox.paypal.com/nvp", "live" => "https://api-3t.paypal.com/nvp" } set_express_checkout = { "sandbox" => "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout", "live" => "https://www.paypal.com/webscr?cmd=_express-checkout", } @endpoint ||= {} if (["mode"] == 'sandbox') @endpoint.merge!("express_checkout_endpoint" => express_checkout_endpoint["sandbox"]) @endpoint.merge!("express_checkout_url" => set_express_checkout["sandbox"]) else @endpoint.merge!("express_checkout_endpoint" => express_checkout_endpoint["live"]) @endpoint.merge!("express_checkout_url" => set_express_checkout["live"]) end end |