Reputation: 66
Before some days when I tried to implement PayFort payment gateway with my Phonegap based app, I was able to initialize their default popup.
However, when I tried the same thing today, I started to receive alerts and errors.
Then when I tested my old demo PayFort app(with cordova) and debugged it, I found an error in console.
Why did it stopped working all of a sudden? Did they updated their JS recently? Because app will download a fresh JS file every time from their server.
Has anyone faced this problem? Or any idea if I'm doing something wrong or missing something?
Thank you!
Upvotes: 0
Views: 785
Reputation: 41
First of all, if it’s possible, please, use our mobile SDKs for iOS and Android:
https://github.com/payfort/start-ios-sdk
https://github.com/payfort/start-android-sdk
Second, for your error.
As far as I see from its description you have sent 'Content Security Policy’ header from your server that renders index.html. Maybe it's default setting in your webserver.
Your policy is set as following:
Content-Security-Policy: default-src ‘self'
and it means: allow only content that comes from the site's own origin.
You can read more about it here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
As a solution, you have to update the header to this:
Content-Security-Policy: default-src 'self’ beautiful.start.payfort.com
Upvotes: 1