Answers for "paypal sdk js create webhook"

1

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);
  }
});
Posted by: Guest on March-03-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language