Skip to content

Releases: laconicman/YooMoneyAPIClient

2.0.0

Choose a tag to compare

@laconicman laconicman released this 28 Jul 10:35

2.0 is generated from YooKassa's official OpenAPI specification instead of the one this package wrote by hand. Type names now match the documentation you read while debugging, the surface grows from 11 operations to 24, and three correctness bugs that the hand-written spec caused are gone.

This is a breaking release. Every breaking change is a compile error, and most renames carry renamed: deprecation aliases so the compiler names the replacement for you. Work through the migration guide top to bottom.

Upgrade now if you issue receipts under 54-FZ

1.x caps vat_code at 10 and cannot fiscalize a receipt at the current Russian base VAT rate through the typed API at all. The rate rose from 20% to 22% on 2026-01-01 (Federal Law 425-FZ of 2025-11-28) and YooKassa added codes 11 (22%) and 12 (22/122). The ceiling of 10 was invented by 1.x's hand-authored spec, not by YooKassa. vatCode is now a plain Int32 — pass the number.

Breaking changes

  • idempotenceKey is now required on ten POST operations. 1.x invented the key from operationID + body.hashValue, which collided across genuinely distinct payments of the same amount (silently deduplicating the second into the first) and, because hashValue is seeded per process, produced a different key for the same retry after a relaunch. Generate one key per logical operation and persist it next to the order.
  • Confirmation and ReceiptItem split by direction. Request sites now use ConfirmationData and ReceiptDataItem; reading these off a response is unchanged.
  • Output switch cases changed. forbidden (403) and internalServerError (500) are new on nearly every operation; tooManyRequests (429) is gone from most. A 1.x switch written with default: keeps compiling while folding new failure modes into one branch — write the cases out explicitly.
  • Six payment methods removed.alfabank, .applePay, .googlePay, .installments, .qiwi, .webmoney are absent from the official spec and have no replacement. Four are new: .alfaPay, .electronicCertificate, .sberBnpl, .sberLoan.
  • Platform floor raised: macOS 11 → 13, iOS 14 → 16, tvOS 14 → 16, watchOS 7 → 9. swift-tools-version is now 6.1.
  • Sample fixtures left the library. Client+samples.swift and the .example* static properties embedded a real person's email address and INN in the binary of every app that linked this package. Equivalents now live in the test target.

Fixes

  • bodyLoggingConfiguration is honoured. 1.x accepted the parameter and then ignored it, hardcoding .upTo(maxBytes: 2048) — request and response bodies carry payment data. It now defaults to .never.
  • Credentials.fromEnvironment called fatalError when APP_USERNAME or APP_PASSWORD was unset, crashing test hosts without credentials. Replaced by the optional Credentials.environment.
  • ValidationError descriptions now resolve through Bundle.module. The string catalog was never bundled in 1.x, so localization never loaded.
  • currency is now the CurrencyCode enum and locale the Locale enum, so a value the API would reject is unrepresentable rather than a 400 at runtime.

New operations

activatePosLink, createDeal, createInvoice, createPaymentMethod, createPosLink, deactivatePosLink, getDeal, getDealsList, getInvoice, getMe, getPaymentMethod, getPosLink, setPosLinkRecipient.

All 11 method names from 1.x survive unchanged; only their inputs and outputs changed.

Full changelog: 1.0.6...2.0.0

1.0.6

Choose a tag to compare

@laconicman laconicman released this 26 Oct 22:20
FIX: `quantity` type

1.0.5

Choose a tag to compare

@laconicman laconicman released this 26 Oct 22:07
FIX: `quantity` type corrected.

1.0.4

Choose a tag to compare

@laconicman laconicman released this 09 Apr 15:33

Localization

1.0.3

Choose a tag to compare

@laconicman laconicman released this 07 Apr 17:39
REFACTOR: Made naming of dependency more specific.