How to Use PayPal Subscriptions API with Node.js
Our Google add-on store uses PayPal Subscriptions with Digital Goods to process recurring payments and the invoices are sent to customers through Document Studio . There are two steps. Customers makes the payment and completes the order on our website. PayPal sends a BILLING.SUBSCRIPTION.ACTIVATED webhook to a serverless function. The function (running on Firebase, Google Cloud) verifies the subscription and checks if the status is active. It invokes the Apps Script API to complete the order. The cloud function was previously using the official PayPal SDK for Node.js but it has been recently deprecated and no longer supports the new PayPal subscriptions API endpoints. Migrating from the PayPal Node SDK to your own solution is relatively simple and involves two steps: 1. Get the PayPal Access Token const { default : axios } = require ( "axios" ) ; const getPayPalAccessToken = async ( ) => { const client_id = "PayPal Client ID goes here...