A
A
Artur Lastname2020-02-19 13:37:07
JavaScript
Artur Lastname, 2020-02-19 13:37:07

How to correctly send a custom field via smart button to get it in IPN?

I'm trying the option that Google gave me, namely, I add after AMOUNT - custom, but the IPN comes with an empty custom field (the transaction_subject field is also empty)

paypal.Buttons({

                            // Set up the transaction
                            createOrder: function(data, actions) {
                                return actions.order.create({
                                    purchase_units: [{
                                        amount: {
                                            value: dataResponse.value
                                        },
                                        custom: dataResponse.uuid 
                                    }]
                                });
                            },

                            // Finalize the transaction
                            onApprove: function(data, actions) {
                                return actions.order.capture().then(function(details) {
                                    // Show a success message to the buyer
                                    alert('Transaction completed by ' + details.payer.name.given_name + '!');
                                });
                            }


                        }).render('#paypal-button-container');


I didn’t find something in the docks either, there are a lot of examples where you list the inputs yourself, but I need the implementation through the button render.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artur Lastname, 2020-02-20
@Kekemeke

I found an error (but honestly I didn’t understand why it was necessary):
You need to write custom_id in the props of purchase_units instead of just custom .
The IPN will be recorded in the CUSTOM field.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question