Error: No handler found for post message: xcomponent_init from <removed>

AnuragK
Contributor
Contributor

Hi,

 

We are trying to implement "Server Side PayPal Checkout using REST" using paypal.Button.render client side rendering method.

 

<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<div id="paypal-button" style="margin-top: 45px;"></div>

<script>paypal.Button.render({ env: 'sandbox', commit: true, locale: 'en_US', payment: function(data, actions) { return paypal.request.post('http://localhost:8181/xxxx/payment/PayPal?paypal_action=create').then(function(data) { return data.id; }); }, onAuthorize: function(data, actions) { return paypal.request.post('http://localhost:8181/xxxx/payment/PayPal?paypal_action=execute', { paymentID: data.paymentID, payerID: data.payerID }).then(function(resp) { if(typeof resp.successURL != 'undefined' && typeof resp.saleId != 'undefined') { window.location.replace(resp.successURL); } else { alert("An unexpected error occurred at PayPal. Please check your account if amount has not already been deducted and try again. If issue persists then contact support."); } }); }, onCancel: function(data, actions) { window.location.replace("http://localhost:8181/xxxx/payment/Response?resp=cancel"); }, onError: function(err, actions) { if (err === 'INSTRUMENT_DECLINED') { actions.restart(); } else { alert("An unexpected error occurred at PayPal. Please try again. If issue persists then contact support."); } } }, '#paypal-button');</script>

This worked for few days but then for unknown reason the paypal button started to disappear with error in browser console :

checkout.js:249 ppxo_xc_ppbutton_error {error: "Error: No handler found for post message: xcompone…://www.paypalobjects.com/api/checkout.js:2632:13)", timestamp: 1540994586213, windowID: "2aa989be43", pageID: "80c1e6239b", prev_corr_ids: "", …} 

 Error: No handler found for post message: xcomponent_init from https://www.sandbox.paypal.com in http://localhost:8181/dubaicompany/CMS-Frontend/payment/PayPal
    at https://www.paypalobjects.com/api/checkout.js:2536:37
    at Function.ZalgoPromise.try (https://www.paypalobjects.com/api/checkout.js:7841:37)
    at Object._RECEIVE_MESSAGE_TYPE.(anonymous function) [as postrobot_message_request] (https://www.paypalobjects.com/api/checkout.js:2535:40)
    at receiveMessage (https://www.paypalobjects.com/api/checkout.js:2611:60)
    at messageListener (https://www.paypalobjects.com/api/checkout.js:2632:13)
    at Object._RECEIVE_MESSAGE_TYPE.(anonymous function) [as postrobot_message_response] (https://www.paypalobjects.com/api/checkout.js:2569:31)
    at receiveMessage (https://www.paypalobjects.com/api/checkout.js:2611:60)
    at messageListener (https://www.paypalobjects.com/api/checkout.js:2632:13)

I tried to search through internet with solutions for such kind of issue but none worked in my case. PayPal technical support itself is very slow in responding.

 

Can anyone help please?

 

Thanks,

Anurag

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.