feature: enable 'live' API mode

This commit is contained in:
AJ ONeal 2021-10-16 23:17:49 -06:00
parent 5fe43c4a48
commit 2abfd7fc5e
1 changed files with 8 additions and 2 deletions

View File

@ -19,8 +19,14 @@ PayPal.init = function (client_id, client_secret, env, opts) {
opts.prefer = "return=representation";
}
PayPal.__sandboxUrl = "https://api-m.sandbox.paypal.com";
PayPal.__baseUrl = PayPal.__sandboxUrl;
PayPal.__sandboxApiBaseUrl = "https://api-m.sandbox.paypal.com";
PayPal.__liveApiBaseUrl = "https://api.paypal.com";
if ("live" === env) {
PayPal.__baseUrl = PayPal.__liveApiBaseUrl;
} else {
PayPal.__baseUrl = PayPal.__sandboxUrl;
console.debug("[PayPal Checkout] ENVIRONMENT=sandbox");
}
PayPal.__id = client_id;
PayPal.__secret = client_secret;
PayPal.__defaultQuery = {