79391826

Date: 2025-01-27 18:40:44
Score: 0.5
Natty:
Report link

For records. If you need to pass some custom field within PayPal payment event, it can be done via adding custom_id field in purchase_units array:

        createOrder: function (data, actions) {
            const amount = "100";
            const description = 'product description';
            return actions.order.create({
                purchase_units: [
                    {
                        amount: { value: amount },
                        description: description,
                        custom_id: emailInput.value, // Pass anything as as custom ID, I am passing email here as an example
                    },
                ],
            });
        },.....
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Tigran