UNPKG

mpp-sdk

Version:

SDK to talk to the Memento Payments Platform

29 lines (28 loc) 1.31 kB
import { BaseEndpoint } from "./base"; import { VerificationDefintions, VerificationType } from "../types"; export default class VerificationEndpoint extends BaseEndpoint { getById<T extends VerificationDefintions>(id: string): Promise<import("../types").MPPResult<T["response"]>>; /** * Create a verification. * Verification object is created but the verification flow is not started. * @param data */ create<TDef extends VerificationDefintions, TType extends VerificationType = TDef["type"]>(data: { type: TType; } & TDef["initial_data"]): Promise<import("../types").MPPResult<{ type: TType; } & TDef["response"]>>; /** * Start a verification. * Starts the verification flow for an existing verification. * @param verificationId id of verification * @param data */ start<T extends VerificationDefintions>(verificationId: string, data?: T["initial_data"]["data"]): Promise<import("../types").MPPResult<T["response"]>>; /** * Provide data to an existing verification. * @param verificationId id of verification * @param data verification data */ provide<T extends VerificationDefintions>(verificationId: string, data: T["provide_data"]): Promise<import("../types").MPPResult<T["response"]>>; }