function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mahesh Tandan 6Mahesh Tandan 6 

visualforce paypal smart button <script> data send to controller

I'm Integrating with paypal using paypal smart button
everything is wokring fine all I want to send Order Id to controller How can I do this please help me SOMEONE

my visualforce page
<apex:page showHeader="false" controller="paypal_Integration">
     <script
    src="https://www.paypal.com/sdk/js?client-id=AdxbSNjRgSjzd***"> // Required. Replace SB_CLIENT_ID with your sandbox client ID.
  </script>
    
      <div id="paypal-button-container"></div>

<script>
  paypal.Buttons({
    createOrder: function(data, actions) {
      return actions.order.create({
        purchase_units: [{
          amount: {
            value: '0.01'
          }
        }]
      });
    },
    onApprove: function(data, actions) {
      return actions.order.capture().then(function(details) {
        alert('Transaction completed by ' + details.payer.name.given_name);

   //I want to send this to my controller

        alert('Order Id '+ data.orderID);




        });
      });
    }
  }).render('#paypal-button-container');
</script>
</apex:page>
all I want to send is data.orderId to my controller please help