Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
hapi-paypal
Advanced tools
Hapi Plugin for PayPal REST API's
const hapiPayPalOptions = {
routes: [
// Enable any routes supported by the plugin: https://github.com/trainerbill/hapi-paypal/blob/master/src/index.ts#L78
// Handler gets called after the paypal api call.
// Response from paypal is returned to your handler in the 3rd argument
{
config: {
id: "paypal_payment_create",
},
handler: (request: any, reply: any, response: any) => {
server.log(response);
reply(response);
},
},
// IF you enable webhooks you need a listener route. Handler gets called after receiving every webhook. We recommend saving to a database.
{
config: {
id: "paypal_webhooks_listen",
},
handler: (request: any, reply: any, response: any) => {
reply("GOT IT!");
},
},
],
sdk: {
// PayPal SDK Configuration: https://github.com/paypal/PayPal-node-SDK/blob/master/lib/configure.js
client_id: process.env.PAYPAL_CLIENT_ID,
client_secret: process.env.PAYPAL_CLIENT_SECRET,
mode: "sandbox",
},
// Enables webhooks
webhooks: {
event_types: [
{
// Any Webhook names you want enabled: https://developer.paypal.com/docs/integration/direct/webhooks/event-names/
name: "INVOICING.INVOICE.PAID",
},
{
name: "INVOICING.INVOICE.CANCELLED",
},
],
// Host name for webhooks. Must be SSL.
url: "https://www.yourwebhookdomain.com',
},
};
const hapiPaypal = {
options: hapiPayPalOptions,
register: new HapiPayPal(),
};
server.register(hapiPaypal);
FAQs
A hapi plugin to interface with PayPal Rest API's and webhooks.
We found that hapi-paypal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.