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">
    src="***"> // Required. Replace SB_CLIENT_ID with your sandbox client ID.
      <div id="paypal-button-container"></div>

    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 ' +;

   //I want to send this to my controller

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

all I want to send is data.orderId to my controller please help