craftcms / craftcms/stripe

Duplicated subscriptions on local development

Open
#44 23 comments 1 reaction 1 assignee View on GitHub

@lukeholder is already working on this.

Since Dec 1, 2025.

bug
Dominant language
PHP
Stars
6
Forks
4
Avg merge
13h 3m
Merged PRs (30d)
2

Description

Description

When you are working on local development with forwarded stripe events, the customer.subscription.created and customer.subscription.updated events are received almost at the same time and, as updating use createOrUpdateSubscription, the subscriptions are created 2 times.

My idea is to use a specific update method instead of
https://github.com/craftcms/stripe/blob/fa70b83685815e6366c570dcefdd7e5d75eff371/src/services/Webhooks.php#L97

Steps to reproduce
  1. Up local development with stripe forwarded
  2. Create a subscription
  3. Subscription is duplicated
Additional info
  • Craft version: 5.40
  • PHP version: 8.2
  • Database driver & version: Mysql
  • Plugins & versions: 1.1.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.