1
This commit is contained in:
parent
2a96c0ab55
commit
1b8a26fafe
@ -47,12 +47,13 @@ async function webhooks(req, rsp) {
|
||||
|
||||
const events = [];
|
||||
let sdkEnv = config.Environment.PRODUCTION;
|
||||
if (utils.isOnlineEnv()) {
|
||||
if (!utils.isOnlineEnv()) {
|
||||
console.log('SANDBOX Environment');
|
||||
sdkEnv = config.Environment.SANDBOX;
|
||||
}
|
||||
await webhook.handle( // this method will handle the subscription confirmation and signature & sender verification
|
||||
req.body,
|
||||
config.Environment.SANDBOX, // or config.Environment.PRODUCTION
|
||||
sdkEnv, // or config.Environment.PRODUCTION
|
||||
{
|
||||
all: (event) => { // all events will trigger this handler, even if they have a specific handler already.
|
||||
events.push(event);
|
||||
|
Loading…
x
Reference in New Issue
Block a user