How to customize DIBS.config to redirect to localized url
Hi..
I finally integrated the DIBS as a payment API. In DIBS.config we have to set acceptUrl and cancelUrl to handle the success and error resp. So I am redirecting user to payment confirmation page and error page in resp scenarions. But now I am not getting how to set accept url and cancel url as per my selected localization. How should I set such localized urls in DIBS.config?
The relative urls works by simply checking if the configured urls starts with "http://" or "https://". If not, the Scheme and Host from the current context is simply prepended to the url.
You can use the relative url for your accepturl but that restrict that your confirmation page should have same name on all language versions of your site. So as an example if you have 3 localized sites (German, Danish, Enligsh)
Then all 3 sites should have their confirmation page at same location. etc. ...dk/confirmation, ...com/confirmation and ....de/confirmation. If you want this then your accept url should be "/confirmation" in dibs.config
This might seem odd to users that the confirmation page url is not localized. You can solve this being creating a custom version of DibsPageBuilder (as I recall it) and then create your accept url dynamicly which is also suitable.
I have a single site differentiating language versions by url only. So "Relative url" trick did not work out. As you say - "You can solve this by creating a custom version of DibsPageBuilder (as I recall it) and then create your accept url dynamicly which is also suitable." .. Exactly what I did and solved the issue. Here is the code snippet of it :
How to customize DIBS.config to redirect to localized url
Hi..
I finally integrated the DIBS as a payment API. In DIBS.config we have to set acceptUrl and cancelUrl to handle the success and error resp. So I am redirecting user to payment confirmation page and error page in resp scenarions. But now I am not getting how to set accept url and cancel url as per my selected localization. How should I set such localized urls in DIBS.config?
Regards,
Girish
Found a post with similer issue : http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/37606-Different-DIBS-configuration-for-multiple-sites. ; Soren saying that we can set relative urls for accept urls and cancel urls. Can someone elaborate more on it? Example would be a better idea.
Hi Girish,
The relative urls works by simply checking if the configured urls starts with "http://" or "https://". If not, the Scheme and Host from the current context is simply prepended to the url.
The code inside looks something like this:
return string.Format("{0}://{1}{2}", Scheme, Host, url);
Kind regards,
Jesper
Hi Girish,
You can use the relative url for your accepturl but that restrict that your confirmation page should have same name on all language versions of your site. So as an example if you have 3 localized sites (German, Danish, Enligsh)
Then all 3 sites should have their confirmation page at same location. etc. ...dk/confirmation, ...com/confirmation and ....de/confirmation. If you want this then your accept url should be "/confirmation" in dibs.config
This might seem odd to users that the confirmation page url is not localized. You can solve this being creating a custom version of DibsPageBuilder (as I recall it) and then create your accept url dynamicly which is also suitable.
Best Regards Martin
Hi Martin..
I have a single site differentiating language versions by url only. So "Relative url" trick did not work out.
As you say - "You can solve this by creating a custom version of DibsPageBuilder (as I recall it) and then create your accept url dynamicly which is also suitable." .. Exactly what I did and solved the issue. Here is the code snippet of it :
Hi Girish,
Glad you found a usefull solution. H5YR for posting your solution.
Best regards Martin
is working on a reply...