Skip to content

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

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

Aligns four sales service resources with upstream API contract updates:

  • treatments()->sync() (BREAKING): adds optional $payment and $verification array params. $userAgent moves earlier in the signature and becomes required + non-empty (the API now requires the User-Agent header on this endpoint) — throws \InvalidArgumentException if empty. New signature: sync(string $session, array $orderIds, string $userAgent, ?string $utmSource = null, ?array $payment = null, ?array $verification = null)
  • checkoutEvents()->update(): documents the optional payment field on order events (already forwarded as pass-through $data, so no code change — docblock only).
  • carts()->create() / carts()->update(): items accept an optional variant_id (already forwarded as pass-through, docblock + CartItem type updated).
  • sessions()->create() / sessions()->update(): documents the optional verification field (already forwarded as pass-through $data — docblock only).

CHANGELOG.md cut as 0.0.3 (2026-09-21). docs/INTEGRATION_GUIDE.md updated for the treatments()->sync() signature change.

Test plan

  • DOCKER=0 make ci green: php-cs-fixer (0 files need fixing) → phpstan level max (no errors) → phpunit (238 tests, 527 assertions)
  • New/updated unit tests cover: sync()'s new required/optional params, empty-$userAgent guard, payment/verification body forwarding on treatments()->sync(), checkoutEvents()->update(), carts(), and sessions()

…-events, carts, sessions

BREAKING: treatments()->sync() gains optional $payment and $verification
array params; $userAgent moves earlier in the signature and becomes a
required, non-empty argument 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.

Cuts CHANGELOG.md as 0.0.3.

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