PinService class
Service for managing user PINs via the IAM service.
Provides self-service PIN operations for external users:
- setPin: First-time PIN creation
- changePin: Change existing PIN (requires current PIN)
- resetPin: Reset PIN (no current PIN needed, authenticated via Bearer token)
- getPinStatus: Check if user has a PIN and whether it's locked
- verifyPin: Verify a PIN for authentication (not used by the auth manager, but available for host app use if needed)
- Inheritance
-
- Object
- LittleFishService
- PinService
Constructors
- PinService()
-
factory
Properties
- client → LittleFishHttpClient
-
no setter
- core ↔ LittleFishCore
-
getter/setter pairinherited
- defaultPinLength ↔ int
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger → LoggerService
-
no setterinherited
-
monitoringService
→ MonitoringService<
dynamic, MonitoringHttpMetric, MonitoringTrace> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
changePin(
{required String userId, required String currentPin, required String newPin, required String businessId, String population = 'External'}) → Future< ChangePinResult> - Changes the user's existing PIN.
-
getPinStatus(
{required String userId, required String businessId, String population = 'External'}) → Future< PinStatusResponse> - Checks the PIN status for a user.
-
initialise(
{String? merchantApiUrl}) → Future< void> -
Initializes the service with the IAM service URL from configuration.
merchantApiUrlis the base URL for the merchant API (used for OTP endpoints). If not provided, it is read from theconfig_merchant_api_urlconfig key. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requestPinOtp(
{required String userId}) → Future< OtpRequestResult> - Requests an OTP for admin PIN reset via the merchant API.
-
resetPin(
{required String userId, required String newPin, required String businessId, String population = 'External'}) → Future< ResetPinResult> - Resets the user's PIN (self-service).
-
setPin(
{required String userId, required String pin, required String businessId, String population = 'External'}) → Future< CreatePinResult> - Sets a PIN for the user (first-time creation).
-
toString(
) → String -
A string representation of this object.
inherited
-
verifyPin(
{required String userId, required String pin, required String businessId, String population = 'External'}) → Future< VerifyPinResult> - Verifies a PIN for authentication purposes.
-
verifyPinOtp(
{required String userId, required String otpCode}) → Future< OtpVerifyResult> - Verifies an OTP code for admin PIN reset via the merchant API.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → PinService
-
final