
Let's say you are using of the PayPal checkout APIs.
- PayPal - Checkout using Node.js on Docker with Flask
- PayPal - Advanced integration checkout using Node.js and Flask on Docker
- PayPal - Advanced integration checkout using Node.js
- PayPal - Advanced integration checkout using Node.js on Docker
- PayPal - Standard integration checkout using Node.js on Docker
And something like this is being returned.
Error: p is not a function
I typically saw this when the systems at play were not using the same PayPal Client ID and Secret. For example, let's say you have an HTML page running on an HTTP web server which uses the PayPal Node.js client to present the PayPal checkout form. Upon entering data into the PayPal checkout form a request is made to a PayPal Flask server which returns a response to the PayPal Node.js client and the HTTP web server does something with the response, such as saying "order successfully placed.

In this scenario the HTML page running on the HTTP web server would have something like this. Notice the Client ID is abc123.
<script src="https://www.paypal.com/sdk/js?components=buttons,card-fields&client-id=abc123"></script>
Flask PayPal server would have something like this. Notice the Client ID is different, xyz123 in this example. This almost always caused "Error: p is not a function" to be returned by the Node.js PayPal client (checkout.js).
paypal_client: PaypalServersdkClient = PaypalServersdkClient(
client_credentials_auth_credentials=ClientCredentialsAuthCredentials(
o_auth_client_id='xyz987',
o_auth_client_secret='123456'
Did you find this article helpful?
If so, consider buying me a coffee over at