V
V
VoisHunter2019-05-13 21:51:04
Angular
VoisHunter, 2019-05-13 21:51:04

How to solve Error: Mode must be "sandbox" or "live"?

Good evening everyone!
I ran into a problem when starting a project on Node.js, I give an error below, I don’t know where to dig

Error: Mode must be "sandbox" or "live"
    at Object.configure (/var/www/html/сайт/node_modules/paypal-rest-sdk/lib/api.js:26:15)
    at Object.configure (/var/www/html/сайт/node_modules/paypal-rest-sdk/lib/paypal-rest-sdk.js:10:13)
    at Object.PayPalConfig [as default] (/var/www/html/сайт/dist-server/server/service/payments-systems/paypal/config.js:5:12)
    at new PaypalPayment (/var/www/html/сайт/dist-server/server/service/payments-systems/paypal/payment.js:50:25)
    at new PricingController (/var/www/html/сайт/dist-server/server/controller/pricing/pricing.controller.js:54:30)
    at new PricingRoute (/var/www/html/сайт/dist-server/server/routes/pricing.route.js:61:27)
    at Object.<anonymous> (/var/www/html/сайт/dist-server/server/routes/pricing.route.js:236:19)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function._load (/usr/lib/node_modules/pm2/node_modules/@pm2/io/build/main/metrics/httpMetrics.js:172:43)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/var/www/html/сайт/dist-server/server/app.js:24:23)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Pikat, 2019-05-13
@VoisHunter

There is a bug in the PayPal SDK that is being used somewhere in your code. At least it is this SDK that complains about the wrong config. The "mode" parameter in the config must have one of two values, either "live" or "sandbox". In your case, there doesn't seem to be anything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question