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 (options)
@setting={
"USER" => options["user"],
"PWD" => options["password"],
"SIGNATURE" => options["signature"],
"VERSION" => options["version"] || 84.0,
"CUSTOMERSERVICENUMBER" => options["customer_service_tel"]
}
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 (options["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
|