get saller id like payer.payer_id

adarelk2
Contributor
Contributor

hello guys,

i have a website shop and i have this code:

 

 

<script>
  paypal.Buttons({
      style: {
          shape: 'rect',
          color: 'blue',
          layout: 'vertical',
          label: 'pay',
          
      },
      createOrder: function(data, actions) {
          return actions.order.create({
              purchase_units: [{
                  amount: {
                      value:",3,"
                  }
              }]
          });
      },
      onApprove: function(data, actions) {
          return actions.order.capture().then(function(details) {
              alert('Transaction completed by ' + 
 details.payer.name.given_name + '!');
              
              $.ajax({
                url: 'thanks.php',
                type:'POST',
                data:{ cartItems:2,id:details.payer.payer_id},
                }).done(function() {
                  $('#thankYou').append('<h1 style=text-align:center;>Thank you</h1>');
                });
          });
      }
  }).render('#paypal-button-container');

 

 now i dont want to send the payer id with ajax after the paid, i want send my id account

how can i do that? 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.