We're using In-App-Browser to open a payment gateway to recieve credit card and Apple Pay payments.
To communicate between the app and the payment gateway we use iab.executeScript(); and webkit.messageHandlers.cordova_iab.postMessage()
The payment gateway does use window.ApplePaySession to check if Apple Pay is available and initiate payments.
But it seems the usage of executeScript() does prevent Apple Pay from working. Before using executeScript the function ApplePaySession.canMakePayments() is set to true, after it's set to false.
The other way arround, when executing ApplePaySession.canMakePayments() first, it seems iab.executeScript(); is not working anymore.
It's probably a security functionality, but we were not able to find any examples or documentation on this.
Bug Report
Problem
We're using In-App-Browser to open a payment gateway to recieve credit card and Apple Pay payments. To communicate between the app and the payment gateway we use
iab.executeScript();
andwebkit.messageHandlers.cordova_iab.postMessage()
Our code:
The payment gateway does use
window.ApplePaySession
to check if Apple Pay is available and initiate payments. But it seems the usage ofexecuteScript()
does prevent Apple Pay from working. Before using executeScript the functionApplePaySession.canMakePayments()
is set to true, after it's set to false.The other way arround, when executing
ApplePaySession.canMakePayments()
first, it seemsiab.executeScript();
is not working anymore.It's probably a security functionality, but we were not able to find any examples or documentation on this.
Environment, Platform, Device
Platform is iOS13 on iPhone
Version information
Ionic:
Ionic CLI : 6.10.1 (C:\Users\morit\AppData\Roaming\npm\node_modules\@ionic\cli) Ionic Framework : ionic-angular 3.9.9 @ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1) Cordova Platforms : android 8.1.0 Cordova Plugins : cordova-plugin-inappbrowser 4.0.0, cordova-plugin-ionic 5.4.6, cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 14 other plugins)
Utility:
cordova-res (update available: 0.15.1) : 0.13.1 native-run : 1.0.0
System:
NodeJS : v12.16.2 (C:\Program Files\nodejs\node.exe) npm : 6.14.7
Checklist