Failed to execute ‘postMessage’ on ‘DOMWindow’:

papaBurke
Contributor
Contributor

The complete error message is Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘https://www.sandbox.paypal.com’) does not match the recipient window’s origin (‘https://www.sandbox.paypal.com’)

 

The code is directly from the developer pages:

<script>  paypal.Buttons({
    createOrder: function(data, actions) {
      // This function sets up the details of the transaction, including the amount and line item details.
      return actions.order.create({
        purchase_units: [{
          amount: {
            value: '0.01'
          }
        }]
      });
    },
    onApprove: function(data, actions) {
      // This function captures the funds from the transaction.
      return actions.order.capture().then(function(details) {
        // This function shows a transaction success message to your buyer.
        alert('Transaction completed by ' + details.payer.name.given_name);
      });
    }
  }).render('#paypal-button-container');
  //This function displays Smart Payment Buttons on your web page.
</script>

 

The sandbox payment works in Safari but not Firefox.  The error message is displayed in Firefox's console as soon as the spinner in the pop-up window closes.  The payment page in the pop-up window loads and if I try to complete the transaction I see the 'Processing' and 'We're sending you back . . .' messages.  At that point the payment page reloads, as if it were a new payment.  This cycle continues until I close the pop-up window.

 

Any guidance or suggestions will be appreciated.

 

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.