Skip to content

JOIN-142 Allow cards on individual forms when Direct Debit Only is set globally#62

Merged
conatus merged 6 commits intomasterfrom
feature/join-142-allow-cards-on-certain-forms
Mar 30, 2026
Merged

JOIN-142 Allow cards on individual forms when Direct Debit Only is set globally#62
conatus merged 6 commits intomasterfrom
feature/join-142-allow-cards-on-certain-forms

Conversation

@conatus
Copy link
Copy Markdown
Member

@conatus conatus commented Mar 28, 2026

Summary

  • Adds an allow_cards_override checkbox to the CK Join Form block editor UI, which only appears when the global "Direct Debit Only" Stripe setting is enabled
  • When checked, the block overrides STRIPE_DIRECT_DEBIT_ONLY to false in the environment JSON passed to the frontend, re-enabling card payments for that specific form instance
  • Adds documenting tests to env.test.ts confirming the frontend correctly handles STRIPE_DIRECT_DEBIT_ONLY: false
  • Version bumped to 1.4.1

Test plan

  • Enable "Direct Debit Only" in the plugin's global Stripe settings
  • Open the block editor for a page containing a CK Join Form block — confirm the "Override the global Direct Debit Only setting" checkbox is now visible
  • Check the box and save the page
  • View the page, inspect the <script type="application/json" id="env"> tag — confirm STRIPE_DIRECT_DEBIT_ONLY is false
  • Confirm the payment step shows card as an available payment method
  • Uncheck the box and save — confirm STRIPE_DIRECT_DEBIT_ONLY reverts to true and card is hidden again
  • Disable "Direct Debit Only" globally — confirm the checkbox no longer appears in the block editor
  • Run yarn test in packages/join-flow — confirm all 48 tests pass

@linear
Copy link
Copy Markdown

linear bot commented Mar 28, 2026

@conatus conatus changed the title Allow cards on individual forms when Direct Debit Only is set globally (JOIN-142) JOIN-142 Allow cards on individual forms when Direct Debit Only is set globally Mar 30, 2026
conatus added 2 commits March 30, 2026 11:46
Tests verify the full-stack behaviour of the per-block card payment
override introduced in this PR:

  1. PHP env script: page with allow_cards_override emits
     STRIPE_DIRECT_DEBIT_ONLY: false; control page emits true.
     No injectEnvOverrides — reads raw PHP output.

  2. One-off tab enabled on the override page, disabled without it.
     USE_STRIPE is injected; STRIPE_DIRECT_DEBIT_ONLY is left to
     the real PHP output so the assertion is a genuine full-stack check.

  3. /join body for a one-off donation on the override page contains
     recurDonation=false, donationAmount>0, paymentMethod=creditCard.

setup.php creates the e2e-allow-cards-override-supporter seed page and
sets STRIPE_DIRECT_DEBIT_ONLY=true globally via carbon_set_theme_option
so that allow_cards_override has something observable to override.
@conatus conatus merged commit b2aa8d0 into master Mar 30, 2026
1 check passed
@conatus conatus deleted the feature/join-142-allow-cards-on-certain-forms branch March 30, 2026 11:10
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