Feature request: ability to set different return and cancel urls
RytisPasaravicius opened this issue · 5 comments
Expected Behavior
Return and cancel url should not be same, at least there should be option to change it
Actual Behavior
Request url is used as RETURN and CANCEL
Steps to Reproduce the Problem
- Just add one more parameter for cancel url to IPizza.php __contruct() method
Can you elaborate why this would be necessary? You can check if return was successful with $response->wasSuccessful()
and redirect if necessary.
Of course this can be done, but would be breaking change. If you can provide real use case for this, I can implement this.
i could do this, but it would be much easier to have that parameter, get rid of one redirect. Maybe it is not worth of it, but it would be nice. Just sharing my opinion :)
Sharing opinions is always welcomed. Thanks!
I just thought that it has some certain case where you can't use this library at all if that's not implemented.
I will mark this issue as help needed and milestone to v4.0 since this is breaking change. We can implement this then.
Actually, I came up with workaround for you if you still want different URLs. Since you can override request data, you can also override VK_CANCEL
. See README and Wiki. Example:
$request = $bankInstance->getPaymentRequest(123453, 150, 'Example payment', 'EST', 'EUR', [
'VK_CANCEL' => 'https://my.custom.cancel.url'
]);
Thanks, i will try :)