Repository navigation
feat: add coupons().validate(); treatments().sync() card last_4 replaces bin - #15
Merged
Merged
Conversation
…ces bin - coupons().validate() checks a coupon code against a cart without redeeming it (POST /v1/sales/coupons/validate). - BREAKING: treatments().sync() payment card: bin removed, optional last_4 added. - Bump version to 0.0.4; update CHANGELOG, README and docs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* origin/main: chore(deps-dev): Bump the build group across 1 directory with 3 updates chore(deps-dev): Bump @types/node from 22.20.1 to 22.20.5 chore(deps-dev): Bump the eslint group with 2 updates chore(deps-dev): Bump the vitest group with 2 updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mirrors the PHP SDK changes (branch feat/coupons-validate-card-last4, commit 1040ae5).
Added
coupons().validate()- checks a coupon code against a cart without redeeming it(
POST /v1/sales/coupons/validate).code,items(1-6 lines), optionalpatientId/email/opportunityId.{ plan_id, quantity }or{ product_id, variant_id, quantity }, never both, never amounts.NotFoundError; any other refusal (422) throwsValidationError.Coupons,CouponCartItem,CouponValidateOptions.Changed
treatments().sync()paymentcard:binremoved, optionallast_4(last four digits) added. Checkout-events card docs unchanged.
Housekeeping
Test plan
npm run cigreen (lint, format, typecheck, 428 tests, build, publint)npm run scrubsilentcoupons.spec.ts: URL, method, auth header, body shape, optional ids omitted, 404, 422