PaymeMerchantHandler class
Server-side handler for the Payme Merchant API (JSON-RPC 2.0).
It implements the full transaction state machine from the official Payme
integration template: authorization, amount and account checks, idempotent
retries, the 12-hour timeout, cancellation before and after perform, and
GetStatement. Your PaymeBackend only stores data.
final payme = PaymeMerchantHandler(key: env['PAYME_KEY']!, backend: MyBackend());
// in your route:
final res = await payme.handle(MerchantRequest(headers: headers, body: body));
Constructors
Properties
- accountField → String
-
The
accountfield that identifies the order, used in errordata.final -
allowedIps
→ Set<
String> ? -
If set, requests from other IPs are rejected with -32504. Use paymeIps,
and make sure MerchantRequest.remoteAddress is the real client IP (not
your proxy's).
final
- backend → PaymeBackend
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- login → String
-
Basic-auth login. Payme always uses
Paycom.final -
onChangePassword
→ Future<
bool> Function(String newKey)? -
Persists a new cashbox key sent by Payme's
ChangePassword. Returntrueonce it is stored. Ifnull,ChangePasswordis rejected.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration
-
A created transaction that is not performed within this time is cancelled
with reason 4. Payme specifies 12 hours (43 200 000 ms).
final
Methods
-
handle(
MerchantRequest request) → Future< MerchantResponse> - Handles one HTTP request from Payme and returns the response to send.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited