Closed andufratu closed 4 years ago
Im having a CORS issue as well when using registerCard method on ionic 4 on chrome preview.
Hi @raphaelstz and @andufratu This issue is ongoing, we'll keep you updated, Max
Hi @andufratu , @raphaelstz Enacting changes to how our API, as well as that of banking partners, processes the origin header is not something we can easily enact. This resources talks about a few solutions https://fdezromero.com/cors-errors-in-ionic-apps/ We have prioritized this issue on our roadmap, but cannot give a delivery date at this stage. Best, Max
@mangomaxoasis, unfortunately those solutions can't be applied in this case, since the failing requests are made from the MangoPay library and we have no way to intercept them.
Hi ,
We are currently looking into a plugin for Cordova, but it's an ongoing subject.
Here is another solution, a bit more manual but still nice.
As the issue seems to be specific to IOS, for the card registration function (which is where the problem is, as it calls a banking partner from the front end) Can you try replacing JS code with code from the IOS card reg kit in objC.
https://github.com/Mangopay/cardregistration-ios-kit/blob/master/mangopay/MPAPIClient.h
Cordova offers the option of adding in native code where appropriate.
As such the request will come from the device, not necessarily the browser.
HI Guys, The inclusion of native code is what we deem the best solution in the medium term. I'm closing this issue. max
Hi,
we are running into issues with the CORS preflight request when using the library in a Ionic/Cordova project on iOS. As can be seen in the screenshot, Ionic uses a custom schema on iOS which does not pass the CORS preflight request on the MangoPay servers. Is there any way to bypass this error?
Thank you.