2

I have created a dot net maui app. I'm using an external payment service called payfast.

When I want to make a transaction it directs me to a different page on the browser where I make my transactions. When the transactions are complete, I need to redirect back to the maui app.

The issue is that the service does not allow maui's url for example "myapp://". I get an error 400 bad request. "return_url: The return url format is invalid"

I tried to let it redirect to my API which is successful, but then I can't redirect the API back to my app

I have tried both return RedirectToPage("myapp://") and Request.HttpContext.Response.Redirect("myapp://") but it does not redirect back to my app

  • is your apps custom url scheme registered with the OS? – Jason Jan 12 '23 at 14:17
  • It is yes, in the mainactivity class I have registered it there: DataScheme = CALLBACK_SCHEME)] public class MainActivity : MauiAppCompatActivity { const string CALLBACK_SCHEME = "myapp"; } – Etienne van Heerden Jan 12 '23 at 14:48
  • According to [this case which has the similar issue](https://stackoverflow.com/questions/49857050/http-302-redirect-to-deep-link-does-not-work-in-android), the cause seems to be the browser. – Liyun Zhang - MSFT Jan 16 '23 at 09:41

0 Answers0