uz_payments library
Payme and Click payments for Dart and Flutter: checkout links for the app, and verified merchant webhooks (Payme Merchant API, Click SHOP-API) for the server. Zero dependencies.
Classes
- ClickBackend
- What ClickMerchantHandler needs from your application.
- ClickCheckout
-
Builds Click payment links (
my.click.uz/services/pay). - ClickErrorCode
- Error codes of the Click SHOP-API.
- ClickMerchantHandler
- Server-side handler for the Click SHOP-API (Prepare and Complete).
- ClickOrder
-
An order that a Click payment is for (
merchant_trans_id). - ClickPrepare
- The record your backend creates on a successful Prepare.
- ClickRequest
- A verified Prepare or Complete request from Click.
- InMemoryClickBackend
- In-memory ClickBackend for tests and demos. Not for production.
- InMemoryPaymeBackend
- In-memory PaymeBackend for tests, demos and the Payme sandbox.
- MerchantRequest
- A framework-neutral view of an incoming webhook request.
- MerchantResponse
- The response to send back to the payment provider.
- PaymeBackend
- What PaymeMerchantHandler needs from your application.
- PaymeCheckout
- Builds Payme checkout links (GET method of "Инициализация платежей").
- PaymeErrorCode
- Error codes of the Payme Merchant API.
- PaymeMerchantHandler
- Server-side handler for the Payme Merchant API (JSON-RPC 2.0).
- PaymeOrder
- An order (invoice, booking, top-up) that a Payme transaction pays for.
- PaymeReason
-
Cancellation reasons sent by Payme in
CancelTransaction(and reason 4, which this package sets itself when a transaction times out). - PaymeState
- Transaction states of the Payme Merchant API.
- PaymeTransaction
- A Payme transaction as stored by your backend.
Enums
- ClickOrderStatus
- Payment state of an order from Click's point of view.
Properties
Functions
-
constantTimeEquals(
String a, String b) → bool - Compares two strings in time that does not depend on where they differ.
-
formatSom(
int tiyin) → String -
Formats tiyin as a so'm string with two decimals:
150000→"1500.00". -
md5Hex(
String input) → String -
MD5 (RFC 1321) of
inputas UTF-8, returned as 32 lowercase hex characters. -
parseSomToTiyin(
String value) → int? -
Parses a so'm amount as sent by Click (
"1000","1000.0","1000.50") into tiyin without using floating point. Returnsnullfor anything that is not a plain non-negative decimal with at most two fractional digits. -
somToTiyin(
int som) → int - Converts whole so'm to tiyin.
Exceptions / Errors
- PaymeError
- A Merchant API error with a localized message.