BetterCommerce's PayPal NodeJS SDK enables BC client applications to integrate with PayPal merchant API system. It publishes an interface to interact with PayPal API v2 endpoints.
Use below command for package installation:
npm install @better-commerce/bc-paypal-sdk
Use following snippet to initialize the SDK:
PayPalEnvironment.init("<client_id>", "<app_secret>", [useSandbox: boolean]);
const order = new Order();
const result = await order.get("<order_id>");
{
id: '<order_id>',
intent: 'CAPTURE',
status: 'COMPLETED',
payment_source: {
paypal: {
email_address: '<email_address>',
account_id: '<account_id>',
name: [Object],
address: [Object]
}
},
...
...
...
}