Repository navigation
fix(payments): load retry types and add customer_retry to sessions - #228
Conversation
PaymentRetryRequest was never required by the gem, misspelled end_after_days and had no dunning or downtime. DunningRetryRequest and DowntimeRetryRequest are added, CustomerRetry moves to Common (the Accounts constant remains as a deprecated alias), and payment sessions gain customer_retry while the off-spec retry attribute is deprecated.
🔴 Risk Classification: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 11 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. This PR fixes a real NameError (PaymentRetryRequest never required), corrects the misspelled 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 |
PaymentRetryRequest was never required on master, so its top-level max_attempts and end_after_day could not be used. Remove them. Document the payment sessions retry attribute as ignored by the API, fix the payment_type doc type and enum, and flag tax_amount as not in the specification. Add instruction to payment links and payment sessions and payment_method_configuration to payment links. Complete payment link and hosted payment docs with spec ranges and defaults.
The API reference marks payment_ip on hosted payments and payment links, and ip_address on payment sessions, as deprecated. Tag them in the YARD docs and assert the exact payment_method_configuration serialization with a nested card property.
🔴 Risk Classification: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 11 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 |
|
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).



Summary
Loads the payment retry types and aligns the payment retry, hosted payments, payment links and payment sessions requests with the API reference, including Dunning and Downtime retries and customer retries on payment sessions.
Changes
lib/checkout_sdk/payments/payments.rb: requiresdunning_retry_request,downtime_retry_requestandpayment_retry_request(the retry class was never loaded before).lib/checkout_sdk/payments/payment_retry_request.rb:PaymentRetryRequestnow hasenabled,dunninganddowntime.lib/checkout_sdk/payments/dunning_retry_request.rb: newDunningRetryRequest(enabled,max_attempts,end_after_days).lib/checkout_sdk/payments/downtime_retry_request.rb: newDowntimeRetryRequest(enabled).lib/checkout_sdk/common/customer_retry.rb:CustomerRetrymoves toCheckoutSdk::Common::CustomerRetry;CheckoutSdk::Accounts::CustomerRetrystays as a deprecated alias.lib/checkout_sdk/payments/sessions/payment_sessions_request.rb: addscustomer_retryandinstruction; deprecatesretryandip_address;payment_typedocumented as aPaymentTypestring.lib/checkout_sdk/payments/links/payment_link.rb: addsinstructionandpayment_method_configuration; deprecatespayment_ip.lib/checkout_sdk/payments/hosted/hosted_payments_session.rb:customer_retrydocumented asCheckoutSdk::Common::CustomerRetry; deprecatespayment_ip.lib/checkout_sdk/payments/payment_request.rb:retrydocumented.HostedPaymentsSession,PaymentLinkandPaymentSessionsRequest, with ranges and defaults from the API reference.spec/checkout_sdk/payments/retry_request_serialization_spec.rb:PaymentRetryRequest,DunningRetryRequest,DowntimeRetryRequest,CustomerRetry(all properties, swagger example, false and zero values, alias identity, use from the three endpoints), plusinstructionandpayment_method_configuration.spec/checkout_sdk/payments/hosted/hosted_payments_integration_spec.rb: usesCheckoutSdk::Common::CustomerRetry.API Reference
POST /payments(retry): https://api-reference.checkout.com/tag/payments/POST/payments.body.retryPOST /hosted-payments(customer_retry): https://api-reference.checkout.com/tag/hosted-payments-page/POST/hosted-payments.body.customer_retryPOST /payment-links(customer_retry): https://api-reference.checkout.com/tag/payment-links/POST/payment-links.body.customer_retryPOST /payment-sessions(customer_retry): https://api-reference.checkout.com/tag/flow/POST/payment-sessions.body.customer_retryBreaking changes
max_attemptsandend_after_dayaccessors are removed fromPaymentRetryRequest. The class could never be loaded before this change, so no working code is affected. Usedunning.max_attemptsanddunning.end_after_days.PaymentSessionsRequest#retry(not part of the payment sessions request; the API ignores it),PaymentSessionsRequest#ip_address,HostedPaymentsSession#payment_ip,PaymentLink#payment_ipand theCheckoutSdk::Accounts::CustomerRetryalias.README
Not affected: the README does not document retries or these request fields.