Stripe membership renewals #2731
Ticket(s) / Related Merge Requests
Summary of Changes
Syncing of Stripe memberships via webhooks for Tenants.
Testing Considerations
Testing will require developer access to the k8s cluster.
CLI scripts
Test the below.
-
source /vault/secrets/env && php cli.php payments SiteMemberships sync --tenant_id=123
- before running, set subscription dates for the tenant to be in the past and check that they update appropriately. -
source /vault/secrets/env && php cli.php Stripe sync_membership_webhooks --sync_site_memberships
- before running, set subscription dates for the tenant to be in the past, and delete all webhooks. Check that webhooks are reregistered in stripe and that payment dates updated appropriately.
Webhook
Note: you will need to manually edit the webhook endpoint to test this, if they have been reset - as sandboxes are not accessible through their subdomain URLs.
-
Times are updated when a webhook is triggered from Stripe.
Setting Stripe Keys
Prep: Delete stripe keys for the tenant from the DB
-
On setting Stripe keys - a webhook should appear in the Stripe settings for the newly connected Stripe instance.
Deployment Considerations
ALTER TABLE minds.minds_payments_config
ADD stripe_webhook_id varchar(256) DEFAULT NULL
AFTER stripe_customer_portal_config_id;
ALTER TABLE minds.minds_payments_config
ADD stripe_webhook_secret varchar(256) DEFAULT NULL
AFTER stripe_webhook_id;
And run
source /vault/secrets/env && php cli.php Stripe sync_membership_webhooks --sync_site_memberships
Regression Scope
Site memberships (tenant)
Platform Affected (web, mobile, etc)
Engine.
Developer Testing Completed
Unit, manual.
Screenshots / Screen Recording
See #2731 (closed)
Does this impact
-
Localization -
Dark/light mode -
Guest mode
Definition of Done Checklist
-
The Acceptance Criteria has been met -
Code is tested: Testing includes unit/spec, E2E/automated and manual testing -
Merge requests description has been filled out
Edited by Ben