Skip to content

MAE-1373: Add a test that pay-later instalments are selected for charging - #40

Merged
erawat merged 1 commit into
MAE-1355-workstreamfrom
MAE-1373-pay-later-selection-test
Nov 17, 2026
Merged

erawat merged 1 commit into
MAE-1355-workstreamfrom
MAE-1373-pay-later-selection-test

Conversation

@erawat

@erawat erawat commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Overview

Membership payment plan instalments are pay later (invoices). This adds a test that the instalment charge job picks up a due pay-later contribution and dispatches it to the processor, like any other due instalment. Part of PAYPLAN-4 (MAE-1373), which is test coverage only.

Before

The selection query already ignores is_pay_later, and a Stripe membership plan's pay-later instalments were charged and completed when tested locally. But none of the tests in InstalmentChargeServiceTest used a pay-later contribution.

The Stripe side, with screenshots of the charged instalments, is compucorp/uk.co.compucorp.stripe#325.

After

InstalmentChargeServiceTest::testSelectsPayLaterContributions: a due Pending pay-later contribution is charged and is in the dispatched batch. The fixture helper takes a new is_pay_later option (default FALSE, so the existing tests are unchanged).

Spec check (PAYPLAN-4 A, selection)

Spec Result
Pending or Partially paid instalment, due (receive_date <= now) ✅ existing tests
Pay-later membership instalments included ✅ this test (a plain recurring contribution fixture, not a membership)
Plan not Cancelled ✅ existing test. The code charges any plan that isn't Cancelled
Plan has a saved card (payment_token_id) ✅ existing test
Failure count within the retry cap ⚠️ The filter is there, but a declined instalment is never picked up again: its attempt is failed and the job only charges instalments whose attempt is pending. No test covers it. To be raised as its own ticket (details in compucorp/uk.co.compucorp.stripe#325)

Comments

Targets the new MAE-1355-workstream branch, cut from master for the MAE-1355 epic.

…ging

Membership payment plan instalments are pay later (invoices). Cover that
the instalment charge selection picks up a due pay-later contribution and
dispatches it, alongside the existing Pending and Partially paid cases.
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces additional test coverage to verify that due membership payment plan instalments, specifically those categorized as 'pay-later' (invoices), are properly included in the charging process. By updating the test fixture helper, the changes ensure that the system correctly handles these contributions without impacting existing test scenarios.

Highlights

  • Test Coverage Expansion: Added a new test case testSelectsPayLaterContributions to ensure that membership payment plan instalments marked as 'pay-later' are correctly identified and processed for charging.
  • Fixture Update: Updated the createTestFixtures helper method to support an is_pay_later option, defaulting to FALSE to maintain compatibility with existing tests.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new unit test testSelectsPayLaterContributions to InstalmentChargeServiceTest.php to verify that pay-later contributions are correctly selected and charged. It also updates the createTestFixtures helper method to support the is_pay_later option, defaulting to FALSE. There are no review comments, and I have no feedback to provide.

@erawat
erawat merged commit 23dba15 into MAE-1355-workstream Nov 17, 2026
3 checks passed
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.

2 participants