Repository navigation
feat(setups): add the setup payment type, confirm risk and tamara fields - #700
rodrigojara-cko wants to merge 6 commits into
Conversation
payment_type used the payments PaymentType, which sends PayLater (rejected with 422) and cannot read the lowercase values the API returns. The confirm response gets risk, Tamara gets initialization and risk_assessment, and card_present is deprecated.
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 19 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: Looks good to meThis 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. Adds a dedicated PaymentSetupPaymentType enum with correct lowercase wire values, fixes missing What I checked
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 |
Adds round trip and spec example tests for every payment method without one, documents that the API stores last_payment_amount as an integer, and drops the initialization doc sentence the spec does not support.
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 20 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 |
| final String wireKey, | ||
| final Supplier<? extends PaymentMethodBase> factory, | ||
| final Function<PaymentMethods, ? extends PaymentMethodBase> getter, | ||
| final BiConsumer<PaymentMethods.PaymentMethodsBuilder, PaymentMethodBase> setter) { |
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 20 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 |
MerchantAccount.lastPaymentAmount is a Double, the type the specification gives last_payment_amount, as in the other SDKs. card_present and its classes are restored as on master: the API still supports them.
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 20 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: 23 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_typeon Payment Setup used the paymentsPaymentType, which sends values such asPayLaterthat the API rejects with 422 and reads every lowercase value exceptregularas null. It now has its own enum with the six spec values. The confirm response gets theriskit was missing and Tamara getsinitializationandrisk_assessment.last_payment_amounttakes the specification's number type.Changes
entities/paymentType/PaymentSetupPaymentType.java(new):REGULAR,RECURRING,MOTO,INSTALLMENT,PAY_LATER,UNSCHEDULED, sent lowercase. Used byPaymentSetupsRequest(defaultREGULAR),PaymentSetupsResponseandPaymentSetupsConfirmResponse;com.checkout.payments.PaymentTypeis unchanged.PaymentSetupsConfirmResponse.java:risk(PaymentSetupRisk).tamara/Tamara.java:initialization(defaultDISABLED, as the other methods) andriskAssessment;tamara/TamaraRiskAssessment.java(new).customer/MerchantAccount.java:lastPaymentAmountisDouble(wasLong), the specification's number type, as the otherlast_payment_amountfields of the SDK. Its doc notes that the API currently stores it as an integer.Klarna,Bacs,CashApp,PayPal,Stcpay,Tabby,Tamara: theinitializationdoc gives the spec description and default, and says that an update replaces the payment methods, soENABLEDmust be sent again to keep a method enabled (API behaviour, not stated in the spec).PaymentMethods.java,Order.java, the request and both responses: docs completed against the spec.ideal/Ideal.javadescription,knet/Knet.javalanguage,bancontact/Bancontact.javaaccountHolderName: the doc says that the specification marks the field optional, but the API keeps the method invalid until it is sent.PaymentSetupPaymentTypevalue written and read, the default, round trips through the request and both responses; confirmrisk; Order and Tamara round trips with literal keys and the spec examples;PaymentSetupsTestITuses the new enum.PaymentSetupsPaymentMethodsSerializationTest.java(new): a round trip with every property under its literal wire key and a spec example test for Ach, Sepa, Swish, P24, Qpay, Ideal, Knet, Bancontact, Multibanco, Blik, Bacs, Alipay CN, Alipay HK, GCash, TNG, Dana, KakaoPay, TrueMoney, Alma, Benefit, EPS, MBWay, MobilePay, Octopus, PayNow, Sequra, Twint, Vipps and WeChatPay;last_payment_amountround trip under its literal key with the spec example 55.99.PaymentSetupsNewFieldsSerializationTest.java,LocalDateFieldsRegressionTest.java:lastPaymentAmountuses 55.99.API Reference
POST /payments/setups:payment_type,payment_methodsPUT /payments/setups/{id}GET /payments/setups/{id}POST /payments/setups/{id}/confirm/{payment_method_name}Breaking changes required by the API
paymentTypeonPaymentSetupsRequest,PaymentSetupsResponseandPaymentSetupsConfirmResponseisPaymentSetupPaymentType; code passingcom.checkout.payments.PaymentTypemust switch, includingPaymentType.REGULAR, which no longer compiles there (usePaymentSetupPaymentType.REGULAR).PaymentSetupsConfirmResponsetakes the newriskargument.Breaking changes chosen by the SDK
MerchantAccount.lastPaymentAmountisDoubleinstead ofLong: aligned with the specification type; the same type in every SDK. Code that passes aLong(for examplelastPaymentAmount(1000L)) or reads the value asLongstops compiling and must useDouble.Follow-ups
Reported internally, for later:
Order.itemsandOrder.shippingkeep the payments types until the next major version.PaymentSetupsConfirmResponse, a duplicate ofPaymentSetupsResponse) until the next major version.Resourcelinks, which the Payment Setups specification does not define.CardAccountHolderkeeps its name (the spec calls itPaymentSetupAccountHolder) until the next major version.terminal.local_date_timeis anInstantand loses the offset (tracked separately).initializationsenddisabledby default. An update replaces the payment methods, so this matches omitting it.README
No change needed.