Currently this plugin uses the value of
get_bloginfo('wpurl')to build Paysera payment request callback url. Please refer to
The call to
get_bloginfo('wpurl')is basically and equivalent of calling
get_site_url()function which is not the best function to use for any frontend urls, including API endpoints. This value is mostly used in admin area, while
get_home_url()is used for any front-facing urls.
WooCommerce itself uses
get_home_url()to build it’s own
wc-apiurls. Please refer to it’s source code: https://github.com/woocommerce/woocommerce/blob/3c9d1353e5b0b30c4613b158ce471cd7b9933472/plugins/woocommerce/includes/wc-core-functions.php#L1070
We are using custom multilingual solution for some websites which appends language code to all frontend urls. This is done via
home_urlfilter because this is the only correct way to do it.
Since this plugin uses
site_urloption to build it’s callback url, the callback is being sent to root url (i.e. https://example.com/?wc-api=wc_gateway_paysera) which is then redirected to https://example.com/en/?wc-api=wc_gateway_paysera which might not be the language version that user used during checkout. For example if user placed an order via estonian version, the callback will be sent to root url without language code and then redirected to english version. This might cause some inconsistencies in our custom workflow and that tiny redirect is also bothering me.
Please consider using
get_home_urlfunctions for building callback requests instead of
get_bloginfo('wpurl')or please make
callbackurlvalue filterable via WordPress hooks so we can adjust the value ourselves.
- The topic ‘Payment callback url’ is closed to new replies.