Every project must support two payment providers:
- YooKassa — for RUB payments (see @rules/yookassa.md)
- LemonSqueezy — for USD payments (see @rules/lemonsqueezy.md)
The user selects a currency, not a provider. The backend picks the provider automatically:
| Currency | Provider |
|---|---|
| RUB | YooKassa |
| USD | LemonSqueezy |
Each locale (@rules/translate.md) has a default currency pre-selected in the UI:
| Locale | Default currency |
|---|---|
ru |
RUB |
en |
USD |
es |
USD |
pt |
USD |
On every locale the user can switch between RUB and USD regardless of the default. The selector is a simple toggle/dropdown in the payment step — it only shows the currency, not the provider name.
- On page load, pre-select the default currency based on the current locale.
- Show a currency selector (RUB / USD) so the user can override the default.
- Send the chosen currency to the backend. Do not send provider name — the backend decides.
- On response, redirect to
confirmation_urlregardless of provider.
- Receive the chosen currency from the frontend.
- Pick the provider based on currency:
RUB→ create payment via YooKassaUSD→ create checkout via LemonSqueezy
- Return a unified response shape with
confirmation_urlandpayment_provider(for frontend logging/analytics only). - Handle webhooks on separate endpoints per provider.