Page 1 of 1

redirect url asks for appery login

Posted: Wed Mar 25, 2015 1:47 pm
by Cat

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 --


redirect url asks for appery login

Posted: Wed Mar 25, 2015 1:49 pm
by Cat

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!


redirect url asks for appery login

Posted: Wed Mar 25, 2015 2:16 pm
by Illya Stepanov

Hi Cat -

Try test it without a mobile-frame.


redirect url asks for appery login

Posted: Wed Mar 25, 2015 4:29 pm
by Cat

Hello,

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


redirect url asks for appery login

Posted: Wed Mar 25, 2015 4:37 pm
by Cat

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


redirect url asks for appery login

Posted: Sun Mar 29, 2015 3:22 pm
by Cat

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...