@paydock/client-sdk
Version:
Paydock client sdk
430 lines • 11.9 kB
TypeScript
/// <reference types="applepayjs" />
/// <reference types="googlepay" />
import type { CardValidatorValue, GenericValidatorValue } from "../constants/validators";
export declare const PAYMENT_SOURCE_TYPE: {
CARD: string;
BANK_ACCOUNT: string;
CHECKOUT: string;
};
export declare const FORM_FIELD: {
CARD_NAME: string;
CARD_NUMBER: string;
EXPIRE_MONTH: string;
EXPIRE_YEAR: string;
CARD_CCV: string;
CARD_PIN: string;
ACCOUNT_NAME: string;
ACCOUNT_BSB: string;
ACCOUNT_NUMBER: string;
ACCOUNT_ROUTING: string;
ACCOUNT_HOLDER_TYPE: string;
ACCOUNT_BANK_NAME: string;
ACCOUNT_TYPE: string;
FIRST_NAME: string;
LAST_NAME: string;
EMAIL: string;
PHONE: string;
PHONE2: string;
ADDRESS_LINE1: string;
ADDRESS_LINE2: string;
ADDRESS_STATE: string;
ADDRESS_COUNTRY: string;
ADDRESS_CITY: string;
ADDRESS_POSTCODE: string;
ADDRESS_COMPANY: string;
};
export declare const STYLE: {
BACKGROUND_COLOR: string;
BACKGROUND_ACTIVE_COLOR: string;
TEXT_COLOR: string;
BORDER_COLOR: string;
ICON_SIZE: string;
BUTTON_COLOR: string;
ERROR_COLOR: string;
SUCCESS_COLOR: string;
FONT_SIZE: string;
FONT_FAMILY: string;
};
export declare const VAULT_DISPLAY_STYLE: {
BACKGROUND_COLOR: string;
TEXT_COLOR: string;
BORDER_COLOR: string;
BUTTON_COLOR: string;
FONT_SIZE: string;
FONT_FAMILY: string;
};
export declare const TEXT: {
TITLE: string;
TITLE_H1: string;
TITLE_H2: string;
TITLE_H3: string;
TITLE_H4: string;
TITLE_H5: string;
TITLE_H6: string;
FINISH: string;
TITLE_DESCRIPTION: string;
SUBMIT_BUTTON: string;
SUBMIT_BUTTON_PROCESSING: string;
};
export declare const ELEMENT: {
SUBMIT_BUTTON: string;
TABS: string;
};
export declare const SUPPORTED_CARD_TYPES: {
AMEX: string;
AUSBC: string;
DINERS: string;
DISCOVER: string;
JAPCB: string;
LASER: string;
MASTERCARD: string;
SOLO: string;
VISA: string;
VISA_WHITE: string;
EFTPOS: string;
EFTPOS_WHITE: string;
};
export declare const SUPPORTED_CHECKOUT_META_COLLECTION: any[];
export interface IIcons {
paypal_checkout_button?: string;
afterpay_checkout_button?: string;
zipmoney_checkout_button?: string;
}
export interface IFormPropertyOption {
card_name?: string;
card_number?: string;
expire_month?: string;
expire_year?: string;
card_ccv?: string;
card_pin?: string;
account_name?: string;
account_bsb?: string;
account_number?: string;
account_routing?: string;
account_holder_type?: string;
account_bank_name?: string;
first_name?: string;
last_name?: string;
email?: string;
phone?: string;
phone2?: string;
address_line1?: string;
address_line2?: string;
address_state?: string;
address_country?: string;
address_city?: string;
address_postcode?: string;
address_company?: string;
}
export interface IFormValues extends IFormPropertyOption {
}
export interface IFormLabels extends IFormPropertyOption {
}
export interface IFormPlaceholders extends IFormPropertyOption {
}
export interface IFormElement {
field: string;
label?: string;
placeholder?: string;
value?: string;
}
export type ValidatorFieldsMapKey = CardValidatorValue | GenericValidatorValue;
export type ValidatorFieldsMap = Partial<Record<ValidatorFieldsMapKey, string[]>>;
export interface IFormValidation {
form_valid?: boolean;
invalid_fields?: string[];
invalid_showed_fields?: string[];
validators?: ValidatorFieldsMap;
}
export interface IStyles {
background_color?: string;
background_active_color?: string;
text_color?: string;
border_color?: string;
button_color?: string;
icon_size?: string;
error_color?: string;
success_color?: string;
font_size?: string;
font_family?: string;
}
export interface ITexts {
title?: string;
title_h1?: string;
title_h2?: string;
title_h3?: string;
title_h4?: string;
title_h5?: string;
title_h6?: string;
finish_text?: string;
title_description?: string;
submit_button?: string;
submit_button_processing?: string;
}
export interface ICommonParams {
sdk_version?: string;
sdk_type?: string;
}
export interface ISRCParams extends ICommonParams {
public_key?: string;
service_id?: string;
meta?: string;
}
export interface IWalletParams extends IStyles, ITexts, ICommonParams {
token: string;
credentials: string;
currency: string;
amount: number;
gateway_mode: string;
}
export interface IParams extends IStyles, ITexts, ICommonParams {
access_token?: string;
public_key?: string;
token?: string;
configuration_token?: string;
configuration_tokens?: string;
ref_id?: string;
supported_card_types?: string;
validate_card_types?: boolean;
fields_validation?: boolean;
hidden_elements?: string;
icons?: string;
form_values?: string;
form_labels?: string;
form_placeholders?: string;
query_token?: string;
limit?: number;
widget_id?: string;
gateway_id?: string;
gateway_ids?: string;
payment_source_types?: string;
element_styles?: string;
use_country_phone_mask?: boolean;
phone_mask_preferred_countries?: string;
phone_mask_default_country?: string;
phone_mask_only_countries?: string;
language?: string;
vault_display_token?: string;
sdk_origin?: boolean;
hide_ui_errors?: boolean;
}
export interface ICountryPhoneMask {
preferred_countries?: string[];
default_country?: string;
only_countries?: string[];
}
export interface IPayPalMeta {
brand_name?: string;
cart_border_color?: string;
reference?: string;
email?: string;
hdr_img?: string;
logo_img?: string;
pay_flow_color?: string;
first_name?: string;
last_name?: string;
address_line?: string;
address_line2?: string;
address_city?: string;
address_state?: string;
address_postcode?: string;
address_country?: string;
phone?: string;
hide_shipping_address?: boolean;
}
export interface IBamboraMeta {
customer_storage_number?: string;
tokenise_algorithm?: number;
}
export interface IZipmoneyMeta {
first_name: string;
last_name: string;
phone?: string;
tokenize?: boolean;
email: string;
gender?: string;
date_of_birth?: string;
charge: {
amount: number;
currency?: string;
reference?: string;
shipping_type?: string;
items: Array<{
name: string;
amount: number;
quantity: number;
type?: string;
reference?: string;
item_uri?: string;
image_url?: string;
}>;
shipping_address?: {
first_name?: string;
last_name?: string;
line1: string;
line2?: string;
country: string;
postcode: string;
city: string;
state: string;
};
billing_address: {
first_name?: string;
last_name?: string;
line1: string;
line2?: string;
country: string;
postcode: string;
city: string;
state: string;
};
};
statistics: {
account_created?: string;
sales_total_number?: number;
sales_total_amount?: number;
sales_avg_value?: number;
sales_max_value?: number;
refunds_total_amount?: number;
previous_chargeback?: boolean;
currency?: string;
last_login?: string;
};
hide_shipping_address?: boolean;
}
export interface IAfterpayMeta {
amount: number;
currency: string;
email: string;
first_name: string;
last_name: string;
address_line: string;
address_line2: string;
address_city: string;
address_state: string;
address_postcode: string;
address_country: string;
phone: string;
}
export interface VaultDisplayStyle {
background_color?: string;
text_color?: string;
border_color?: string;
button_color?: string;
font_size?: string;
font_family?: string;
}
export interface IApplePayShippingOption {
id: string;
label: string;
detail: string;
amount: string;
type?: 'ELECTRONIC' | 'GROUND' | 'NOT_SHIPPED' | 'OVERNIGHT' | 'PICKUP' | 'PRIORITY' | 'SAME_DAY';
}
export interface IGooglePayShippingOption {
id: string;
label: string;
detail?: string;
type?: 'ELECTRONIC' | 'GROUND' | 'NOT_SHIPPED' | 'OVERNIGHT' | 'PICKUP' | 'PRIORITY' | 'SAME_DAY';
}
export interface IPayPalShippingOption {
id: string;
label: string;
amount: string;
currency: string;
type: 'SHIPPING' | 'PICKUP';
}
export type IShippingOption = IApplePayShippingOption | IGooglePayShippingOption | IPayPalShippingOption;
export declare enum WALLET_GATEWAY {
STRIPE = "Stripe",
FLYPAY = "Flypay",
FLYPAY_V2 = "FlypayV2",
PAYPAL = "Paypal",
MASTERCARD = "MasterCard",
AFTERPAY = "Afterpay"
}
export declare enum WALLET_TYPE {
GOOGLE = "google",
APPLE = "apple",
FLYPAY = "flypay",
FLYPAY_V2 = "flypayV2",
PAYPAL = "paypal",
AFTERPAY = "afterpay"
}
export interface ApplePayStyles {
button_type?: 'add-money' | 'book' | 'buy' | 'check-out' | 'continue' | 'contribute' | 'donate' | 'order' | 'pay' | 'plain' | 'reload' | 'rent' | 'set-up' | 'subscribe' | 'support' | 'tip' | 'top-up';
button_style?: 'black' | 'white' | 'white-outline';
}
export interface GooglePayStyles {
button_type?: 'book' | 'buy' | 'checkout' | 'donate' | 'order' | 'pay' | 'plain' | 'subscribe';
button_size_mode?: 'static' | 'fill';
button_color?: 'default' | 'black' | 'white';
}
export interface AfterpayStyles {
button_type?: 'black' | 'mint' | 'white';
height?: string;
}
export type WalletStyles = {
apple?: ApplePayStyles;
google?: GooglePayStyles;
afterpay?: AfterpayStyles;
} | object;
export type WalletRawDataInitialization = {
apple?: ApplePayRawDataInitialization;
google?: GooglePayRawDataInitialization;
} | object;
export type ApplePayRawDataInitialization = ApplePayJS.ApplePayPaymentRequest;
export type GooglePayRawDataInitialization = google.payments.api.IsReadyToPayPaymentMethodSpecification | google.payments.api.PaymentMethodSpecification;
export interface IWalletMeta {
amount_label?: string;
country?: string;
pay_later?: boolean;
hide_message?: boolean;
standalone?: boolean;
show_billing_address?: boolean;
request_payer_name?: boolean;
request_payer_email?: boolean;
request_payer_phone?: boolean;
request_shipping?: boolean;
shipping_options?: IShippingOption[];
merchant_name?: string;
raw_data_initialization?: WalletRawDataInitialization;
access_token?: string;
refresh_token?: string;
style?: WalletStyles;
wallets?: WALLET_TYPE[];
client_id?: string;
apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
}
export interface ITokenWalletMetaCredentials {
[WALLET_TYPE.APPLE]?: {
merchant?: string;
};
}
export interface ITokenWalletMeta {
charge: {
id: string;
amount: number;
currency: string;
capture?: boolean;
reference?: string;
meta?: {
success_url?: string;
error_url?: string;
};
};
gateway: {
type: string;
mode: string;
credentials?: ITokenWalletMetaCredentials;
};
credentials: {
client_auth: string;
};
}
export interface IMessageWidget {
title: string;
message: string;
type: string;
}
//# sourceMappingURL=param.d.ts.map