Skip to content

feat(sales): add payment/verification support to treatments, checkout-events, carts, sessions - #7

Merged
raunak-cispl1 merged 1 commit into
mainfrom
feat/treatments-sync-payment-verification
Sep 21, 2026
Merged

raunak-cispl1 merged 1 commit into
mainfrom
feat/treatments-sync-payment-verification

Conversation

@raunak-cispl1

Copy link
Copy Markdown
Contributor

Summary

  • BREAKING: treatments().sync() now requires userAgent — empty/missing throws TypeError. Adds optional payment and verification options with new exported types (TreatmentPaymentOptions, TreatmentCardOptions, TreatmentVerificationOptions, TreatmentIdVerificationOptions).
  • Documents the already-pass-through payment field on an OrderPlaced checkoutEvents().update() event, verification on sessions().create()/update(), and optional variant_id on carts() items — no behavior change on these three, docs only.
  • Mirrors the AsterMD PHP SDK's feat/treatments-sync-payment-verification branch to keep both SDKs on the same contract.
  • Version bumped to 0.0.3, CHANGELOG.md updated.

Test plan

  • npm run ci (lint, format, typecheck, vitest, build, publint) green
  • New/updated unit tests for Treatments.sync: required-userAgent validation, payment body shape (with/without card, pre-auth fields), verification body shape (with/without id check)

…-events, carts, sessions

BREAKING: treatments().sync() gains optional payment and verification
options; userAgent becomes a required, non-empty option since the API
now requires the User-Agent header on this endpoint.

Also documents the already-pass-through payment field on
checkoutEvents().update() order events and verification field on
sessions().create()/update(), and adds an optional variant_id to
carts() items.

Mirrors the AsterMD PHP SDK's feat/treatments-sync-payment-verification
branch. Cuts CHANGELOG.md as 0.0.3.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@raunak-cispl1
raunak-cispl1 merged commit aee434f into main Sep 21, 2026
2 checks passed
@raunak-cispl1
raunak-cispl1 deleted the feat/treatments-sync-payment-verification branch September 21, 2026 15:08
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.

1 participant