#ahmed_delta - ACH sample

1 messages ยท Page 1 of 1 (latest)

uncut nacelle
#

Hello, happy to help. I am not immediately familiar with that sample but am looking in to it. Is the sample supposed to redirect like that by default or is this a modification that you are adding yourself?

crimson thistle
#

Hi Pompey, thanks for your help! This is a modification I am adding myself.

#

The stripe payment portion works fine. However, I get error when I try to redirect a user to another page. Initially, I tried to redirect a user via a form post. However, that failed. So I figured fetch might work instead. That failed too unfortunately.

#

I'm sure if I can see an example of someone using flask/django redirecting their user to another page, then I should be able to figure it out on my own. Thanks!

uncut nacelle
#

Can you tell me more about how it failed? Did you get an error message somewhere?

#

Can you send me your code snippets that you tried out for this as well?

crimson thistle
#

Sure thing. Can you add me as a friend so I can share the snippets?

#

Please give me about 10 minutes to clean up my code and generate the error again.

uncut nacelle
#

I'd prefer you share your snippets in this thread if possible. It will be easier to share if I have to pass this off to a colleague. Of course redact any API keys or anything

crimson thistle
#

No problem. I'm doing that right now ๐Ÿ™‚

#

here is my success page

#

and in the stripe javascript code, I attempt to enter the success page with the following code

#

however, my page doesn't redirect

#

I hope that helps explain the problem.

uncut nacelle
#

Does your client page see the URL that you are trying to pass back to it?

#

It may also be worth it to do a server side redirect instead of a client side one here

crimson thistle
#

Yes it does. In the developer tools, it shows the request as status code 200. However, it doesn't re-direct to it.

uncut nacelle
#

Do you have js code on the client side that redirects to the URL in that json?

#

That will tell the browser to redirect as soon as it gets the response instead of relying on client side js

crimson thistle
#

I see. Okay, I'll take a look at that.

#

I initially thought I was doing a server side redirect because in my flask code, I have a route that renders the template 'success.html'

#

Something else I just noticed is that the page does load on the developer tools. However, I can't get it to load to the user

uncut nacelle
#

Can you send your client side code hat reaches out to the endpoint that you want to redirect?

crimson thistle
#

yes, it's this.

#

let me know if you were looking for something else

uncut nacelle
#

That is it. I am bouncing around a couple other threads but should be able to look in to this again in a few minutes.

crimson thistle
#

No problem at all. I am trying my own workarounds. I'll let you know if I end up solving it before you.

#

Figured it out!

#

inelegant solution, but I ended up creating a new form within payment.status == 'processing' and submitted it from there

uncut nacelle
#

Nice!

crimson thistle
#

I'm hoping I don't run into more issues, but if I do, I'll let you know. Thanks again! ๐Ÿ™‚