A
A
axelt2021-06-29 13:43:41
PayPal
axelt, 2021-06-29 13:43:41

How to pass custom_id when using smart buttons in paypal?

Good afternoon, dear users.
How to pass custom_id when using smart buttons in paypal?
I tried many options, but nothing worked.
Here is the code that doesn't work. More precisely, payments come. people are debited, but IPN does not return custom_id to me and I cannot identify the user who paid.
I'm pretty sure the solution is simple, but I can't seem to find it (

<script>
 paypal.Buttons({
      style: {
          shape: 'rect',
          color: 'white',
          layout: 'vertical',
          label: 'subscribe'
      },
      createSubscription: function(data, actions) {
        return actions.subscription.create({
          /* Creates the subscription */
      plan_id: '**',
      custom_id: 'C3DXHQ',
        });
      },
      onApprove: function(data, actions) {
        console.log(data); // You can add optional success message for the subscriber here
      }
  }).render('#paypal-button-container'); // Renders the PayPal button
</script>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question