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
},
],
});
},.....