@paydock/client-sdk
Version:
Paydock client sdk
83 lines • 2.32 kB
TypeScript
import type { Container } from '../components/container';
export interface PaypalOathTokenResponse {
id_token: string;
access_token: string;
}
export interface PaypalOAuthTokenBody {
gateway_id: string;
}
export interface PaypalSetupTokenBody {
gateway_id: string;
}
export interface PaypalSetupTokenResponse {
setup_token: string;
}
export interface PaypalOttBody {
gateway_id: string;
}
export interface PaypalOttResponse {
token: string;
email: string;
}
export interface PayPalStyleConfig {
layout?: 'vertical' | 'horizontal';
color?: 'blue' | 'gold' | 'silver' | 'black' | 'white';
shape?: 'rect' | 'sharp' | 'pill';
label?: 'paypal' | 'checkout' | 'buynow' | 'pay';
disableMaxWidth?: boolean;
disableMaxHeight?: boolean;
height?: number;
borderRadius?: number;
tagline?: boolean;
}
export interface PayPalMessageConfig {
amount?: number;
align?: 'center' | 'left' | 'right';
color?: 'black' | 'white';
position?: 'top' | 'bottom';
}
export interface PayPalSavePaymentSourceWidgetConfig {
style?: PayPalStyleConfig;
message?: PayPalMessageConfig;
}
export declare const PAYPAL_SAVE_PAYMENT_EVENTS: {
ON_SUCCESS: string;
ON_ERROR: string;
ON_CANCEL: string;
};
export interface IPayPalSavePaymentSourceWidget {
load(container: Container): void;
setEnv(env: string, alias?: string): void;
}
export declare enum ErrorCodes {
UNAVAILABLE = "unavailable",
ON_PAYPAL_VAULT_SETUP_TOKEN_ERROR = "onPaypalVaultSetupTokenError",
ON_GET_ID_TOKEN_ERROR = "onGetIdTokenError",
ON_GET_WALLET_CONFIG_ERROR = "onGetWalletConfigError",
ON_GET_SETUP_TOKEN_ERROR = "onGetSetupTokenError",
ON_ONE_TIME_TOKEN_ERROR = "onOneTimeTokenError"
}
export declare enum EVENTS {
ON_SUCCESS = "ON_SUCCESS",
ON_ERROR = "ON_ERROR",
ON_CANCEL = "ON_CANCEL"
}
export interface IOnSuccessEventData {
event: EVENTS.ON_SUCCESS;
data: {
token: string;
email: string;
};
}
export interface IOnErrorEventData {
event: EVENTS.ON_ERROR;
data: {
error_code: ErrorCodes;
details?: string;
message?: string;
};
}
export interface IOnCancelEventData {
event: EVENTS.ON_CANCEL;
}
//# sourceMappingURL=paypal-save-payment-source.interfaces.d.ts.map