Long connection time with Javascript SDK API

Tomo_Developer
Contributor
Contributor

I am using following PayPal Javascript API SDK button.

When opening the payment website for the first time within a new web browser session, it takes about 30 seconds to connect to the PayPal service through the paypal button.

For each new refresh payment website it only takes a few seconds to connect to the paypal service. Please if you can help me with advice on how to reduce that first connection time to some reasonable limits.

I am using https environment for my html web site and only order function with paypal button without subscription.

Part of my javascript file with paypal button instance

    PayPal = paypal.Buttons({

        style: { 

          layout: 'vertical', 

          color:  'blue', 

          shape:  'rect', 

          label:  'paypal' 

        },

        createOrder: function(data, actions) {

            return actions.order.create({ 

              purchase_units: [{ amount: {currency_code:'EUR', value: ORDER_TOTAL }  }] 

            }); 

          },

         onApprove: function(data, actions) {     

            return actions.order.capture().then(function(details) {

              log('Transaction completed by ' + details.payer.name.given_name,3);

            });

          },

          onCancel: function (data) {

            log("Payment cancel by user",3) ;

          },

          onError: function (err) {

            log("Something goes wrong",3);

          }     

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

};

Thanks in advance,

Tomislav

 

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.