Repository navigation
feat(setups): add paypal and the flattened klarna, tabby, stc pay fields - #394
Conversation
PaymentMethods had no PayPal member, so a Payment Setup could not configure PayPal. Adds the PayPal method and the fields the spec defines on the flattened Klarna, Tabby and stc pay methods, including each method's read-only action.
🟢 Risk Classification: LOWApproval route: AI Auto-Approval Classification reasons
Operational gates
Files analysed: 9 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 |
The spec defines a different action object for each payment method, so each one gets its own class and action type, as Cash App, Pay by Bank and Instrument already do. Also deprecates payment_method_options on the touched methods, as requested in review, and tests the klarna and stc pay wire keys.
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 14 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 PayPal payment method and flattened action/field support for Klarna, Tabby, and stc pay payment setups; the diff matches the PR description and new tests cover serialization roundtrips, literal wire keys, enum values, and response deserialization. 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 |
|



Summary
PaymentMethodshad no PayPal member, so a Payment Setup could not configure PayPal at all. This adds the PayPal payment method and the fields the spec defines on the flattened Klarna, Tabby and stc pay methods, including the read-onlyactioneach method now returns directly. The spec defines a different action object per method, so each method gets its own action class, as Cash App, Pay by Bank and Instrument already do.Changes
Paypal/Paypal.php:$user_action,$brand_name(max 127 characters),$shipping_preferenceand read-only$action.Paypal/PaypalUserAction.php(pay_now,continue) andPaypal/PaypalShippingPreference.php(no_shipping,get_from_file,set_provided_address).Klarna/KlarnaAction.php($type,$client_token,$session_id),Paypal/PaypalAction.php($type,$order_id) andStcpay/StcpayAction.php($type), withKlarnaActionType(sdk),PaypalActionType(sdk) andStcpayActionType(otp).PaymentMethods.php: new$paypal, sent aspaypal.Klarna/Klarna.php: read-only$actionand$iban;$account_holderdocumented;$payment_method_optionsdeprecated.Stcpay/Stcpay.php: read-only$action;$otpdocumented as write only;$payment_method_optionsdeprecated.Tabby/Tabby.php:$payment_types(string[]);$payment_method_optionsdeprecated.PaymentSetupFieldsSerializationTest.php: literal wire keys for PayPal, Tabby, Klarna and stc pay requests, roundtrips of PayPal, Klarna, stc pay and Tabby with the spec examples, a response test that maps every returned key to the typed models, and the PayPal and action type values.API Reference
POST /payments/setups:payment_methods.paypal.brand_name,payment_methods.paypal.shipping_preference,payment_methods.tabby.payment_typesPUT /payments/setups/{id}GET /payments/setups/{id}POST /payments/setups/{id}/confirm/{payment_method_name}Deprecated
$payment_method_optionsonKlarna,StcpayandTabby(@deprecated). The API removedpayment_method_options: it no longer sends it and ignores it on requests. Use$actioninstead (Tabby has no replacement). It will be removed in the next major version. Requested in review.Breaking changes
None. Only new classes and properties, and deprecation notices.
README
No change needed.
SonarCloud
The new issues are expected to be the snake_case property name rule (php:S116): the property names are the JSON wire keys, as everywhere else in the SDK. Pending confirmation by someone with Sonar access.