@palta-brain/web-sdk
Version:
65 lines (64 loc) • 3.38 kB
TypeScript
import { BraintreeCheckout, PaymentMethodType } from '../type';
import { Client } from 'braintree-web/client';
import { ApplePayPaymentRequest } from 'braintree-web/apple-pay';
import { PayPalCheckout } from 'braintree-web/paypal-checkout';
import { ThreeDSecure } from 'braintree-web/three-d-secure';
import { Api } from '../services/api';
export declare const createPayPalCheckoutInstance: (clientInstance: Client) => Promise<PayPalCheckout>;
export declare const loadPayPalSDKWrapper: ({ paypalCheckoutInstance, braintreeOption, payPalEnv, braintreeCheckoutFormSelector, onErrorCustom, deviceData, api, }: {
paypalCheckoutInstance: PayPalCheckout;
deviceData: string;
api: Api;
onErrorCustom: (error: any, description: string) => void;
braintreeCheckoutFormSelector: string;
payPalEnv: string;
braintreeOption: any;
}) => Promise<({ currencyCode, price, orderId, }: {
price: string;
currencyCode: string;
orderId: string;
}) => Promise<void>>;
export declare const setupPayPalButton: (paypalCheckoutInstance: PayPalCheckout, deviceData: string, api: Api, orderId: string, onErrorCustom: (error: any, description: string) => void, price: string, currencyCode: string, braintreeCheckoutFormSelector: string, payPalEnv: string | undefined, braintreeOption: any) => Promise<void>;
export declare function getPayPalFunc(): (params: {
price: string;
currencyCode: string;
orderId: string;
}) => Promise<void>;
export declare const createHostedFieldsInstance: (clientInstance: Client, braintreeStyles: any) => Promise<import("braintree-web/hosted-fields").HostedFields>;
export declare const setupCardButton: ({ hostedFieldsInstance, deviceData, api, onErrorCustom, braintreeCheckoutFormSelector, braintreeOption, }: {
hostedFieldsInstance: any;
deviceData: string;
api: Api;
onErrorCustom: (error: any, description: string) => void;
braintreeCheckoutFormSelector: string;
braintreeOption: any;
}) => Promise<({ amount, orderId, threeDSecureInstance, }: {
amount: string;
orderId: string;
threeDSecureInstance: ThreeDSecure;
}) => Promise<void>>;
export declare const createApplePaySession: (clientInstance: any, paymentRequestData: Omit<ApplePayPaymentRequest, 'countryCode' | 'currencyCode' | 'merchantCapabilities' | 'supportedNetworks'> & Partial<Pick<ApplePayPaymentRequest, 'countryCode' | 'currencyCode' | 'merchantCapabilities' | 'supportedNetworks'>>) => Promise<({ total, currencyCode, }: {
total: string;
currencyCode: string;
}) => Promise<void>>;
export declare const getPaymentHandler: () => (params: {
amount: string;
orderId: string;
threeDSecureInstance: ThreeDSecure;
}) => Promise<void>;
export declare const getApplePayHandler: () => (params: {
total: string;
currencyCode: string;
}) => Promise<void>;
export declare const BraintreeCheckoutInit: ({ braintreeClientToken, paymentMethods, orderId, api, onErrorCustom, price, currencyCode, braintreeCheckoutFormSelector, payPalEnv, braintreeOption, }: {
braintreeClientToken: string;
paymentMethods?: PaymentMethodType[];
orderId: string;
api: Api;
onErrorCustom: (error: any, description: string) => void;
price: string;
currencyCode: string;
braintreeCheckoutFormSelector: string;
payPalEnv?: string;
braintreeOption: any;
}) => Promise<BraintreeCheckout>;