From d239e678444fb601c120d5a3fe574b0ed1b40331 Mon Sep 17 00:00:00 2001 From: Alex Kratky Date: Wed, 13 Jul 2022 14:14:42 +0200 Subject: [PATCH] changing payment's language --- doc/create-payment-recommended.md | 14 ++++++++++++++ doc/create-payment.md | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/doc/create-payment-recommended.md b/doc/create-payment-recommended.md index 77ffc6a..6e5a8fc 100644 --- a/doc/create-payment-recommended.md +++ b/doc/create-payment-recommended.md @@ -42,3 +42,17 @@ $payment = $thePay->createPayment($createPayment); // Get url where user can pay echo $payment->getPayUrl(); // https://demo.gate.thepay.cz/5aa4f4af546a74848/pay/ ``` + +### Changing payment's language + +In scenarios where you know the customer's preferred language, you can pass the language code in `CreatePaymentParams` constructor as the fourth argument. For example: + +```php +$createPayment = new CreatePaymentParams(10520, 'EUR', 'uid123', 'en'); +``` + +Possible values are described in ISO 639-1 standard. If you pass a language, that ThePay does not support, for example French (fr), then the English language will be used, +as is the most likely best choice for the customer. However, if the customer changed their language in ThePay system, then this setting will not have any impact. + +You may wonder which language will be used if you do not enter any, then the language from TheConfig will be used, and if even here you did not select the default language, +the default language will be Czech (cs). \ No newline at end of file diff --git a/doc/create-payment.md b/doc/create-payment.md index 1023124..64cadcd 100644 --- a/doc/create-payment.md +++ b/doc/create-payment.md @@ -142,3 +142,17 @@ If even our HTML is not suitable for you we recommend create payment via API. - getPaymentDetailUrl() for url where are details about payment and user can make payment as well TODO: doplnit obrázky, kam se uživatel dostane kterou url + +### Changing payment's language + +In scenarios where you know the customer's preferred language, you can pass the language code in `CreatePaymentParams` constructor as the fourth argument. For example: + +```php +$createPayment = new CreatePaymentParams(10520, 'EUR', 'uid123', 'en'); +``` + +Possible values are described in ISO 639-1 standard. If you pass a language, that ThePay does not support, for example French (fr), then the English language will be used, +as is the most likely best choice for the customer. However, if the customer changed their language in ThePay system, then this setting will not have any impact. + +You may wonder which language will be used if you do not enter any, then the language from TheConfig will be used, and if even here you did not select the default language, +the default language will be Czech (cs). \ No newline at end of file