Guides
Change the password
The consumer supplies their current and new passwords plus a one-time code. Your app obtains the OTP outside the SDK; the SDK verifies it and submits the change. A successful change ends the session.
sdk.profile.changePassword(oldPassword, newPassword, otp, provider)
// Session is now invalid. Show sign-in again.try await sdk.profile.changePassword(
oldPassword: oldPassword, newPassword: newPassword, otp: code, provider: provider
)
// Session is now invalid. Show sign-in again.Behaviour
- The SDK reads the username from the current account, verifies the six-digit OTP, then submits the password change. An invalid code (
OTP_INVALID) stops the request before the password is sent. - Passwords must be non-blank.
- On success the SDK session is invalidated. On Android, payment keys are deleted and NFC is disarmed as well. Call
loginorapplySessionwith a newly authenticated session before further protected calls. - Not safe to auto-retry.
- A newer session established concurrently is not cleared by this operation.
- SMS auto-fill of the code is not implemented by the SDK.
iOS Bluetooth and local cleanup
On iOS, the password method clears the current session but does not delete consumer payment keys, hosted-form/pending state or stop your separate Bluetooth client. If your app completes a full local sign-out after success:
await bleClient.stop()
try await sdk.clear()The client is the retained instance from your payment screen. Handle cleanup failure before showing sign-out complete; see Sign out and switch consumers.