Skip to content

feat(setups): add setup payment type, drop rejected identification types - #226

Merged
rodrigojara-cko merged 8 commits into
masterfrom
feat/INT-1738-payment-setup-gaps
Oct 30, 2026
Merged

rodrigojara-cko merged 8 commits into
masterfrom
feat/INT-1738-payment-setup-gaps

Conversation

@rodrigojara-cko

@rodrigojara-cko rodrigojara-cko commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Payment Setup in Ruby gets PaymentSetupPaymentType with the six lowercase values of the specification, documented on create and update. The account funding identification type loses TAX_ID and OTHER, which the API rejects with 422, and the account funding sender gets the reference field of the specification. The confirm integration spec no longer skips every time and asserts the fields of the Payment Setup it returns, and the six account funding sender and recipient fields the spec does not have are deprecated.

Changes

  • lib/checkout_sdk/payments/setups/payment_setup_payment_type.rb (new): PaymentSetupPaymentType with REGULAR, RECURRING, MOTO, INSTALLMENT, PAY_LATER, UNSCHEDULED ("regular" ... "unscheduled").
  • lib/checkout_sdk/payments/payments.rb: requires the new file.
  • lib/checkout_sdk/payments/setups/payment_setups_client.rb: :payment_type documented on create_payment_setup and update_payment_setup. PaymentType is unchanged.
  • lib/checkout_sdk/payments/setups/account_funding_transaction_identification_type.rb: TAX_ID and OTHER removed; docs on the remaining values.
  • lib/checkout_sdk/payments/setups/account_funding_transaction_identification.rb: one doc entry per attribute against the spec.
  • lib/checkout_sdk/payments/setups/account_funding_transaction_sender.rb: new reference attribute (the unique reference for the sender of the payment), sent as account_funding_transaction.sender.reference; first_name, last_name, country_of_birth, nationality and address marked @deprecated; one doc entry per attribute against the spec (description, optionality, date_of_birth format date).
  • lib/checkout_sdk/payments/setups/account_funding_transaction_recipient.rb: account_type marked @deprecated; one doc entry per attribute against the spec (description, optionality, first_name and last_name max 50, account_number max 34, date_of_birth format date, address keys and their limits).
  • lib/checkout_sdk/payments/setups/bacs_payment_method.rb: one doc block per attribute against the spec, including its constants module and default.
  • lib/checkout_sdk/payments/setups/bacs_payment_method.rb, lib/checkout_sdk/payments/setups/cash_app_payment_method.rb: the initialization doc says an update replaces the payment methods, so enabled must be sent again to keep a method enabled. The inline Enum: lines on status and initialization, already typed by their constants modules, are dropped, and both write the default as Default: disabled.
  • spec/checkout_sdk/payments/setups/payment_setup_payment_type_serialization_spec.rb (new): the six payment type values on the wire and through create and update, the identification values and fields, the sender reference (wire key, round trip, swagger example), the deprecated sender and recipient fields, which still serialize under their keys, and a round trip plus the swagger example for every sender and recipient attribute.
  • spec/checkout_sdk/payments/setups/setup_payment_methods_serialization_spec.rb: Bacs initialization serialization, a Bacs round trip through the response parsing and the swagger example values (instrument_id, account_holder.email), and Card Present sent under its literal key.
  • spec/checkout_sdk/payments/setups/payment_setups_helper.rb: payment_type uses PaymentSetupPaymentType::REGULAR; helpers that pick a ready method from available_payment_methods or expect payment_method_not_ready.
  • spec/checkout_sdk/payments/setups/payment_setups_integration_spec.rb: confirm reads available_payment_methods, confirms a ready method or expects payment_method_not_ready, and asserts id, amount, currency, reference and payment_methods, the Payment Setup fields the confirm call returns, instead of action_id, status, processed_on and _links, which that response does not have.

API Reference

Payment type

PaymentSetupPaymentType is additive: PaymentType keeps its values. Regular, Recurring and Moto were checked: the API accepts them and stores them in lowercase. The new type is the only way to send pay_later, which PaymentType does not have.

Deprecated

  • AccountFundingTransactionSender#first_name, #last_name, #country_of_birth, #nationality and #address. Not part of the Sender schema of the Payment Setups account funding transaction; the API ignores them on requests. There is no replacement. Will be removed in the next major version.
  • AccountFundingTransactionRecipient#account_type. Not part of the Recipient schema of the Payment Setups account funding transaction; the API ignores it on requests. There is no replacement. Will be removed in the next major version.

