ryandao/silverstripe-payment

Redirect URL

Closed this issue · 2 comments

Need to set the redirect URL in the Session so that on return from gateway payment controller can redirect.

Also need to consider - is using the Session robust enough? Do we need to persist the return URL to the database or similar (yuck) as a backup in case session is GC'd or cookies expire? Or do we just have a fallback mechanism that informs the user that session has expired or something similar.

Most applications would require a user to have a session before displaying order information? Or is that not the case with systems that allow customers to make purchases without creating member accounts?

This has been fixed: https://github.com/ryandao/silverstripe-payment/blob/1.0/code/PaymentProcessor.php#L305. I'm more leaning towards using session and having a fallback mechanism to inform the user. Saving the url in the database is a bit messy and not very relevant.

I think we can assume a session will last long enough to retrieve a redirect url when the user is redirected back. Need to make a note of this in documentation.

Also keep in mind that most gateway apis have some kind of lookup mechanism, which allows you to check back with the gateway server if payement has been successful. We haven't made specific provision for this in our architecture, otherwise I'd expect developers to connect during the gateway result handling phase.