Skip to content

fix(issuing): map mid_limit and complete card control and card create responses - #622

Merged
armando-rodriguez-cko merged 4 commits into
masterfrom
fix/INT-1704-issuing-control-limit-responses
Oct 13, 2026
Merged

armando-rodriguez-cko merged 4 commits into
masterfrom
fix/INT-1704-issuing-control-limit-responses

Conversation

@armando-rodriguez-cko

Copy link
Copy Markdown
Contributor

Summary
Fixes and completes the issuing card control and card create responses against the API reference. mid_limit was never read (the property was mapped to velocity_limit), card create responses carrying controls failed to deserialize, and several properties were missing.

Changes

  • MidCardControlResponse: adds MidLimit mapped to mid_limit
  • VelocityLimit: adds AmountRemaining (long?), null on requests and never sent
  • Control response classes and VelocityLimit, MccLimit, MidLimit, VelocityWindow: doc comments completed
  • ControlsSerializationTest (new): each subtype from the API reference example, roundtrip, list response, _links on create, deprecated alias, amount_remaining absent on requests

Also fixed while here

  • AbstractCardControlResponse now extends Resource, like the rest of the SDK's responses, so the create control response exposes _links
  • CardControlsResponseConverter read the subtype from type, but card create controls carry control_type; any card create response with controls threw NotImplementedException. It now reads control_type and falls back to type
  • MidCardControlsResponse (card create controls): adds MidLimit mapped to mid_limit, same bug as above
  • AbstractCardCreateResponse: adds Scheme; doc comments on the card create response classes and Credentials rewritten with the API reference constraints
  • CardCreateResponseSerializationTest (new): virtual and physical card create examples, full roundtrips, controls with all three types

Deprecated

  • MidCardControlResponse.VelocityLimit and MidCardControlsResponse.VelocityLimit: use MidLimit. They now forward to MidLimit, so existing callers start getting the value
  • AbstractCardControlsResponse.TargetId, CreatedDate, LastModifiedDate: not returned by the API in the card create response
    All of them will be removed in the next major version.

API Reference

  • PUT /issuing/controls/{controlId}, GET /issuing/controls/{controlId}, GET /issuing/controls, POST /issuing/controls
  • POST /issuing/cards (add-card-response, add-virtual-card-response, add-physical-card-response)

Breaking changes
None. Deprecated members keep working until the next major version.

README
No change needed.

@armando-rodriguez-cko
armando-rodriguez-cko requested a review from a team October 8, 2026 13:41
@agent-wall-e

agent-wall-e Bot commented Oct 8, 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/CheckoutSdk/Issuing/Cards/Responses/Create/Credentials.cs

Operational gates

  • ✅ jira_ticket (INT-1704)
  • ✅ independent_review

Files analysed: 19


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Oct 8, 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/CheckoutSdk/Issuing/Cards/Responses/Create/Credentials.cs 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 Oct 8, 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 fixes the mid_limit mapping bug in both control response hierarchies, adds amount_remaining to VelocityLimit, fixes the CardControlsResponseConverter discriminator to read control_type first, promotes AbstractCardControlResponse to extend Resource, and adds Scheme to AbstractCardCreateResponse — all with new roundtrip serialization tests covering each subtype. The changes are internally consistent and match the stated intent.

What I checked

  • The deprecated VelocityLimit properties on MidCardControlResponse and MidCardControlsResponse correctly forward to MidLimit via getter/setter and are marked [JsonIgnore], so existing callers get the correct value and serialization emits mid_limit only once.
  • CardControlsResponseConverter now reads control_type first and falls back to type, which is the correct fix for the NotImplementedException on card create responses with controls.
  • VelocityLimit.AmountRemaining is a nullable long with no [JsonProperty] attributes visible in the diff; the test ShouldNotSendAmountRemainingOnVelocityCardControlUpdate implicitly verifies null values are not serialized, which depends on the SDK's global NullValueHandling setting — this is consistent with how other optional nullable fields work in the SDK.
  • AbstractCardControlResponse now extends Resource instead of HttpMetadata; this is a behavioral change (Links property added) but is non-breaking since Resource extends HttpMetadata.
  • The test file is truncated in the diff but the visible portions cover all three control subtypes and both card create response types with full roundtrips, which is appropriate coverage for the changes made.

⚠️ 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

…onses

MidCardControlResponse now exposes MidLimit mapped to mid_limit; the old
VelocityLimit property is obsolete and forwards to MidLimit. VelocityLimit
gains AmountRemaining (response only, null on requests). Complete doc
comments on the control response types and add serialization tests.
…l links

MidCardControlsResponse now exposes MidLimit mapped to mid_limit; the old
VelocityLimit property is obsolete and forwards to MidLimit. Card control
responses extend Resource so the create operation returns _links. Complete
doc comments and add serialization tests.
The converter for the controls returned when a card is created looked for
a type field, which the API does not send for controls, so any card
created with controls failed to deserialize. It now reads control_type and
falls back to type.
Add scheme to the card create response, complete its doc comments, and
deprecate target_id, created_date and last_modified_date on the controls
returned with a created card, since the API does not return them there.
Serialization tests cover every property for virtual and physical cards.
@armando-rodriguez-cko
armando-rodriguez-cko force-pushed the fix/INT-1704-issuing-control-limit-responses branch from 2df8540 to edf1e4a Compare October 13, 2026 07:43
@agent-wall-e

agent-wall-e Bot commented Oct 13, 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/CheckoutSdk/Issuing/Cards/Responses/Create/Credentials.cs

Operational gates

  • ✅ jira_ticket (INT-1704)
  • ✅ independent_review

Files analysed: 19


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Oct 13, 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/CheckoutSdk/Issuing/Cards/Responses/Create/Credentials.cs 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

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@armando-rodriguez-cko
armando-rodriguez-cko merged commit a21463d into master Oct 13, 2026
10 of 12 checks passed
@armando-rodriguez-cko
armando-rodriguez-cko deleted the fix/INT-1704-issuing-control-limit-responses branch October 13, 2026 10:52
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.

2 participants