@nativescript/square-in-app-payments
Version:
Square In-App Payments SDK for NativeScript
52 lines (51 loc) • 1.93 kB
TypeScript
import { CardEntryOptions } from '.';
import { SquareInAppPaymentsCommon, CardBrand, CardType, CardPrepaidType } from './common';
export { CardBrand, CardType, CardPrepaidType };
export declare class Card {
_card: SQIPCard;
constructor(card: SQIPCard);
static fromNative(card: SQIPCard): Card;
get native(): SQIPCard;
get brand(): string;
get type(): string;
get prepaidType(): string;
get lastFourDigits(): string;
get expirationMonth(): number;
get expirationYear(): number;
get postalCode(): string;
toJSON(): {
brand: string;
type: string;
prepaidType: string;
lastFourDigits: string;
expirationMonth: number;
expirationYear: number;
postalCode: string;
};
}
export declare class CardDetails {
_cardDetails: SQIPCardDetails;
_card: Card;
_nonce: string;
get card(): Card;
get nonce(): string;
static fromNative(cardDetails: SQIPCardDetails): CardDetails;
toJSON(): {
card: Card;
nonce: string;
};
}
export declare class SquareInAppPayments extends SquareInAppPaymentsCommon {
static init(): void;
static onResponse: (cardDetails: CardDetails, complete: (error?: string) => void) => string | null | undefined;
static onComplete: (cancelled: boolean, card: CardDetails) => void;
get squareApplicationID(): string | null;
set squareApplicationID(appId: string);
get canUseApplePay(): boolean;
startCardEntry(options?: CardEntryOptions): void;
dismiss(animated?: boolean): void;
createTheme(config?: Partial<SQIPTheme>): SQIPTheme;
createApplePayRequest(merchantId: string, countryCode: string, currencyCode: string): PKPaymentRequest;
performApplePayNonceRequest(payment: PKPayment, callback: (cardDetails?: SQIPCardDetails, error?: NSError | null) => void): void;
getRootViewController(): UIViewController | undefined;
}