import type { BindCardRequest } from '../payments/PaymentRequest'; import type { BindCardResponse, RemoveCardResponse, TradeHistoryResponse } from '../payments/PaymentResponse'; import { BaseService } from './BaseService'; /** * 卡片管理服務 * * 提供卡片相關的 API 方法,包括綁定卡片、移除卡片和查詢卡片交易歷史。 */ export declare class CardService extends BaseService { /** * 綁定卡片 * * 綁定卡片以供未來的 token 付款使用。 * 會執行一筆 1 TWD 的測試交易並立即退款。 * * @param options - 綁定卡片選項 * @returns Promise 解析為綁定卡片回應(包含 card_key 和 card_token) * @throws {TapPayValidationError} 當必要欄位缺失或無效時 * @throws {TapPayError} 當 API 回應錯誤時 * @throws {TapPayTimeoutError} 當請求超時時 * * @example * ```typescript * const response = await cardService.bindCard({ * prime: 'prime_from_frontend', * currency: Currency.TWD, * cardholder: { * phone_number: '+886912345678', * name: 'Test User', * email: 'test@example.com' * } * }) * * if (response.card_secret) { * const { card_key, card_token } = response.card_secret * // 儲存以供未來付款使用 * } * ``` */ bindCard(options: Omit): Promise; /** * 移除綁定的卡片 * * 從 TapPay 伺服器移除已綁定的卡片。 * * @param cardKey - 要移除的卡片 key * @param cardToken - 要移除的卡片 token * @returns Promise 解析為移除卡片回應 * @throws {TapPayValidationError} 當 cardKey 或 cardToken 無效時 * @throws {TapPayError} 當 API 回應錯誤時 * @throws {TapPayTimeoutError} 當請求超時時 * * @example * ```typescript * await cardService.removeCard('card_key_123', 'card_token_123') * ``` */ removeCard(cardKey: string, cardToken: string): Promise; /** * 查詢卡片交易歷史 * * 取得使用特定卡片進行的所有交易記錄。 * * @param recTradeId - TapPay 交易 ID(用於標識卡片) * @returns Promise 解析為交易歷史回應 * @throws {TapPayValidationError} 當交易 ID 無效時 * @throws {TapPayError} 當 API 回應錯誤時 * @throws {TapPayTimeoutError} 當請求超時時 * * @example * ```typescript * const history = await cardService.getTradeHistory('D20231201123456789') * ``` */ getTradeHistory(recTradeId: string): Promise; } //# sourceMappingURL=CardService.d.ts.map