Pesapal.com

Forum

Welcome, Guest
Username
Password:
 

Seeing errors in the console: SAMEORIGIN
(1 viewing) (1) Guest
Welcome to the Pesapal integration forum!

This forum discusses everything about Pesapal integration on your web site. Having any problems? This is the right place to post a question and we are sure you will get an answer
  • Page:
  • 1

TOPIC: Seeing errors in the console: SAMEORIGIN

Seeing errors in the console: SAMEORIGIN 10 years, 5 months ago #1398

I'm trying to work on our application in development mode and we're seeing this error when clicking on the submit buttons in the PesaPal form.

 
[Error] Blocked a frame with origin "http://demo.pesapal.com" from accessing a frame with origin "http://localhost:3000". Protocols, domains, and ports must match.
[Error] Refused to display 'https://testsecureacceptance.cybersource.com/silent/pay' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. (postpayment, line 0)
 


Any idea why this has started to happen?

This is really slowing our development, and its not the first issue we've had with PesaPal - I'd appreciate some support.

Re: Seeing errors in the console: SAMEORIGIN 10 years, 5 months ago #1399

  • lazro
  • OFFLINE
  • Administrator
  • Pesapal
  • Posts: 404
Hello bodacious,


Please attach part of your code that loads the PesaPal iframe for further assistance.
Regards,

Lazaro Ong'ele
Web Developer

Skype: Lazrotep
+254-020-249-5438 ; +254-706-191-729
Dagoretti Lane, Off Naivasha Road.

Facebook: www.facebook.com/pesapal
Twitter: twitter.com/PesaPal
Helpdesk: support.pesapal.com
This e-mail address is being protected from spambots. You need JavaScript enabled to view it.

Re: Seeing errors in the console: SAMEORIGIN 10 years, 4 months ago #1418

Hi — here's the code.

The user clicks a button which loads the iframe to the page via JavaScript.

 
<a href="#" class="btn btn-cta btn-block btn-lg complete_order_button" data-iframe-src="http://demo.pesapal.com/API/PostPesapalDirectOrderV4?oauth_callback=http%3A%2F%2Flocalhost%3A3000%2Forders%2FIWULURYL%2Fpayments%2Fcomplete&amp;pesapal_request_data=%26lt%3B%3Fxml+version%3D%26quot%3B1.0%26quot%3B+encoding%3D%26quot%3Butf-8%26quot%3B%3F%26gt%3B%26lt%3BPesapalDirectOrderInfo+xmlns%3Axsi%3D%26quot%3Bhttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchemainstance%26quot%3B+xmlns%3Axsd%3D%26quot%3Bhttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%26quot%3B+Amount%3D%26quot%3B7200%26quot%3B+Description%3D%26quot%MyApp+Order%3A+IWULURYL%26quot%3B+Type%3D%26quot%3BMERCHANT%26quot%3B+Reference%3D%26quot%3BRGILESNS%26quot%3B+FirstName%3D%26quot%3B%26quot%3B+LastName%3D%26quot%3B%26quot%3B+Email%3D%26quot%3Bme%40myemail.com%26quot%3B+PhoneNumber%3D%26quot%3B%26quot%3B+xmlns%3D%26quot%3Bhttp%3A%2F%2Fwww.pesapal.com%26quot%3B+%2F%26gt%3B&amp;oauth_consumer_key=[HIDDEN]&amp;oauth_signature_method=HMAC-SHA1&amp;oauth_timestamp=1434625856&amp;oauth_nonce=[HIDDEN]&amp;oauth_version=1.0&amp;oauth_signature=YwrSdv7VdHSIUFEv0a0LuesO7II%3D">Complete order</a>
 


The iframe URL is stored in a data attribute on the link itself, and then loaded to the page with the following code:

 
jQuery(function() {
return $('body').on("click", '.complete_order_button', function(e) {
var $link, pesa_pal_iframe;
e.preventDefault();
$link = $(this);
pesa_pal_iframe = new PesaPalIFrame($link.data('iframe-src'));
return $(this).replaceWith(pesa_pal_iframe.html);
});
});
 
this.PesaPalIFrame = (function() {
function PesaPalIFrame(src) {
this.src = src;
this.html = "<h3>Pay securely with PesaPal</h3>\n&lt;iframe id='pesa_pal_payment' src='" + this.src + "' width='100%' height='860px' \n scrolling='no' frameBorder='0'&gt;\n \n <p>\n Unable to load the payment page.<br>\n If this problem persists, please <a href='/contact_us'>contact us</a>.\n </p>\n";
}
 
return PesaPalIFrame;
 
})();
 



Hopefully that makes sense?

The payment seems to complete but the Javascript I'm writing around the frame being loaded is interptuped because of these errors in the console
Last Edit: 10 years, 4 months ago by bodacious.
  • Page:
  • 1