Skip to content

feat: add merchant payments product SDK#86

Open
replghost wants to merge 13 commits into
mainfrom
rfc17-merchant-payments-sdk
Open

feat: add merchant payments product SDK#86
replghost wants to merge 13 commits into
mainfrom
rfc17-merchant-payments-sdk

Conversation

@replghost

Copy link
Copy Markdown

Summary

Closes #85.

Adds a product-bundled Merchant Payments SDK for T3rminal-style checkout flows on top of host CoinPayment primitives. This keeps merchant checkout logic in product-sdk/product code rather than requiring window.ua.ext.merchantPayments in the host.

What changed

  • Adds CoinPayment SDK/types and generated-style RFC17 contract types for purse, receivable, invoice, cheque, deposit, and refund flows.
  • Adds @parity/product-sdk-merchant-payments and umbrella @parity/product-sdk/merchant-payments exports for intent, invoice, status, receipt, refund, and purse summary helpers.
  • Uses host-created CoinPayment invoices when available and falls back through the CoinPayment product API shape.
  • Adds Merchant Payments Product SDK design docs at packages/merchant-payments/docs/merchant-payments-product-sdk.md.
  • Covers idempotency conflicts, persistence, EUR quote handling, original-payment refunds, partial refunds, and subscription setup errors.

Test plan

  • pnpm --filter @parity/product-sdk-coinpayment test
  • pnpm --filter @parity/product-sdk-merchant-payments test
  • pnpm --filter @parity/product-sdk-coinpayment build
  • pnpm --filter @parity/product-sdk-merchant-payments build
  • pnpm --filter @parity/product-sdk-contracts build
  • pnpm --filter @parity/product-sdk build

Release request

Please cut a beta npm release from this branch/PR so T3rminal can consume the SDK before this lands on main.

@replghost replghost force-pushed the rfc17-merchant-payments-sdk branch from 862b979 to 471f813 Compare May 14, 2026 02:34
@TarikGul TarikGul self-requested a review May 14, 2026 12:04
@github-actions

github-actions Bot commented May 15, 2026

Copy link
Copy Markdown

📦 Bundle size impact

Comparing 2026-05-15T21:29:03.091Z2026-05-15T21:28:59.698Z

Package Entry Bundled before Bundled after Δ Ship gzip Δ Shake ratio
🟢 @parity/product-sdk . 6.35 MB 6.37 MB +18.8 KB (+0.3%) +35 B 0% (was 0%)
🟢 @parity/product-sdk ./coin-payment new entry
🟢 @parity/product-sdk ./merchant-payments new entry
🟢 @parity/product-sdk-coin-payment new package
🟢 @parity/product-sdk-merchant-payments new package

Thresholds — warn: ≥10% or ≥5.0 KB · fail: ≥20% or ≥15.0 KB (bundled). Percentage only applies once the baseline is ≥ 10 KB.

@replghost replghost force-pushed the rfc17-merchant-payments-sdk branch from 020e66d to fd59ce5 Compare May 15, 2026 20:27
@TarikGul

Copy link
Copy Markdown
Member

Needs to pull in main in order for the e2e tests to pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merchant Payments Product SDK

4 participants