QIWI SDK / Modules / apis/shared
- AnyParameters
- AnyRecord
- Collection
- Headers
- HmacOptions
- ObjectKey
- ReadonlyRecord
- TimeSpanKeys
- TimeSpanMapping
- URLResult
- collect
- compareHmac
- compareQiwiHmac
- formatAltLifetimeDate
- formatDate
- formatOffsetAltLifetimeDate
- formatOffsetDate
- formatQuerystring
- generateUUID
- url
Re-exports URL
Re-exports URLSearchParameters
Ƭ AnyParameters: any[]
Ƭ AnyRecord: ReadonlyRecord<string, unknown>
Ƭ Collection<T>: Iterable<T> | ArrayLike<T>
| Name |
|---|
T |
Ƭ Headers: ReadonlyRecord<string, string>
Ƭ HmacOptions: Object
| Name | Type |
|---|---|
algorithm? |
string |
data |
BinaryAlike |
digest |
BinaryAlike |
key |
BinaryAlike |
Ƭ ObjectKey: string | number
Ƭ ReadonlyRecord<K, V>: Readonly<Record<K, V>>
| Name | Type |
|---|---|
K |
extends ObjectKey |
V |
V |
Ƭ TimeSpanKeys: keyof TimeSpanMapping
Ƭ TimeSpanMapping: typeof TimeSpanMapping
Ƭ URLResult: (queryParameters?: AnyRecord) => string
▸ (queryParameters?): string
| Name | Type |
|---|---|
queryParameters? |
AnyRecord |
string
• Const TimeSpanMapping: Readonly<{ d: TimeSpan = TimeSpan.Day; day: TimeSpan = TimeSpan.Day; h: TimeSpan = TimeSpan.Hour; hour: TimeSpan = TimeSpan.Hour; hr: TimeSpan = TimeSpan.Hour; m: TimeSpan = TimeSpan.Minute; millisecond: TimeSpan = TimeSpan.Millisecond; min: TimeSpan = TimeSpan.Minute; minute: TimeSpan = TimeSpan.Minute; mn: TimeSpan = TimeSpan.Month; mon: TimeSpan = TimeSpan.Month; month: TimeSpan = TimeSpan.Month; ms: TimeSpan = TimeSpan.Millisecond; msec: TimeSpan = TimeSpan.Millisecond; s: TimeSpan = TimeSpan.Second; sec: TimeSpan = TimeSpan.Second; second: TimeSpan = TimeSpan.Second; w: TimeSpan = TimeSpan.Week; week: TimeSpan = TimeSpan.Week; y: TimeSpan = TimeSpan.Year; year: TimeSpan = TimeSpan.Year; yr: TimeSpan = TimeSpan.Year }>
• Const USER_AGENT: string
• Const environment: Readonly<Record<"QIWI_TOKEN" | "QIWI_WALLET" | "QIWI_SECRET_KEY" | "QIWI_PUBLIC_KEY", string>>
▸ collect<T>(collection): T[]
Export
| Name |
|---|
T |
| Name | Type |
|---|---|
collection |
Collection<T> |
T[]
▸ compareHmac(options): boolean
Export
| Name | Type |
|---|---|
options |
HmacOptions |
boolean
▸ compareQiwiHmac(key, digest, data): boolean
Export
| Name | Type |
|---|---|
key |
BinaryAlike |
digest |
BinaryAlike |
data |
string[] |
boolean
boolean
▸ formatAltLifetimeDate(dateTime): string
Используется только для параметра lifetime при создании ссылки на форму оплаты
Форматирует дату в понятную для QIWI строку:
ГГГГ-ММ-ДДTччмм
Export
| Name | Type |
|---|---|
dateTime |
DateValue |
string
string
▸ formatDate(dateTime): string
Форматирует дату в понятную для QIWI строку:
ГГГГ-ММ-ДДTЧЧ:ММ:СС+\-ЧЧ:ММ
| Name | Type | Description |
|---|---|---|
dateTime |
DateValue |
Аргумент для конструктора |
string
▸ formatOffsetAltLifetimeDate(amount, unit?, currentDate?): string
Export
| Name | Type | Default value |
|---|---|---|
amount |
number |
undefined |
unit |
TimeUnit |
TimeSpan.Millisecond |
currentDate? |
Date |
undefined |
string
string
▸ formatOffsetDate(amount, unit?, currentDate?): string
Используется только для параметра lifetime при создании ссылки на форму оплаты
Форматирует дату в понятную для QIWI строку:
ГГГГ-ММ-ДДTччмм
Export
| Name | Type | Default value |
|---|---|---|
amount |
number |
undefined |
unit |
TimeUnit |
TimeSpan.Millisecond |
currentDate? |
Date |
undefined |
string
string
▸ formatQuerystring(object): string
Создаёт строку запроса, в формате, который понимает QIWI
| Name | Type | Description |
|---|---|---|
object |
Readonly<Record<string, unknown>> |
Объект для преобразования |
string
▸ generateUUID(): string
Генерирует UUID
Export
string
▸ url(parts, ...insertions): URLResult
Export
| Name | Type |
|---|---|
parts |
TemplateStringsArray |
...insertions |
unknown[] |