/** * Link Account Service (Account on File) * Handles account linking operations for Account on File feature */ import { BaseService } from './BaseService'; import { LinkAccountRequest, LinkAccountResponse, LinkAccountOptions, RemoveAccountTokenRequest, RemoveAccountTokenResponse, RemoveAccountTokenOptions, GetLinkedAccountDetailRequest, GetLinkedAccountDetailResponse, GetLinkedAccountDetailOptions } from '../types'; /** * Service for Account on File (Link Account) operations */ export declare class LinkAccountService extends BaseService { /** * Generate QR code or deeplink for account linking (simplified API) * * Returns a QR code or ABA Mobile deeplink that enables users to either scan * the QR code or use the deeplink to automatically launch the ABA Mobile app * and prompt the customer to select an ABA account to link to your platform. * Once the user finishes linking, PayWay will send pushback account details * and token to the merchant through the return_url. * * NOTE: Before using this API, ensure your profile has enabled the Account on File feature. * Contact merchant digital support (digitalsupport@ababank.com) for sandbox profile, * or merchant acquisition team (paywaysales@ababank.com) for production profile. * * IMPORTANT: returnUrl must be base64 encoded by the client before passing to this method. * * @param options - Link account options * @returns Link account response with QR code and deeplink * @throws {PayWayError} If request fails or validation errors occur * * @example * const result = await linkAccountService.createLinkRequest({ * returnParam: 'REQ0012', * returnUrl: Buffer.from('https://yourapp.com/api/account-linked').toString('base64'), * returnDeeplink: { * ios_scheme: 'myapp://account/linked', * android_scheme: 'myapp://account/linked' * } * }); */ createLinkRequest(options: LinkAccountOptions): Promise; /** * Request account linking (low-level API) * * @param params - Full request parameters * @returns Link account response * @throws {PayWayError} If API request fails */ linkAccount(params: LinkAccountRequest): Promise; /** * Remove a customer's linked account token (simplified API) * * Removes a customer's linked account token from your platform. Once the token * is removed, this action cannot be undone, and the token will no longer be * valid for purchases. * * NOTE: Before using this API, ensure your profile has enabled the Account on File feature. * * @param options - Remove account token options * @returns Remove account token response * @throws {PayWayError} If request fails or validation errors occur * * @example * const result = await linkAccountService.removeAccountToken({ * ctid: '522235C...C8FA2890C5378D7', * pwt: '522235462D55FA...6AF3DA7B968DD7B7F57A' * }); * * if (result.status.code === '00') { * console.log('Account token removed successfully'); * } */ removeAccountToken(options: RemoveAccountTokenOptions): Promise; /** * Remove account token (low-level API) * * @param params - Full request parameters * @returns Remove account token response * @throws {PayWayError} If API request fails */ removeAccount(params: RemoveAccountTokenRequest): Promise; /** * Get linked account details (simplified API) * * Retrieves linked account details if you encounter issues with the pushback * notification and do not receive the account details automatically. * * NOTE: This API only works for retrieving account tokens. It is not applicable * for card tokens. * * @param options - Get linked account detail options * @returns Linked account details with ctid, pwt, and masked account * @throws {PayWayError} If request fails or validation errors occur * * @example * const result = await linkAccountService.getLinkedAccountDetail({ * returnParam: 'REQ0012' * }); * * if (result.status.code === '00') { * console.log('Account Token:', result.data.pwt); * console.log('Masked Account:', result.data.mask_account); * } */ getLinkedAccountDetail(options: GetLinkedAccountDetailOptions): Promise; /** * Get linked account details (low-level API) * * @param params - Full request parameters * @returns Linked account details * @throws {PayWayError} If API request fails */ getAccountDetail(params: GetLinkedAccountDetailRequest): Promise; }