selectCard
Overview
selectCard re-establishes a payable session for a card the cardholder
enrolled earlier. It takes the durable virtualCardId from a prior
enrollCard result — no PAN
re-entry — and returns the same EnrollResult shape, so the rest of the flow
(createIntent → completeOrder) is identical.
On a revoked token the call rejects (it does not resolve with an error
value) — the SDK throws ErrorPaymentMethodNotAvailable, which corresponds to
the REST PaymentMethodNotAvailable (409).
Catch it and fall back to enrollCard (collect the PAN again).
Signature
const result = await fap.selectCard(input, options);
Parameters
-
input.network(string, required) —"visa"or"mastercard"— the network the stored card belongs to. -
input.virtualCardId(string, required) — The durable handle from a priorenrollCard/selectCardresult. Note the casing: this is camelCasevirtualCardId(the SDK-level handle), whereasenrollCard’s card-detail inputs use snake_case (expiry_month) to mirror the raw enroll body, and the raw REST endpoints use snake_casevirtual_card_id. -
input.consumer(object) — Cardholder identity.emailis required for Visa (the wallet re-binds the consumer identity from it); optional for Mastercard. -
options(object) — OptionalCallOptions:apiTokenOverride,signal.
Returns
Promise<EnrollResult> — the same shape as enrollCard:
{ session, virtualCardId, verificationMethods, cardArt, masked }.
cardArt and masked are always null here — use the values you persisted at
enroll time.
Example
// returning customer — no PANconst selected = await fap.selectCard({network: 'mastercard',virtualCardId: savedCard.virtualCardId// consumer.email required for Visa});// Capture and forward the advanced session from each step.const intent = await fap.createIntent(selected.session, mandate, { container });await fap.completeOrder(intent.session, { billingInfo });
Related
enrollCard— enroll a new cardcreateIntent— next step- Select Card API — the underlying endpoint