Jalay
Jalay

Reputation: 66

PayFort integration error with Phonegap/Cordova/Ionic

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.

This was in Ionic application, JS got downloaded but throwing this alert

Then when I tested my old demo PayFort app(with cordova) and debugged it, I found an error in console.

JS not downloaded in this one

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

Answers (1)

Gabriel Pavel
Gabriel Pavel

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

Related Questions