Paddle.Environment.set()
Sets environment to sandbox or live.
Use Paddle.Environment.set()
to set the environment for your checkout.
Only used to set the sandbox environment. If not present, Paddle uses the production environment.
You should call this method before calling any other Paddle.js methods, ideally just before your Paddle.Initialize()
call.
Parameters
environmentstring
Paddle environment that you're working with.
Examples
Checkout in sandbox environment
This example sets the environment to sandbox
.
123451Paddle.Environment.set("sandbox");
2Paddle.Initialize({
3 token: 'live_7d279f61a3499fed520f7cd8c08',
4 pwCustomer: { }
5});
Checkout in production environment
We recommend removing Paddle.Environment.set()
before going live.
This example doesn't set the checkout environment. Paddle defaults to production
.
12341Paddle.Initialize({
2 token: 'live_7d279f61a3499fed520f7cd8c08',
3 pwCustomer: { }
4});
Related pages
On this page