import { PAYMENT_PROVIDERS } from '@medipass/utils/constants'; import type { MedipassRequestOpts } from '../types'; import type { PaymentMethod, PaymentMethodResponse } from '../types/payment-methods'; export * from '../types/payment-methods'; /** * Create an account's payment method * @param {String} accountId - Account ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const createAccountPaymentMethod: (accountId: string, nonce: string, source: string, opts?: MedipassRequestOpts) => Promise; /** * Get a business' payment methods * @param {String} businessId - Business ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const createBusinessPaymentMethod: (businessId: string, nonce: string, source: string, opts?: MedipassRequestOpts) => Promise; /** * Create a business patient payment method * @param {String} accountId - Account ID * @param {String} patientId - Patient ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const createBusinessPatientPaymentMethod: (businessId: string, patientId: string, nonce: string, source: string, opts?: MedipassRequestOpts) => Promise; /** * Delete an account's payment method * @param {String} accountId - Account ID * @param {String} paymentMethodId - Account ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const deleteAccountPaymentMethod: (accountId: string, paymentMethodId: string, opts?: MedipassRequestOpts) => Promise>; /** * Delete a business' payment method * @param {String} businessId - Business ID * @param {String} paymentMethodId - Payment Method ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const deleteBusinessPaymentMethod: (businessId: string, paymentMethodId: string, opts?: MedipassRequestOpts) => Promise>; /** * Delete a business patient payment method * @param {String} businessId - Business ID * @param {String} patientId - Patient ID * @param {String} paymentMethodId - Payment Method ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const deleteBusinessPatientPaymentMethod: (businessId: string, patientId: string, paymentMethodId: string, opts?: MedipassRequestOpts) => Promise>; /** * Get an account's payment methods * @param {String} accountId - Account ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const getAccountPaymentMethods: (accountId: string, opts?: MedipassRequestOpts) => Promise>; /** * Get a business' payment methods * @param {String} businessId - Business ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const getBusinessPaymentMethods: (businessId: string, opts?: MedipassRequestOpts) => Promise; /** * Get a business patient payment methods * @param {String} businessId - Business ID * @param {Object} opts - Additional options * @returns {Object} The payment methods data */ export declare const getBusinessPatientPaymentMethods: (businessId: string, patientId: string, opts?: MedipassRequestOpts) => Promise; /** * Get a business patient payment methods by ref id * @param {String} businessId - Business ID * @param {String} refId - Patient ref ID * @param {Object} opts - Additional options * @returns {Object} The payment methods data */ export declare const getBusinessPatientPaymentMethodsByRefId: (businessId: string, refId: string, opts?: MedipassRequestOpts) => Promise; /** * Get an account's payment method * @param {String} accountId - Account ID * @param {String} paymentMethodId - Account ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const getAccountPaymentMethod: (accountId: string, paymentMethodId: string, opts?: MedipassRequestOpts) => Promise; /** * Get a business payment method * @param {String} businessId - Business ID * @param {String} paymentMethodId - Payment Method ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const getBusinessPaymentMethod: (businessId: string, paymentMethodId: string, opts?: MedipassRequestOpts) => Promise; /** * Get a business patient payment method * @param {String} businessId - Business ID * @param {String} patientID - Patient ID * @param {String} paymentMethodId - Payment Method ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const getBusinessPatientPaymentMethod: (businessId: string, patientId: string, paymentMethodId: string, opts?: MedipassRequestOpts) => Promise; export interface ClientToken { clientToken: string; merchantId: string; source: 'mastercard'; } export interface NonceResponse extends ClientToken { nonce: string; sourceResponse: any; } export interface ApplePayResponse extends ClientToken { canMakeApplePayment: boolean; paymentRequest: { countryCode: string; currencyCode: string; supportedNetworks: string[]; merchantCapabilities: string[]; total: { label: string; amount: string; }; }; } export declare type GetNonceResponse = ClientToken | NonceResponse | ApplePayResponse; /** * Get business client token * @param {String} businessId - Business ID * @param {String} source - Source of payment * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const getBusinessClientToken: (businessId: string, source: string, opts?: MedipassRequestOpts) => Promise; /** * Get business payment client token * @param {String} businessId - Business ID * @param {String} patientId - Patient ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const getBusinessPaymentClientToken: (businessId: string, patientId: string, opts?: MedipassRequestOpts) => Promise; /** * Get business sales client token * @param {String} businessId - Business ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const getBusinessSalesClientToken: (businessId: string, opts?: MedipassRequestOpts) => Promise; /** * Get client token * @param {String} source - Source of payment * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const getClientToken: (source: string, opts?: MedipassRequestOpts) => Promise; /** * Update an account's payment method * @param {String} accountId - Account ID * @param {String} paymentMethodId - Account ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const updateAccountPaymentMethod: (accountId: string, paymentMethodId: string, body: Record, opts?: MedipassRequestOpts) => Promise; /** * Update a business' payment method * @param {String} businessId - Business ID * @param {String} paymentMethodId - Account ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const updateBusinessPaymentMethod: (businessId: string, paymentMethodId: string, body: Record, opts?: MedipassRequestOpts) => Promise; /** * Update a business patient payment method * @param {String} businessId - Business ID * @param {String} paymentMethodId - Account ID * @param {Object} opts - Additional options * @returns {Object} The device data */ export declare const updateBusinessPatientPaymentMethod: (businessId: string, patientId: string, paymentMethodId: string, body: Record, opts?: MedipassRequestOpts) => Promise; export declare const getPaymentGatewayError: (sessionResponse: Record) => "The payment card details you entered were invalid, please review the payment card credentials and try again." | "There are issues connecting to the payment gateway. Please refresh the page and try again." | null; /** * Get a business nonce * @param {Object} body - Request body * @param {Object} opts - Additional options */ export declare const getNonce: ({ amount, businessId, patientId, cardNumber: _cardNumber, expiry, cvc, paymentProvider, isSales, isSelfCheckoutSession, source }: { amount?: string | undefined; businessId?: string | undefined; patientId?: string | undefined; cardNumber?: string | undefined; expiry?: string | undefined; cvc?: string | undefined; paymentProvider?: "payment-card" | "google-pay" | "apple-pay" | undefined; isSales?: boolean | undefined; isSelfCheckoutSession?: boolean | undefined; source?: "mastercard" | undefined; }, opts?: MedipassRequestOpts) => Promise;