Skip to content

fix: accept the INSTALLMENT_SELECT next action type - #14

Merged
jimmyn merged 1 commit into
masterfrom
feat/installment-select-next-action
Sep 29, 2026
Merged

jimmyn merged 1 commit into
masterfrom
feat/installment-select-next-action

Conversation

@jimmyn

@jimmyn jimmyn commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Depends on MONEI/monei-openapi-schema#161. Regenerated from that branch (build:local).

Why: the API returns nextAction.type = INSTALLMENT_SELECT for card payments eligible for MONEI Flex. PaymentNextAction raised ApiValueError on it, so payments.get() and webhook parsing failed for those payments.

Change: the enum value in PaymentNextAction, plus a test that deserializes such a payment through ApiClient.deserialize (fails on master with the error above).

Verification: uv run pytest 266 passed. Formatted with the pinned uv run black (25.1). build.sh calls the global black; a newer one also rewrote __init__.py, configuration.py and rest.py (blank lines only). Those are left out.

Summary by CodeRabbit

  • New Features
    • Payment flows can now support an installment selection step, allowing customers to choose between paying in full or in installments on the payment page.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 34635aa7-6211-4ae4-85af-457509870a00

📥 Commits

Reviewing files that changed from the base of the PR and between 04e60a3 and b359c24.

📒 Files selected for processing (2)
  • Monei/model/payment_next_action.py
  • test/test_payment_next_action.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.


📝 Walkthrough

Walkthrough

PaymentNextAction now accepts and documents INSTALLMENT_SELECT. A test deserializes a payment response with this action type and checks that next_action does not contain must_redirect.

Changes

Installment selection next action

Layer / File(s) Summary
Next action type and deserialization test
Monei/model/payment_next_action.py, test/test_payment_next_action.py
PaymentNextAction adds INSTALLMENT_SELECT to its allowed types and documents the payment choice at redirectUrl. The test checks the deserialized action type and confirms that next_action does not contain must_redirect.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to b359c

No concrete failure in the installment-selection change is established; the supplied test covers deserialization of the new action type.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@jimmyn
jimmyn merged commit c54ae67 into master Sep 29, 2026
9 checks passed
@jimmyn
jimmyn deleted the feat/installment-select-next-action branch September 29, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant