Skip to content

feat(payments): deprecate marketplace and add payment action items - #728

Merged
david-ruiz-cko merged 1 commit into
masterfrom
fix/INT-1939-maintenance
Dec 4, 2026
Merged

david-ruiz-cko merged 1 commit into
masterfrom
fix/INT-1939-maintenance

Conversation

@david-ruiz-cko

@david-ruiz-cko david-ruiz-cko commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The API now refuses a payment request that carries marketplace (422 marketplace_not_supported); the field is not part of the payment request in the API specification, and amount_allocations replaces it. The deprecation of marketplace on the payment, capture, payment action and get payment types now says so and points to amountAllocations, the MarketplaceData classes are deprecated, and nothing sent changes. The OAuth payment integration test sends amountAllocations instead, and PaymentAction reads the items the API returns.

Changes

  • src/main/java/com/checkout/payments/request/PaymentRequest.java: the marketplace deprecation says the API rejects it (422 marketplace_not_supported), to use amountAllocations and that it goes in the next major version.
  • src/main/java/com/checkout/payments/CaptureRequest.java: marketplace deprecation reworded (not part of the API specification, amountAllocations, next major version); class and every property documented from the spec.
  • src/main/java/com/checkout/payments/PaymentAction.java: same marketplace rewording; class and every property documented from the spec; new items (List<ProductResponse>), which the spec defines on the payment action and the SDK did not read.
  • src/main/java/com/checkout/payments/response/GetPaymentResponse.java: same marketplace rewording.
  • src/main/java/com/checkout/common/MarketplaceData.java, MarketplaceDataSubEntity.java: classes (and the nested MarketplaceCommission) deprecated in favour of AmountAllocations and Commission; fields documented. Only the deprecated marketplace fields use them; sessions use their own SessionMarketplaceData.
  • src/test/java/com/checkout/OAuthTestIT.java: the OAuth payment allocates its amount to the sub-entity with amountAllocations instead of marketplace; without an allocation the API answers 422 amount_allocations_required.
  • src/test/java/com/checkout/payments/PaymentsSerializationTest.java (new): capture request empty and with every property, payment action with every property and the spec example, and the deprecated marketplace on both.
  • src/test/java/com/checkout/payments/response/GetPaymentResponseSerializationTest.java (new) and PaymentRequestSerializationTest.java: marketplace and amountAllocations read the same allocation from a get payment response; the marketplace JSON of a payment request is pinned unchanged.

Design notes: marketplace is deprecated, not removed. Removing it would break code that compiles today, and the API still accepts it on a capture and still returns it on a get payment and its actions, next to amount_allocations. Only the payment request text says the API rejects it, because that is the call verified to fail. PaymentAction.items is added because the class was audited against the spec in full for this change and the field was missing; it is read only.

API Reference

Breaking changes

None. No signature, type, default or wire change; PaymentAction.items is a new property. Code that uses MarketplaceData or MarketplaceDataSubEntity now gets deprecation warnings, which fail a build compiled with -Werror. Migration: use amountAllocations and AmountAllocations.

Tests

  • Existing tests pass
  • Serialization tests cover every new or changed property
  • README updated if documented usage changed (not applicable: the README does not document marketplace)

./gradlew clean compileJava compileTestJava javadoc --no-scan: green, javadoc warnings unchanged (103 before and after). ./gradlew test --no-scan --tests '*SerializationTest' --tests com.checkout.payments.PaymentsClientImplTest --tests com.checkout.OAuthTestIT: 836 tests, 0 failed. OAuthTestIT against the sandbox: 1 of 6 failed before (422 marketplace_not_supported), 6 of 6 pass after.

Related

None.

@david-ruiz-cko
david-ruiz-cko requested a review from a team December 4, 2026 10:13
@agent-wall-e

agent-wall-e Bot commented Dec 4, 2026

Copy link
Copy Markdown

🔴 Risk Classification: MAJOR

Approval route: AI Review + Human Approval Required
Rollback controls: Change-freeze window + documented rollback plan

Classification reasons

  • security_sensitive_path:src/test/java/com/checkout/OAuthTestIT.java

Operational gates

  • ✅ jira_ticket (INT-1939)
  • ✅ independent_review

Files analysed: 10


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Dec 4, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
security_sensitive_path — src/test/java/com/checkout/OAuthTestIT.java classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@agent-wall-e

agent-wall-e Bot commented Dec 4, 2026

Copy link
Copy Markdown

🟢 Advisory review: Looks good to me

This PR still needs a human approval — wall-e cannot auto-approve it. For what it's worth, I read the diff and found nothing I'd block on.

This PR deprecates the MarketplaceData/MarketplaceDataSubEntity classes and updates javadoc across several request/response types to explain that the marketplace field is rejected by the API (422 marketplace_not_supported), replacing the integration test to use amountAllocations instead. The diff does exactly what the title claims and adds meaningful serialization tests covering the deprecated path.

What I checked

  • The integration test in OAuthTestIT correctly replaces the deprecated MarketplaceData.subEntityId with an AmountAllocations entry that carries the same entity ID and the full payment amount, which matches the described API requirement.
  • New PaymentsSerializationTest and GetPaymentResponseSerializationTest add round-trip and deserialization coverage for both the deprecated marketplace field and the replacement amountAllocations field, strengthening rather than weakening test coverage.
  • The @Deprecated annotation is correctly placed at the class level on MarketplaceData and MarketplaceDataSubEntity, and at the field level on the marketplace property in PaymentRequest, CaptureRequest, PaymentAction, and GetPaymentResponse — consistent placement throughout.
  • The newly added items field on PaymentAction (a List<ProductResponse>) appears to be a net-new field on a response object; the deserialization test exercises it, so it looks intentional and correct.
  • The PaymentRequest javadoc now explicitly states the field causes a 422 marketplace_not_supported error, which is a stronger and more useful deprecation notice than the previous one.

⚠️ The diff was too large to read in full, so this review covers only part of the change.


This is not an approval. wall-e cannot auto-approve this PR — it is an opinion to help whoever does. Advisory review · us.anthropic.claude-sonnet-4-6 · wall-e 2026.06.19-02

@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

@david-ruiz-cko david-ruiz-cko changed the title fix(deprecation): marketplace payment rejection feat(payments): deprecate marketplace and add payment action items Dec 4, 2026
@david-ruiz-cko
david-ruiz-cko merged commit fb048b6 into master Dec 4, 2026
6 checks passed
@david-ruiz-cko
david-ruiz-cko deleted the fix/INT-1939-maintenance branch December 4, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants