<p>Would it be possible to initiate the payment first, and then have stripe send an email/receipt that routes the individual to complete the signup from a registration page that assigns all people who register from that page to the appropriate group?</p>

<p>Let Stripe do the heavy lifting...</p>

CC BY-SA 3.0
2015-02-07T13:54:35.443Z
2015-02-07T13:54:35.443Z
cmcjane
<p>I don't think that there currently is a plugin option right now, but keep an eye on the <a href="http://straightupcraft.com/craft-plugins" rel="nofollow noreferrer">craft plugin page</a>. However, given your requirement to "automatically assign users to different membership groups", I think you would need to write your own regardless. That is pretty specific and would require that you have your user groups set up to match the subscription plans.</p>

<p>I recently did something similar for a project. Saving for a few issues with javascript and learning the API for stripe it was fairly straightforward. It is currently a bit hard-wired to the specific project, however — I still need to abstract it so that it's more portable. I would be glad to share some tips, if you are up for writing your own.</p>

<p><img src="https://i.sstatic.net/ZoR9P.png" alt="stripe subscription plugin - custom field type"></p>

<p>The process that I'm using is to store the StripeCustomerId in the custom fieldtype. As far as craft is concerned that's all just 1 field, that is auto-generated and never exposed to the client (i.e. they can't edit the 'stripeCustomerId').</p>

<p>Whenever an 'account' (could also be 'user') is created, I use the <code>onSaveUser</code> event to generate and store a StipeCustomerId. The rest of the field just sends calls to stripe to add card, delete card, create subscription, cancel subscription, etc. via service methods, and then refresh itself with the most up-to-date customer data from Stripe (doesn't ever store this info, just the customerId).</p>

<p>Besides this the only thing that you would need to add is to reassign the userGroup based on the plan selection. However, if you want to ensure that the userGroup is always synced with the Stripe account (i.e. if the client, for example, canceled the subscription directly from their Stripe account), you would probably need to create a <a href="https://stripe.com/docs/webhooks" rel="nofollow noreferrer">webhook</a> to trigger the userGroup re-assignment. Or instruct them to always re-save the user in craft afterwards.</p>

CC BY-SA 3.0
2015-02-13T16:29:46.717Z
@James I successfully decoupled the plugin I was working on from the project and made it stand-alone, as well as adding some polish. Email me if you want to take a look at an alpha version. Email should be in my profile.
Douglas McDonald
CC BY-SA 3.0
2015-02-13T19:42:44.470Z
Thanks Douglas. Can’t find an email on your profile, can you point me in the right direction.
James
CC BY-SA 3.0
2015-07-15T05:28:16.650Z
Hi Douglas. I'm interested in this too. How is it going?
Clive Portman
CC BY-SA 3.0
2015-08-31T04:29:11.910Z
I might be interested in this too. Is there contact info for Douglas anywhere?
Tyssen
CC BY-SA 3.0
2015-02-05T21:01:32.300Z
Massively helpful Douglas, thanks! I’m hopeful someone will release a supported plugin soon but as I need to tackle this over the next few weeks, I’ll have to try writing my own.
James
CC BY-SA 3.0
2015-02-05T18:50:34.847Z
2015-02-05T18:50:34.847Z
Douglas McDonald
<p>In addition to ‘<a href="https://craftcms.stackexchange.com/questions/299/what-is-the-current-landscape-regarding-e-commerce-plugins-for-craft">What is the current landscape regarding e-commerce plugins for Craft?</a>’, I’m looking for current options for setting up membership subscriptions. </p>

<p>I have a site in development that was using the ‘Commerce’ and ‘Membership’ plugins from Dukt (private beta) but unfortunately they no longer appear to be available. </p>

<p>The basic requirements would be for a user to signup, pay for membership (ideally through Stripe in this case), which then automatically assigns users to different membership groups depending on their subscription level/status when appropriate (e.g. full, trial, expired, etc).</p>

CC BY-SA 3.0
2015-02-05T15:19:56.133Z
I'd like to know this too, have a potential project coming up that would do something like this.
hamishtaplin
<users><user-groups><ecommerce>
What are the options for taking membership subscriptions via Craft?
# What are the options for taking membership subscriptions via Craft?

(Asked by: username_0 on 2015-02-05)

In addition to ‘[What is the current landscape regarding e-commerce plugins for Craft?](https://craftcms.stackexchange.com/questions/299/what-is-the-current-landscape-regarding-e-commerce-plugins-for-craft)’, I’m looking for current options for setting up membership subscriptions.

I have a site in development that was using the ‘Commerce’ and ‘Membership’ plugins from Dukt (private beta) but unfortunately they no longer appear to be available.

The basic requirements would be for a user to signup, pay for membership (ideally through Stripe in this case), which then automatically assigns users to different membership groups depending on their subscription level/status when appropriate (e.g. full, trial, expired, etc).

**Tags:** users, user-groups, ecommerce
> **Comments:**
> **username_1**: I'd like to know this too, have a potential project coming up that would do something like this.  

---

## 2 answers

### Answer by username_3 on 2015-02-05. Score: 12 | Accepted answer

I don't think that there currently is a plugin option right now, but keep an eye on the [craft plugin page](http://straightupcraft.com/craft-plugins). However, given your requirement to "automatically assign users to different membership groups", I think you would need to write your own regardless. That is pretty specific and would require that you have your user groups set up to match the subscription plans.

I recently did something similar for a project. Saving for a few issues with javascript and learning the API for stripe it was fairly straightforward. It is currently a bit hard-wired to the specific project, however — I still need to abstract it so that it's more portable. I would be glad to share some tips, if you are up for writing your own.

![stripe subscription plugin - custom field type](https://i.sstatic.net/ZoR9P.png)

The process that I'm using is to store the StripeCustomerId in the custom fieldtype. As far as craft is concerned that's all just 1 field, that is auto-generated and never exposed to the client (i.e. they can't edit the 'stripeCustomerId').

Whenever an 'account' (could also be 'user') is created, I use the `onSaveUser` event to generate and store a StipeCustomerId. The rest of the field just sends calls to stripe to add card, delete card, create subscription, cancel subscription, etc. via service methods, and then refresh itself with the most up-to-date customer data from Stripe (doesn't ever store this info, just the customerId).

Besides this the only thing that you would need to add is to reassign the userGroup based on the plan selection. However, if you want to ensure that the userGroup is always synced with the Stripe account (i.e. if the client, for example, canceled the subscription directly from their Stripe account), you would probably need to create a [webhook](https://stripe.com/docs/webhooks) to trigger the userGroup re-assignment. Or instruct them to always re-save the user in craft afterwards.

> **Comments:**
> **username_0**: Massively helpful Douglas, thanks! I’m hopeful someone will release a supported plugin soon but as I need to tackle this over the next few weeks, I’ll have to try writing my own.  
> **username_3**: @James I successfully decoupled the plugin I was working on from the project and made it stand-alone, as well as adding some polish. Email me if you want to take a look at an alpha version. Email should be in my profile.  
> **username_0**: Thanks Douglas. Can’t find an email on your profile, can you point me in the right direction.  
> **username_4**: Hi Douglas. I'm interested in this too. How is it going?  
> **username_5**: I might be interested in this too. Is there contact info for Douglas anywhere?  

---

### Answer by username_2 on 2015-02-07. Score: 0

Would it be possible to initiate the payment first, and then have stripe send an email/receipt that routes the individual to complete the signup from a registration page that assigns all people who register from that page to the appropriate group?

Let Stripe do the heavy lifting...


---

