ZH
测试版翻译

@core / contracts

1.0.0 ▾
已验证MIT
GitHub

GenPM 模块共享类型:内容、站点地图、搜索、后台资源、支付和追踪事件

代码10 个文件上下文约 532 个 token扫描通过

应用 .genpmignore 后将被注入的确切目录树。固定于

src/lib/contracts/payment.ts只读 · 7266529
// Pasarela de pago vista desde los pedidos: la implementa @core/checkout (Stripe); la consume @core/orders para
// reembolsos sin depender de Stripe.
import type { Money } from './money.ts';

export type PaymentStatus = 'pending' | 'succeeded' | 'failed' | 'refunded' | 'partially_refunded';

export type PaymentProvider = {
  /** `stripe`, `paypal`… Se guarda en el pedido junto a la referencia. */
  name: string;
  getPayment(paymentRef: string): Promise<{ status: PaymentStatus; amount: Money } | null>;
  /** Reembolsa `amount` (≤ lo cobrado). Debe ser idempotente por `idempotencyKey`. */
  refund(
    paymentRef: string,
    amount: Money,
    opts: { idempotencyKey: string; reason?: string },
  ): Promise<{ refundRef: string }>;
};

举报 @core/contracts

使用 GitHub 登录后才能举报包。