Ionic Webview data parsing - ionic-framework

I have a doubt in Ionic webview.
For example: if am creating an app like paytm, then after clicking 'proceed to pay' button, it'll redirect to the webview of some payment gateways --> after that the gateway gives a response, which we get in our app.
Here, while redirect to the gateway webview what kind of parameters to be send and what kind of responses we can get back from the webview.
Thanks in advance!

You can send a thing like a cart unique id to the webview via get params.
Example : http://www.example.com/cart?id=1234
And you can get something, like payment ok with a specific url
http://www.example.com/cart/success
And track that url to get out of the gateway.

Related

How to prevent Auth0 to redirect after logout (ionic app)

I am working on an Ionic 6 app that uses Auth0 for authentication. We are using the embedded login strategy and auth0-js as the client library to talk with auth0.
I've reached to the point where everything works nice if I serve the app on an emulator via ionic serve. I can login and logout effortlessly, and authjs' logout method, which I'm calling as follows:
public logout() {
store.dispatch('endSession');
this.endSession();
this.webAuth.logout({
returnTo: process.env.VUE_APP_LOGOUT_CALLBACK,
clientID: clientId,
});
}
Does redirect me to http://localhost:3000/login as intended (that's the value of VUE_APP_LOGOUT_CALLBACK).
However, when I compile the app and launch it on a mobile phone (I'm using android studio) I have the following problem:
My current problem
After calling WebAuth.logout, the app stops and a browser tab pointing to localhost:3000/login tries to open as if it was a website I'm navigating to. But the behavior I want is for the app to return to the login page, of course.
Other users seem to have found the same issue:
https://community.auth0.com/t/logout-on-ionic-3/20222/9
https://community.auth0.com/t/impossible-to-redirect-user-after-logout-ionic-angular/82205
But no one really solved the issues in those threads. I had no luck finding more resources related to this.
What I've tried
I've tried changing the redirect route to capacitor://localhost/login, hoping it's a way to tell the ionic shell to navigate inside the context of the app, but it didn't work.
I've tried to avoid passing redirectTo as an option to WebAuth.logout(). This makes the method to redirect to the first URL set up on the Auth0 dashboard allowed logout URL, as far as I know.
I've played with a lot of different URL's as returnTo, like / or /login, but it didn't work as I expected and the browser always tries to open such URL as a new website, instead of navigating in the context of the running app.
What would be the ideal outcome
I'd like the app to return to /login, which is the first view the user encounters when they launch the app on the phone.
If that's not possible, maybe it would be possible to just get Auth0 to not redirect at all, so I can perform the redirect by myself and send the user back to the login page.
Maybe there's a way to tell my app not to ever redirect to the redirectUri, even if there's no way for auth0 to avoid trying to redirect the app to another page? Auth0-js docs don't suggest any way to avoid the redirect, but maybe there's a way via ionic config or javascript to make sure the app won't ever redirect to a certain URL.
Thanks for your time!

Flutter web: Webview with payment gateway not working

I have created a flutter web app running in chrome, in which I have used webview for calling the payment gateway(which we have set in the backend server).
In that URL after entering card details we redirect it to moyasar url at that time it throws an error as follows:-
Refused to display 'https://api.moyasar.com/' in a frame because it
set 'X-Frame-Options' to 'sameorigin'.
Looks like you are displaying the URL in an iframe. Make sure you are displaying the URL directly on the web view component.

PayPal Payment COMPLETE on a static HTML/JS website with no server backend. How to render a completed payment page?

I am building a static website using only JS HTML CSS and a touch of JQuery. I have a PayPal button that works in the PayPal sandbox and charges my mock user but I can't figure out how to change anything after payment is complete.
I would like the page to redirect to a payment complete page with the order details. Is it as simple as setting up the SANDBOX APP SETTINGS URL and custom building a page with that URL?
I'll assume you are using something like this client-side integration.
Inside the onApprove function, in the .then() of you actions.order.capture, you can use actions.redirect('otherPage.html')
Alternatively, rather than redirecting and for more of a single page application feel you can rewrite the DOM and replace the contents of <body> or your main container div using jQuery.
$('body').html('<h2>Thanks for your order!</h2>');

Open a url from flutter with long list or URL parameters

I need to open a web page from flutter, and need to somehow pass a long list of data. I am currently creating a URL programmatically and passing the data through url parameters (ex www.mysite.com?param1=something&param2=... and opening the url with the url_launcher plugin. This is working just fine, until I create a url that is too long (which happens once in a while) giving me a http 431 error. I own the web page that I need to open, and can modify the way I am receiving data (get, post, etc).
A post request seems to be a better method than what I’m currently doing, but I’m lost as to how to send this data to the site within the body of a post request, and then open the site with this preloaded data.
Any help/ideas would be greatly appreciated!

How to make my iOS application handle web links

I have to make my application handel web like (juste like a web browser).
I add CFBundleURLTypes to my plist file and then in CFBundleURLSchemes I put http and CFBundleURLName com.mydomaine.myapp.
Then I tried to send a SMS with a web link : It's stil open Safari when I clicked the received link !
This work great with a custom schema : myapp://mylink.com ! but the problem is : I have to send SMS with links to my app users and then they can click those links and open myapp who do stuff flowing links contente ! the Message app dont recognize cutome url schema as a clickable link ! So the only solution I found is to make this operation using http link !
(I know that my problem can be solved using APN! but for some reasons I cant use it !)
Thank you for your help !
You can't override http links to redirect to your app; that would break a lot of other pieces of the system.
You should send them a http link which goes to a server you set up. That server can then redirect the users to your custom link scheme, or offer to let them download the app, etc.