Search code examples
node.jspaypal

how to include user data like its DB id before creating and capturing order in paypal v2 node.js


I'm trying to build flutter e-commerce application backend node.js which has PayPal integration and I'm using the V2 version since v1 is deprecated and I don't know where to insert a unique identifier like its DB id for the user when I create the order then I will identify which user pay the payment when I capture the order I'm using the @paypal/checkout-server-SDK package to handle the backend. sorry for my English


Solution

  • If you need the information to be stored as part of the PayPal order record, you can specify a custom_id when creating the order.

    If you just need to keep track of the ID between creation and capture steps, there are many ways to store information temporarily in node, including in a web session, for instance using express-session. There are many tutorials.