Title: Payment Callback URL problem
Last modified: March 17, 2021

---

# Payment Callback URL problem

 *  Resolved [kitboxdesign](https://wordpress.org/support/users/kitboxdesign/)
 * (@kitboxdesign)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/payment-callback-url-problem/)
 * Hello I have a multilingual e-shop with 2 language versions. I use Translatepress
   for translating the content.
 * My payment provider uses a callback url as this: [https://www.example.com/index.php?wc-api=wc_gateway_paytrcheckout](https://www.example.com/index.php?wc-api=wc_gateway_paytrcheckout)
 * This url is only used to send information to the payment plugin as I understand.
   However it doesn’t carry any languge information. So all customers who made payments
   through this provider gets their confirmation emails in the default language 
   no matter what they choose.
 * Is there a parameter we can add to this URL that will carry the language information
   referring to the language selected by customer.
 * Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [dartrax](https://wordpress.org/support/users/dartrax/)
 * (@dartrax)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/payment-callback-url-problem/#post-14202542)
 * You should get the language with this code (not tested):
 *     ```
       // Add Shortcode to get TranslatePress language
       add_shortcode ('CurrentLanguageCode', 'dartrax_get_language_code');
       function dartrax_get_language_code() {
       	if( ! class_exists('TRP_Translate_Press') ) return '';
       	global $TRP_LANGUAGE;
       	return $TRP_LANGUAGE;
       }
       ```
   
 * Now [CurrentLanguageCode] should resolve to the current locale like “en_US” for
   Example. It’s up to the payment provider plugin if it allows Shortcodes in the
   callback url parameter. If not, you should search or ask if there is a filter
   you could use to alter the url.
 *  Thread Starter [kitboxdesign](https://wordpress.org/support/users/kitboxdesign/)
 * (@kitboxdesign)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/payment-callback-url-problem/#post-14203825)
 * Thank you [@dartrax](https://wordpress.org/support/users/dartrax/) Translatepress
   should hire you since you are trying to solve all of their support problems 🙂
   
   I will try this. One question: I’m using a snippet plugin to add codes to function.
   php Should I add this code there?
 *  Thread Starter [kitboxdesign](https://wordpress.org/support/users/kitboxdesign/)
 * (@kitboxdesign)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/payment-callback-url-problem/#post-14203929)
 * [@dartrax](https://wordpress.org/support/users/dartrax/) I just tried the code
   but Payment Provider does not seem to be accepting shortcodes on the URL, test
   transaction stayed in the awaiting payment status once I added the shortcode.
 * I will ask them if there’s a way implementing the code. Thanks again.
 *  [dartrax](https://wordpress.org/support/users/dartrax/)
 * (@dartrax)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/payment-callback-url-problem/#post-14204109)
 * Thanks 😉
    Try it in your child theme’s functions.php first and add the shortcode
   on one of your pages just to make sure it will show the current locale. If that
   works, you can try with the url parameter, and if it still works, try moving 
   it into a snippet. But it seems you already done this and it did not work, so
   you need a way to dynamically change the url, for example with a filter hook –
   the payment provider should be able to tell you if there is one available.
 *  Thread Starter [kitboxdesign](https://wordpress.org/support/users/kitboxdesign/)
 * (@kitboxdesign)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/payment-callback-url-problem/#post-14207030)
 * [@dartrax](https://wordpress.org/support/users/dartrax/) Thanks. They actually
   suggested a fix like this: writing a code to get the order language from meta-
   data of the order and redirecting the callback URL with the correct slug.
 * I got the first part “saving the language data” thanks to you 🙂 now I’m trying
   to find a way to get the second part working.
 *  [Cristian Draghia](https://wordpress.org/support/users/cristiandraghia/)
 * (@cristiandraghia)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/payment-callback-url-problem/#post-14223549)
 * Hello [@kitboxdesign](https://wordpress.org/support/users/kitboxdesign/),
 * Unfortunately, for the time being, we don’t have support for storing and sending
   the current language to other plugins that need it.
 * This is a tracked feature and will be available in the future versions of TranslatePress–
   but, as there are other features more requested that require prioritization​​,
   I can’t give you a timeframe for when will this be implemented.
 * Thank you for understanding.
 * Best regards,
    Cristian

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Payment Callback URL problem’ is closed to new replies.

 * ![](https://ps.w.org/translatepress-multilingual/assets/icon.svg?rev=3166541)
 * [TranslatePress - Translate Multilingual sites with AI Translation](https://wordpress.org/plugins/translatepress-multilingual/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/translatepress-multilingual/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/translatepress-multilingual/)
 * [Active Topics](https://wordpress.org/support/plugin/translatepress-multilingual/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/translatepress-multilingual/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/translatepress-multilingual/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [Cristian Draghia](https://wordpress.org/support/users/cristiandraghia/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/payment-callback-url-problem/#post-14223549)
 * Status: resolved