Source class

The Source SDK singleton.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

decodePayload(String payload, String encryptionKey) → TransactionInfo
Decode payload produced by present and return TransactionInfo. payload may be the full uri like "source://pay?payload=..." or raw base64url string.
decodePayloadWithMerchant(String payload, String encryptionKey) → Map<String, dynamic>
Decode payload and return both TransactionInfo and merchant info (if present). Returns a map with keys: transaction (TransactionInfo) and merchant (Map).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
payWithApi({required Uri endpoint, required String bearerToken, required TransactionInfo tx, Map<String, String>? extraHeaders}) → Future<Response>
Convenience helper to call Source pay API. Merchant/backend should perform real authenticated transfers; this is a simple client helper.
present({required TransactionInfo transaction, String? encryptionKey, SourceSDKConfig? sdkConfig, String appSchemePrefix = 'source://pay?payload=', String? webBase, double qrSize = 220}) → Widget
Return a widget that renders a QR containing the encrypted payload. If encryptionKey is null the SDK will generate and persist a 32-byte key.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

instance → Source
final

Static Methods

platformDecrypt(String payload, String encryptionKey) → Map<String, dynamic>
Platform-facing API: decrypt a payload and return a Map with keys transaction and merchant. This is a simple entry point the Source platform can call directly without needing to reimplement decryption.