Breaking changes required by the API

  • AccountFundingTransactionIdentificationType::TAX_ID and ::OTHER are removed: the API rejects both values with 422 account_funding_transaction.sender.identification.type_property_invalid.
    Migration: use PASSPORT, DRIVING_LICENSE or NATIONAL_ID; code that references TAX_ID or OTHER raises NameError.

Follow-ups

  • Declaring csv as a runtime dependency (needed from Ruby 3.4, where it is no longer a default gem) is a separate change.

README

No change needed.

@rodrigojara-cko
rodrigojara-cko requested a review from a team October 26, 2026 14:21
@agent-wall-e

agent-wall-e Bot commented Oct 26, 2026

Copy link
Copy Markdown

🟡 Risk Classification: MINOR

Approval route: AI Review + Human Approval
Rollback controls: Staged rollout + rollback

Classification reasons

  • exceeds_bounded_scope:409>250

Operational gates

  • ✅ jira_ticket (INT-1738)
  • ✅ independent_review

Files analysed: 12


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Oct 26, 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
exceeds_bounded_scope — 409>250 classifying §2.1 M8 More than 250 non-test, non-doc, non-lockfile lines changed.

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 26, 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.

Adds PaymentSetupPaymentType with six lowercase values, removes rejected identification types (TAX_ID/OTHER), adds AccountFundingTransactionSender#reference, deprecates unsupported fields, and fixes the confirm integration test to assert correct response fields. All claims in the PR description are verified by the diff.

What I checked

  • PaymentSetupPaymentType module correctly defines the six lowercase values (regular, recurring, moto, installment, pay_later, unscheduled) as a new file, required in payments.rb.
  • TAX_ID and OTHER removed from AccountFundingTransactionIdentificationType — a breaking change, but justified by the PR description that the API rejects both with 422; the serialization spec explicitly asserts they are no longer defined.
  • AccountFundingTransactionSender gains :reference as an attr_accessor inserted in the correct position in the attribute list, and the serialization spec verifies it round-trips correctly.
  • Deprecated fields (first_name, last_name, country_of_birth, nationality, address on Sender; account_type on Recipient) retain their attr_accessor definitions so existing callers are not broken, only documented as deprecated — correct approach for a pre-major-version deprecation.
  • Integration spec no longer unconditionally skips; it uses ready_payment_method_name/expect_payment_method_not_ready helpers that handle both the ready and not-ready cases, and asserts the correct confirm response fields (id, amount, currency, reference, payment_methods) rather than the previously wrong action_id/status/processed_on fields.
  • The helper's fallback in expect_payment_method_not_ready defaults to 'card' when available_payment_methods is empty — a safe and sensible default for the sandbox environment.
  • BacsPaymentMethod documentation refactored from a single attr_accessor block to per-attribute accessors with expanded docs; no behavioral change, only documentation improvement.
  • The payment_setups_helper.rb correctly switches from 'Regular' (capitalized, old PaymentType style) to PaymentSetupPaymentType::REGULAR ('regular') for both create and update requests.

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

@agent-wall-e

agent-wall-e Bot commented Oct 27, 2026

Copy link
Copy Markdown

🟡 Risk Classification: MINOR

Approval route: AI Review + Human Approval
Rollback controls: Staged rollout + rollback

Classification reasons

  • exceeds_bounded_scope:492>250

Operational gates

  • ✅ jira_ticket (INT-1738)
  • ✅ independent_review

Files analysed: 13


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Oct 27, 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
exceeds_bounded_scope — 492>250 classifying §2.1 M8 More than 250 non-test, non-doc, non-lockfile lines changed.

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

Adds PaymentSetupPaymentType with the six lowercase values, removes the
identification types the API rejects with 422, fixes the confirm
integration spec and deprecates card_present.
- AccountFundingTransactionSender: add reference, documented, with
  wire key, round trip and swagger example tests.
- Confirm integration specs assert PaymentSetup fields instead of
  action_id, status and processed_on, which the confirm response lacks.
- BacsPaymentMethod: drop the update note on initialization, it is not
  in the specification.
