mardi 4 août 2020

Paypal Checkout with a Product_Id

I'm currently using the Smart Checkout Button from Paypal to purchase Customer.

I'm also listening for Webhook Notification.

Everything is working fine, but my problem is that I have multiple products the User can buy. So I need to get an information about the product in my Webhook.

Is there any way to create products in Paypal like in Stripe or to put some extra values like product id to the Checkout, so that I know which product the user bought.

I tried it with some fields like "item" below, but I could'nt access them inside my webhook.

  var button = paypal.Buttons({
    fundingSource: fundingSource,
    createOrder: function(data, actions) {
  // This function sets up the details of the transaction, including the amount and line item details.
  return actions.order.create({
    purchase_units: [{
      amount: {
        currency_code: 'EUR',
        value: '0.69'
      },
      item:"product_id12345"
    }]
  });
}
  });



Aucun commentaire:

Enregistrer un commentaire