Skip to content

Commit

Permalink
changing payment's language
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKratky committed Jul 13, 2022
1 parent 3f747a3 commit d239e67
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/create-payment-recommended.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
14 changes: 14 additions & 0 deletions doc/create-payment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

0 comments on commit d239e67

Please sign in to comment.