Versions: - Craft CMS (3.1.21) - Craft Commerce (2.1.2) - Stripe for Craft Commerce (1.2.0)

Problem: - My website offers user's ability to subscribe to several subscriptions at the same time. Currently, I have created products that represent each subscription so they may be added to the cart. These products are purchased like a regular 'purchasable' element.

My plugin listens to the event EVENT_AFTER_COMPLETE_ORDER and finds all subscriptions that were in the completed order. I could create each subscription individually using Craft's createSubscription() method found in craft\commerce\services, but doing so causes multiple invoices to be sent out to customers and each invoice created is also charged a fee by Stripe.

My Goal is to create one subscription that contains several subscriptions inside of it (https://stripe.com/docs/billing/subscriptions/multiplan). This would only generate one invoice.

I am able to use the Stripe API to do this successfully but at the cost of bypassing Craft. Is there a way to do this through Craft so it knows about all subscriptions that have been created?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.