Search code examples
javascriptreactjspaypal-sandboxpaypal

Paypal Express Checkout / React - Send Product Information


I'm working on a shop app that I want to use Paypal with to checkout.

I have installed this very nifty React implementation of the Express Checkout Button - https://www.npmjs.com/package/react-paypal-express-checkout

After setting up my merchant account, developer app, and sandbox accounts it was working right away.

The only issue I'm running into is that my app has a built-in cart; Keeping track of what items the user intends to purchase and what options they have selected for each one ( Color, size, quantity, etc ), and the seller needs to know this information so they can ship the correct products.

I was wondering if there is a way I could send some additional information with the purchase to let the seller know what products the user has purchased and what options they have selected. If somehow I could just send one extra string to appear in the seller's account I could easily attach the user's cart info.

Sorry if this is a noob-ish question. I am still fairly new to web-dev.


Solution

  • So I found in the documentation that you can send a table of items using item_list. With each item you can attach a name, as well as a list of options ( size, color, etc,. ) But I cannot find how to format this list in the documentation, and no one seems to know.

    So as a workaround I am just attaching the options to the name so the buyer and seller can see a full list of every item and their options.

    Here's what it looks like in your paypal transaction - enter image description here

    If anyone needs to use this I forked the node package above and implemented this functionality. Hopefully this can help someone trying to implement paypal into their react shop.