Pre-registration
Optional flow to register a card before the first purchase — for a faster first checkout when you're confident the customer will pay.
Pre-registration is an optional Scan to PayKit flow that registers a card on the customer's Scan to Pay profile before any transaction. The next purchase then completes faster because the card is already on file.
Use sparingly. EFT Corporation recommends against pre-registration in most cases — it adds an extra step to the customer journey and most apps don't need it. Use only if you have a specific UX reason (e.g. a "set up wallet" screen during onboarding).
For the standard flow, see Payments.
When pre-registration helps
| Scenario | Worth using pre-registration? |
|---|---|
| One-off checkout in your app | No — use Payments directly |
| Onboarding flow with explicit "add payment method" step | Yes |
| Subscription / recurring billing setup | Yes |
| Returning customer (already has a card on file) | No — they'll be silently registered on first purchase anyway |
Invoking pre-registration
import ScanToPayKit
@IBAction func preRegister(_ sender: Any) {
let apiKey = "YOUR_API_KEY"
let system = MPSystem.test
let scanToPay = MPScanToPay()
scanToPay.preRegister(apiKey,
system: system,
controller: self,
delegate: self)
}Optionally pre-fill the MSISDN:
scanToPay.preRegister(apiKey,
system: system,
controller: self,
delegate: self,
preMSISDN: "27832006283")Parameters
| Name | Type | Required | Description |
|---|---|---|---|
apiKey | String | yes | Your Lib Lite API token |
system | MPSystem | yes | .live or .test |
controller | UIViewController | yes | Presenting view controller |
delegate | MPScanToPayDelegate | yes | Where the SDK calls back |
preMSISDN | String | optional | Pre-fills MSISDN if known |
Result handling
The relevant delegate methods for pre-registration:
extension OnboardingViewController: MPScanToPayDelegate {
func scanToPayUserRegistered() {
// Customer has a card on file. Ready to pay.
proceedToNextStep()
}
func scanToPayUserDidCancel() {
// Customer skipped the registration step
}
func scanToPayError(_ error: MPError) {
// Something errored
handleError(error)
}
}Delegate callbacks (pre-registration scope)
| Callback | Meaning |
|---|---|
scanToPayUserRegistered() | Customer is now registered with a usable card on file |
scanToPayUserDidCancel() | Customer cancelled the registration |
scanToPayError(_:) | An error occurred — see Errors |
Payment callbacks (scanToPayPaymentSucceeded(...), etc.) are never fired in this flow.
What's next
- Take a payment → Payments
- Let customers manage cards later → Manage Card
- MPError reference → Errors
Updated 2 days ago
