> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zabcik.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Platební metody

> Seznam dostupných platebních instrumentů podle obchodníka a měny.

# Platební metody

<Info>
  Tyto metody slouží k **zjištění**, které instrumenty GoPay nabízí pro váš obchod (`goid`) a měnu — před sestavením checkout UI nebo serverového směrování.
</Info>

SDK nabízí dvě metody pro výpis aktivních platebních metod:

* `getPaymentInstruments(goid, currency)` — pro konkrétní měnu
* `getPaymentInstrumentsAll(goid)` — napříč měnami

## Podle měny

```ts theme={null}
import { Currency, createGoPayClient } from 'gopay-sdk';

const client = createGoPayClient({
  goid: 8123456789,
  clientId: process.env.GOPAY_CLIENT_ID!,
  clientSecret: process.env.GOPAY_CLIENT_SECRET!,
  gatewayUrl: 'https://gw.sandbox.gopay.com/api',
});

const methods = await client.getPaymentInstruments(8123456789, Currency.CZK);

for (const instrument of methods.enabledPaymentInstruments) {
  console.log(instrument.paymentInstrument, instrument.group);
}
```

## Všechny měny

```ts theme={null}
const methodsAll = await client.getPaymentInstrumentsAll(8123456789);

const list = Array.isArray(methodsAll.enabledPaymentInstruments)
  ? methodsAll.enabledPaymentInstruments
  : Object.values(methodsAll.enabledPaymentInstruments);

for (const item of list) {
  console.log(item.group, item.currencies);
}
```

## Praktické použití

* Výběr platebních metod v UI podle země/měny.
* Skrytí nepodporovaných instrumentů před vytvořením platby.
* Konzistentní UX s aktuálními možnostmi obchodníka.
