Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to checkout as another user? (for admin reasons) #299

Open
Joobs opened this issue Jun 26, 2022 · 3 comments
Open

Is it possible to checkout as another user? (for admin reasons) #299

Joobs opened this issue Jun 26, 2022 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@Joobs
Copy link

Joobs commented Jun 26, 2022

My client has an unusual workflow.
On their previous website (Wordpress, using a different addon), customers would often email and ask to be manually resubscribed to a subscription. The client would create a subscription in Stripe and assign it to a Stripe customer and this got automatically synced inside of Wordpress.

In Stripe Payments, it basically wants all the subscriptions to have gone through a checkout tag or payment form to work correctly. There is a Sync button, but I feel this isn't really the use case for that? Or could it be used for ongoing user management?

I was wondering if it's possible to create a Craft template that has restricted access to a "staff" usergroup that allows me to create a checkout tag and/or payment form (needs to work with both), where they can entry an email or stripe customer id and allow them to checkout as if they were another customer? What parameters do I need to override to make it look like it comes from another user?

Or any other suggestions on how to achieve this?

I am asking the client why it's not possible to just email the customers a link to the checkout page and then them to do it themselves...

@Joobs
Copy link
Author

Joobs commented Jun 27, 2022

Talking about this further with the client. They are really pushing for a "Stripe" way to do this, create a new subscription for a user in Stripe and have it auto sync into Craft.

The idea scenario would be the client would create a subscription for a user in Stripe and that somehow auto syncs into Craft.

Would that be possible?

The user would already exist in Craft.
Craft is listening for a specific webhook (not sure which one?).
Syncs and creates an record in the Stripe addon.
Traditional subscriptions workflow is still happening with Payment forms and the Checkout Tag.

@andrelopez
Copy link
Member

Hi @Joobs

  • If the Subscription already exists on Craft, then the subscription was canceled, and then was enabled again via Stripe (or externally via the old site for example), there is no need to do anything, as the Subscription already has an Stripe Payments order associated, if you have Subscription grants will continue working as normal, remember that the webhook URL needs to be setup with all our recommended events:
- source.chargeable
- charge.succeeded
- charge.captured
- checkout.session.completed
- customer.subscription.created
- customer.subscription.deleted
- product.created
- product.updated
- product.deleted
- price.created
- price.updated
- price.deleted

in this case customer.subscription.created and customer.subscription.deleted are the most important

  • if the subscription is enabled externally (after being canceled) and for some reason, an order associated does not exist on Craft, you may need to listen to the afterProcessWebhook event, to create an order/users if you want, the order from the event, in this case, will be null and you may need to use the stripeData to create anything you need: users, order, etc.

  • About:

customers would often email and ask to be manually resubscribed to a subscription.

This case is great for the customer portal feature, users can edit card details, upgrade/downgrade plans, etc, from the Stripe Customer portal feature.

Please let me know if this info is useful

@andrelopez andrelopez self-assigned this Jun 27, 2022
@andrelopez andrelopez added the question Further information is requested label Jun 27, 2022
@Joobs
Copy link
Author

Joobs commented Jun 27, 2022

The client doesn't want to re-enable existing subscriptions, the existing subscriptions and fully cancelled and they are creating entirely new subscriptions. They are creating new subscriptions inside of Stripe and want that to auto sync with customers in Craft.

Customers also create subscriptions via the normal ways. (I am listening for checkout.session.completed to assign them to groups).

If the order doesn't exist in Craft but it's created in Stripe, how do I go about creating a new order in the Addon?

For various reasons the client doesn't want customers to use the customer portal...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants