Repository navigation
feat(setups): add klarna and stcpay actions, tamara fields, payment type - #258
Conversation
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 3 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 |
Adds Klarna iban and action, stc pay action and the Tamara fields; payment_type gets its own enum with the six lowercase spec values; local_date_time and last_payment_amount follow the spec types. Members the spec does not have are deprecated.
338c986 to
8470818
Compare
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 3 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 |
🟠 Advisory review: Concerns worth a lookThis PR needs a human approval. Before you give it, these are the things I'd want resolved. The PR adds Klarna/stcpay actions, Tamara fields, and a new PaymentSetupPaymentType enum to the payment setups module, with matching serialization and integration tests. One concrete bug is visible in the truncated test diff: Concerns
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 |
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:The PR adds new enum values, new fields, and new nested classes purely as natural extensions of existing payment setup abstractions without introducing new endpoints, external integrations, persisted data classes, auth changes, or background workers.
wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…
The specification types last_payment_amount as a number (example 55.99), but the sandbox stores and returns 55 for 55.99. The doc says so, so the type is not changed back and forth; the specification is reported separately.
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 3 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 |
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 3 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 |
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 3 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 |
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 3 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 |
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 3 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 |
|



Summary
Payment Setup in Python gains Klarna
ibanandaction, stc payaction, and Tamarainitializationandrisk_assessment.payment_typegets its own enum with the six lowercase spec values (PaymentType.PAYLATERsendsPayLater, which the API rejects with 422),local_date_timeis typed as a date-time andlast_payment_amountas a number. Members not in the spec are marked deprecated, exceptcard_present, which the API supports. Every payment method keeps the base class it had before, andPaymentTypecan still be imported from the setups module.Changes
checkout_sdk/payments/setups/setups.py:PaymentSetupPaymentType(REGULAR,RECURRING,MOTO,INSTALLMENT,PAY_LATER,UNSCHEDULED) onPaymentSetupsRequest.payment_type; the paymentsPaymentTypeis unchanged.PaymentTypeis still imported in the setups module (marked# noqa: F401with a deprecation comment pointing toPaymentSetupPaymentType), sofrom checkout_sdk.payments.setups.setups import PaymentTypekeeps working.Klarna.iban,Klarna.action(KlarnaAction,KlarnaActionType),Stcpay.action(StcpayAction,StcpayActionType).Tamarakeeps its base classPaymentSetupPaymentMethodand declaresinitializationitself (defaultdisabled), plusrisk_assessment(TamaraRiskAssessment).BizumandBlikkeep their base classPaymentMethodBase. Each one redeclaresinitializationwith the same type and default and a deprecation comment, so callers and the request body do not change.PaymentSetupTerminal.local_date_timeisdatetime(a string is still sent unchanged);MerchantAccount.last_payment_amountisfloat.initializationdoc (PaymentMethodBaseandTamara) says that an update replaces the payment methods, soenabledmust be sent again to keep a method enabled; the specification does not state this, it is the API's behaviour.Ideal.description,Knet.languageandBancontact.account_holder_namesay that the specification marks them optional, but the API keeps the method invalid until they are sent.Blik.partner_codeis documented as writeOnly, as in the spec.tests/payments/setups/payment_setups_serialization_test.py: literal wire keys, round trips through the response wrapper for every new field and the spec examples, everyPaymentSetupPaymentTypevalue,local_date_timeas datetime and string,last_payment_amount55.99, deprecated members still sent, the base classes ofBizum,BlikandTamara, thePaymentTypeimport from the setups module, the deprecatedPaymentMethodAction.client_tokenandsession_idstill sent and read under their keys, and round trips forBlik.partner_code,Tabby.payment_typesandIdeal.descriptionwith their spec examples,Knet.languagewith both values andBancontact.account_holder_namewith a sample name (the spec has no example for those two).tests/payments/setups/payment_setups_integration_test.py: usesPaymentSetupPaymentType, and the create and get tests compare the responsepayment_typewith the request value directly instead of lowercasing both.API Reference
POST /payments/setups:payment_type,payment_methodsPUT /payments/setups/{id}GET /payments/setups/{id}POST /payments/setups/{id}/confirm/{payment_method_name}Deprecated
All of them will be removed in the next major version.
initializationonBizumandBlik. Not part of their schemas in the Payment Setups specification. No replacement.payment_method_optionsonKlarna,Stcpay,TabbyandBizum, and thePaymentMethodOptionsandPaymentMethodOptionclasses. Useactionon Klarna and stc pay; no replacement on Tabby and Bizum.PaymentSetupInstrument.phone,account_holderandallow_update. Removed from the Payment Setups specification; the API accepts and ignores them. No replacement.PaymentMethodAction.client_tokenandsession_id. Not part of the PayPal or instrument action schemas. For Klarna useKlarna.action(KlarnaAction); no replacement for PayPal and instrument.PaymentTypeimported fromcheckout_sdk.payments.setups.setups. UsePaymentSetupPaymentTypefor Payment Setups;PaymentTypestays incheckout_sdk.payments.paymentsfor/payments.Breaking changes
No class changes its base class and no import is removed.
Tamaranow sends"initialization": "disabled"by default (main sent{}). Harmless: an update replaces the payment methods, so omitting it also leaves Tamara disabled. Migration: setinitializationtoPaymentMethodInitialization.ENABLEDto enable Tamara.payment_type,local_date_time,last_payment_amount), but Python does not enforce them and existing values are still sent as before. Forpayment_type, aPaymentTypevalue keeps being sent as is:Regularis accepted, whilePayLaterkeeps getting the 422 from the API, so code that setsPaymentType.PAYLATERshould switch toPaymentSetupPaymentType.PAY_LATER. Responses readpayment_typeas the lowercase string, which compares equal to thePaymentSetupPaymentTypevalue.Follow-ups
Reported internally:
/paymentstypes until the next major version.README
No change needed.