fix: add merchant_id to the Google Pay enrollment response - #651
Conversation
Reported internally on behalf of a merchant: the Google Pay enrollment response is missing merchant_id, which is what the caller needs to initialise Google Pay on the client. The root cause is the spec, not this SDK. GooglePayEnrollmentResponse declares only tosAcceptedTime and state, both required, omits merchant_id and sets additionalProperties false. The real 201 from POST /googlepay/enrollments returns merchant_id, tos_accepted_time and state. The class was generated faithfully from a wrong schema. The spec fix is being raised separately, otherwise the next regeneration reintroduces this. tosAcceptedTime already worked here: GsonSerializer applies FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES, so it matches tos_accepted_time on the wire without a SerializedName. Four new tests. They deserialize the real sandbox body rather than the swagger example, since the swagger example is the thing that was wrong, and one asserts merchant_id survives on its own, because losing it is the entire defect. Refs INT-1690.
🟢 Risk Classification: LOWApproval route: AI Auto-Approval Classification reasons
Operational gates
Files analysed: 2 wall-e 2026.06.19-02 · policy |
🔬 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.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
|
|
Update: the spec fix is merged, so this SDK change is now aligned with the spec rather than ahead of it. cko-web/checkout-api-reference#2084, merged 2026-08-18, changes
That matches this PR exactly, and it removes the regeneration risk noted above: the schema no longer reintroduces the problem. One caveat for whoever reviews this: the fix is merged in the spec repo but not yet published to the live spec at api-reference.checkout.com, which still serves the old |
There was a problem hiding this comment.
✅ Auto-approved — this PR meets all Low-risk criteria.
All checks passed, no unresolved comments, and the change classification is:
no_low_class_matchedprod_source_modified2.2.6_logical_extension:This is a purely additive field addition to an existing response model class, reusing existing serialization infrastructure, with no new endpoints, auth changes, persisted data, or external integrations.
wall-e 2026.06.19-02 · policy 376219bc71e6…



What
Adds
merchant_idto the Google Pay enrollment response.Reported internally on behalf of a merchant.
merchant_idis what the caller needs to initialise Google Pay on the client, so without it the enrollment response is not usable for its purpose.The root cause is the spec, not this SDK
GooglePayEnrollmentResponsein the spec declares onlytosAcceptedTimeandstate, both required, omitsmerchant_id, and setsadditionalProperties: false.The real 201 from
POST /googlepay/enrollmentsreturns:{ "merchant_id": "12345678901234567890", "tos_accepted_time": "2026-08-13T09:12:41Z", "state": "ACTIVE" }The model was generated faithfully from a wrong schema. The spec fix is being raised separately and is the actual fix: until it lands, the next regeneration reintroduces this.
Tests
They deserialize the real sandbox body, not the swagger example, because the swagger example is the thing that was wrong. One test asserts
merchant_idsurvives on its own, since losing it is the entire defect, and another asserts an absentmerchant_idcomes back null rather than blank, so a caller can tell "not returned" from "returned empty".Not breaking
Purely additive on a response model.
Refs INT-1690.
Note on the timestamp
tosAcceptedTimealready worked here:GsonSerializerappliesFieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES, so the field matchestos_accepted_timeon the wire without a@SerializedName. Only the missing field needed fixing.Four new tests, the whole Google Pay serialization suite green.