- Revert the csv runtime dependency, it moves to its own change.
AccountFundingTransactionSender first_name, last_name, country_of_birth, nationality and address, and AccountFundingTransactionRecipient account_type are not part of the Payment Setups account funding transaction schema and the API ignores them. They are kept, marked @deprecated, and still serialize under their keys.
Descriptions, optionality, length limits and date format from the Payment Setups specification. No behaviour change.
@rodrigojara-cko
rodrigojara-cko force-pushed the feat/INT-1738-payment-setup-gaps branch from c279580 to d612c86 Compare October 27, 2026 12:42
@agent-wall-e

agent-wall-e Bot commented Oct 27, 2026

Copy link
Copy Markdown

🟡 Risk Classification: MINOR

Approval route: AI Review + Human Approval
Rollback controls: Staged rollout + rollback

Classification reasons

  • exceeds_bounded_scope:540>250

Operational gates

  • ✅ jira_ticket (INT-1738)
  • ✅ independent_review

Files analysed: 13


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Oct 27, 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
exceeds_bounded_scope — 540>250 classifying §2.1 M8 More than 250 non-test, non-doc, non-lockfile lines changed.

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

card_present is hidden from the public API reference but still supported by the API. CardPresentPaymentMethod is restored exactly as on master; the serialization test that it is sent under its key stays.
Restored on BacsPaymentMethod#initialization and added to CashAppPaymentMethod#initialization: on update the API replaces the payment methods, so enabled must be sent again. The specification does not state it; it is the API's behaviour.
@agent-wall-e

agent-wall-e Bot commented Oct 27, 2026

Copy link
Copy Markdown

🟡 Risk Classification: MINOR

Approval route: AI Review + Human Approval
Rollback controls: Staged rollout + rollback

Classification reasons

  • exceeds_bounded_scope:522>250

Operational gates

  • ✅ jira_ticket (INT-1738)
  • ✅ independent_review

Files analysed: 13


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Oct 27, 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
exceeds_bounded_scope — 522>250 classifying §2.1 M8 More than 250 non-test, non-doc, non-lockfile lines changed.

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 29, 2026

Copy link
Copy Markdown

🟡 Risk Classification: MINOR

Approval route: AI Review + Human Approval
Rollback controls: Staged rollout + rollback

Classification reasons

  • exceeds_bounded_scope:687>250

Operational gates

  • ✅ jira_ticket (INT-1738)
  • ✅ independent_review

Files analysed: 13


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Oct 29, 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
exceeds_bounded_scope — 687>250 classifying §2.1 M8 More than 250 non-test, non-doc, non-lockfile lines changed.

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

@rodrigojara-cko
rodrigojara-cko merged commit 7289be5 into master Oct 30, 2026
5 checks passed
@rodrigojara-cko
rodrigojara-cko deleted the feat/INT-1738-payment-setup-gaps branch October 30, 2026 06:49
david-ruiz-cko added a commit that referenced this pull request Nov 2, 2026
This release adds card payouts to network tokens, unreferenced refunds and the missing card payout and bank payout request fields, the Payment Setup payment type, and the Dunning and Downtime payment retry types. It also makes the Issuing revoke and suspend request optional, aligns the PaymentType::MOTO value with the API, and deprecates the members the API no longer accepts on requests. Every deprecated member keeps working and will be removed in the next major version.

**Added**

