Ruan
Ruan

Reputation: 4293

Ionic form action to redirect to internal application page

How would you redirect an "action" property on a form to another page in the ionic application?

Background: I'm using peach payments payment widget, and once the payment is done, it redirects you to any http or https site. Now for web, that's fine, but for ionic, that's obviously not that great.

Is there some internal http/s url Ionic uses to serve on the users phone for me to redirect to (don't think so), or is there some other way I haven't even thought about to redirect to another page in the users application?

  <form action="https://some-dumb-external-site-i-dont-want" class="paymentWidgets" data-brands="VISA MASTER AMEX"></form>

Edit: Using http://localhost:8080/xxxx, only works on Android and not IOS

Upvotes: 0

Views: 540

Answers (3)

moataz helwa
moataz helwa

Reputation: 1

Use sanitize.bypasssecuritytrustresourceurl(URL)

It worked with me

Upvotes: 0

Alex Steinberg
Alex Steinberg

Reputation: 1466

You might want to do the whole thing in an In-App Browser and let Peach Payments handle all the redirects there. Obviously, this isn't the best UX, but for hybrid it might be good enough.

There seems to be a way to do it using an iframe but this looks rather hacky and, perhaps, brittle and unmaintainable.

Upvotes: 0

Ruan
Ruan

Reputation: 4293

let url = document.URL.split('#')[0]

Should be something like http://localhost:8080/xxxx

Upvotes: 0

Related Questions