Cat
Posts: 0
Joined: Wed Sep 25, 2013 11:01 am

redirect url asks for appery login

Hello,

I need a little guidance on how to integrate a payment system (it is similar to PayPal).

It is working perfectly in browser, but off course have the problem on device that window.open / childbrowser needs to be used to successfully return from the external https back to the app without going showing the appery-login page.

I have looked at similar discussions:
https://getsatisfaction.com/apperyio/...
https://getsatisfaction.com/apperyio/...
https://getsatisfaction.com/apperyio/...
https://getsatisfaction.com/apperyio/...

but am still unsure how to go about this.

At the moment when user clicks on "pay" a popup shows which contains an html button (where all the form data and calculations are made and invokes on click the external link). One is then taken to the payment system, but the redirect page gives the following error in mobile frame tester:

Uncaught SecurityError: Blocked a frame with origin "http://appery.io" from accessing a frame with origin "https://sandbox.payfast.co.za". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.

payment?SESSID-eng-sb=q7p14b316je4qvgf2mc178gej1:1 Refused to display 'https://sandbox.payfast.co.za/eng/pro...' in a frame because it set 'X-Frame-Options' to 'deny'.
jquery-1.8.2.min.js:2 Uncaught SecurityError: Sandbox access violation: Blocked a frame at "http://appery.io" from accessing a frame at "https://sandbox.payfast.co.za". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag.

in Appery.Tester one is redirected to Appery login, but it shows no errors with weinre.

The html is as follows:

<!-- Receiver Details --

<!-- Transaction Details --

Cat
Posts: 0
Joined: Wed Sep 25, 2013 11:01 am

redirect url asks for appery login

The html is as follows:

form action="https://sandbox.payfast.co.za/eng/pro..." method="post" name="frmPay" id="frmPay"

!-- Receiver Details --
input type="hidden" name="merchant_id" id="merchant_id" value="xxx"
input type="hidden" name="merchant_key" id="merchant_key" value="xxx"
input type="hidden" name="return_url" value="http://appery.io/app/view/xxx/afterpa..."
input type="hidden" name="cancel_url" value="http://appery.io/app/view/xxx/cancelp..."

!-- Transaction Details --

input type="hidden" name="amount" id="amount" value=""
input type="hidden" name="item_name" id="item_name" value="Study guide"

/form

script type="text/javascript"

Code: Select all

  document.getElementById("frmPay").onsubmit = function() { 

// lots of calculations here ...
// I tried adding here some versions of the window.open codes without success, unsure how to change it in relation to above form action

Any ideas and direction will be much appreciated!

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

redirect url asks for appery login

Hi Cat -

Try test it without a mobile-frame.

Cat
Posts: 0
Joined: Wed Sep 25, 2013 11:01 am

redirect url asks for appery login

Hello,

In the test browser without mobile-frame everything works perfectly. (redirects correctly and process completes as it should)

Cat
Posts: 0
Joined: Wed Sep 25, 2013 11:01 am

redirect url asks for appery login

(oh and no errors in console when without mobile-frame)

Cat
Posts: 0
Joined: Wed Sep 25, 2013 11:01 am

redirect url asks for appery login

In case anyone else comes across this problem ('X-Frame-Options' to 'DENY' etc), it IS do-able; just a huge mission :)

https://devcenter.appery.io/documenta...

http://www.slideshare.net/SlexAxton/b...

Return to “Issues”