Issuing (#225)
* `IssuingClient#revoke_card` and `IssuingClient#suspend_card` can now be called without a request; the request argument is optional and an empty JSON object is sent when it is omitted.

Payment Setups (#226)
* `PaymentSetupPaymentType` with the lowercase values of the Payment Setups API: `REGULAR`, `RECURRING`, `MOTO`, `INSTALLMENT`, `PAY_LATER`, `UNSCHEDULED`. Use it for the `:payment_type` key of a Payment Setup create or update request.
* `AccountFundingTransactionSender#reference`.

Payouts and unreferenced refunds (#229)
* `PaymentsClient#request_unreferenced_refund` and `UnreferencedRefundRequest`, sent to POST /payments with `payment_type` set to `UnreferencedRefund`.
* `NetworkTokenDestination` and `DestinationType::NETWORK_TOKEN`, for card payouts and unreferenced refunds to a network token.
* `PayoutRequest#segment`, `#items`, `#previous_payment_id` and `#processing`.
* `CardPayoutProcessing` (`affiliate_id`, `affiliate_url`, `processing_speed`, `purchase_country`) and `CardPayoutItem` (`type`, `sub_type`).
* `PaymentInstruction#remittance` and `InstructionRemittance` (`reference`), for bank payouts.
* `CheckoutSdk::Common::ResidentialStatusType` (`RESIDENT`, `NON_RESIDENT`) for `AccountHolder#residential_status`. The field is optional and only used by bank payouts.

Payments (#229)
* `PaymentType::PAY_LATER` (`PayLater`).

Payment retries, hosted payments, payment links and payment sessions (#228)
* `PaymentRetryRequest#dunning` and `#downtime`, with the new `DunningRetryRequest` (`enabled`, `max_attempts`, `end_after_days`) and `DowntimeRetryRequest` (`enabled`).
* `CheckoutSdk::Common::CustomerRetry` (`max_attempts`).
* `PaymentSessionsRequest#customer_retry` and `#instruction`.
* `PaymentLink#instruction` and `#payment_method_configuration`.

**Changed**

* `CustomerRetry` moves from `CheckoutSdk::Accounts` to `CheckoutSdk::Common`; `CheckoutSdk::Accounts::CustomerRetry` remains as an alias of the same class (#228).
* `PaymentSessionsRequest#payment_type` is documented as a `PaymentType` string; it was documented as a boolean (#228).
* `PayoutSource#amount` is documented as an Integer; it was documented as a String (#229).
* Request fields of payouts, unreferenced refunds, Payment Setups, hosted payments, payment links and payment sessions now document whether they are required or optional per request, with the limits and enum values of the API reference (#226, #228, #229).

**Fixed**

* `PaymentSegment` is now loaded by the gem, so `PayoutRequest#segment`, `UnreferencedRefundRequest#segment` and `PaymentRequest#segment` can take a `PaymentSegment` object (#229).
* `PaymentRetryRequest` is now loaded by the gem; it could not be referenced before (#228).

**Deprecated**

All deprecated members keep working and will be removed in the next major version.

* `CheckoutSdk::Issuing::CardUpdateHeaders` and the `headers` argument of `IssuingClient#update_card`: the API no longer documents these headers; call `update_card(card_id, update_card_request)`. Headers that are set are still sent unchanged (#225).
* `AccountFundingTransactionSender#first_name`, `#last_name`, `#country_of_birth`, `#nationality` and `#address`: not part of the Payment Setups sender; no replacement (#226).
* `AccountFundingTransactionRecipient#account_type`: not part of the Payment Setups recipient; no replacement (#226).
* `AccountHolder#full_name`: not in any account holder request; no replacement (#229).
* `AccountHolder#gender`: not in any account holder request; no replacement (#229).
* `BankAccountDestination#bank`: not in the bank payout destination; no replacement (#229).
* `PaymentInstruction#charge_bearer`, `#repair` and `#quote_id`: not in the payout instruction request, still returned when retrieving a payout; no replacement (#229).
* `PaymentInstruction#skip_expiry` and `#mvv`: not in the API; no replacement (#229).
* `InstructionScheme::SWIFT`: the bank payout request only accepts `local` and `instant`; no replacement (#229).
* `PayoutSource#amount`: not in any payout or unreferenced refund source request; no replacement (#229).
* `PaymentSessionsRequest#retry`: not part of the payment sessions request and ignored by the API; no replacement (#228).
* `HostedPaymentsSession#payment_ip`, `PaymentLink#payment_ip` and `PaymentSessionsRequest#ip_address`: deprecated by the API; no replacement (#228).
* `CheckoutSdk::Accounts::CustomerRetry`: use `CheckoutSdk::Common::CustomerRetry` (#228).

**Breaking changes required by the API** ⚠️

* `AccountFundingTransactionIdentificationType::TAX_ID` and `::OTHER` are removed, because the API rejects them with a 422. Use `DRIVING_LICENSE`, `PASSPORT` or `NATIONAL_ID` (#226).

**Breaking changes (SDK alignment)** ⚠️

* `PaymentType::MOTO` sends `MOTO` instead of `Moto`. Code that uses the constant needs no change; code that compares responses or stored values with the literal `Moto` should compare with `MOTO` (#229).
* `PaymentRetryRequest#max_attempts` and `#end_after_day` are removed. The class could not be loaded before this release, so no working code is affected. Use `dunning.max_attempts` and `dunning.end_after_days` (#228).
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