paypal sdk js create webhook
var webhook_json = {
url: 'https://f615ef32.ngrok.io',
event_types: [{
name: 'PAYMENT.SALE.COMPLETED'
},{
name: 'PAYMENT.SALE.DENIED'
}]
};
paypal.notification.webhook.create(webhook_json, function (error, webhook) {
if (error) {
console.error(JSON.stringify(error.response));
throw error;
} else {
console.log('Create webhook Response');
console.log(webhook);
}
});