UNPKG

privacy.com

Version:

Wrapper for the Privacy.com API using Axios and TypeScript

49 lines (48 loc) 1.61 kB
import { Response } from ".."; import { PrivacyApi } from "../.."; import { EmbedRequest } from "../../objects"; import { GetEndpoint } from "."; /** * Get iframe data to display card details * @remarks The iframe body will provide consistent markup of the following form. * It is up to the API client to provide css styles for these elements in the EmbedRequest. * ```html * <div id="card"> * <div id="pan">{PAN}</div> * <div id="expiry"> * <span id="month">{expMonth}</span> * <span id="separator">/</span> * <span id="year">{expYear}</span> * </div> * <div id="cvv">{CVV}</div> * </div> * ``` */ export declare class HostedCardUiRequest extends GetEndpoint { path: string; params: HostedCardUiProxyParams; originalParams: HostedCardUiParams; constructor(params: HostedCardUiParams); /** * Formats parameters for the request, i.e. creates an hmac with the API key and serializes the embed_request object * @param manager PrivacyApi from which to extract the API Key */ beforeExecute(manager: PrivacyApi): void; } /** * Opaque parameters for {@link HostedCardUiRequest} */ export declare type HostedCardUiParams = { embed_request: EmbedRequest; }; /** * Acutal parameters for {@link HostedCardUiRequest} */ declare type HostedCardUiProxyParams = { /** A base64 encoded JSON string of an EmbedRequest to specify which card to load */ embed_request: string; /** SHA2 HMAC of the embed_request JSON string with base64 digest */ hmac: string; }; export declare type HostedCardUiResponse = Response<string>; export {};