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

WCPay Subscriptions: Admin can create new manual subscriptions from the edit subscription screen #2962

Closed
Tracked by #3103
james-allan opened this issue Sep 22, 2021 · 11 comments
Assignees
Labels
component: wcpay subscriptions Issues related to Stripe Billing Subscriptions

Comments

@james-allan
Copy link
Contributor

james-allan commented Sep 22, 2021

Update Based on @james-allan comment, the scope of this issue has been simplified.

  • Admin should be able to create subscriptions for a customer (i.e. sign up customers).
  • These subscriptions should be created with manual gateway only.

old description follows (for context)

Description

When admin create or edit a subscription via admin, only allow them to choose WooCommerce Payments, select a payment method and create WC Pay subscriptions.

Screen Shot 2021-09-22 at 3 47 00 pm

Acceptance criteria

  • Manual renewal is the only option if the customer doesn't have any saved cards.
  • WooCommerce Payments is the only option shown if WC Subscriptions (plugin) isn't active.
  • The WC Pay subscription will need to:
    1. Take the billing period and interval from the one admin choose or those billing schedule fields will need to be disabled and the billing periods and interval taken from the Stripe products.
    2. Have the same next payment date that the admin entered, or those fields will need to be disabled and the subscription's next payment date will be taken from Stripe - as if the subscription was purchased today.

Designs

Testing instructions

Creating subscription:

  1. Go to WooCommerce > Subscriptions > Add new
  2. Click the pencil icon in the billing fields section.
  3. Choose WooCommerce Payments
  4. Select the saved payment method.
  5. Add products to the subscription.
  6. Optionally, set a custom billing period, interval, and next payment date.
  7. Save
  8. The WC Pay subscription should be created.

Dev notes

Additional context

@james-allan james-allan added the component: wcpay subscriptions Issues related to Stripe Billing Subscriptions label Sep 22, 2021
@shendy-a8c shendy-a8c self-assigned this Sep 28, 2021
@shendy-a8c
Copy link
Contributor

shendy-a8c commented Oct 3, 2021

@james-allan when I purchased a subscriptions product, paid it with wcpay, and edit the billing details of that subscription, I see Credit card / debit card as payment method and not WooCommerce Payments.

Screen Shot 2021-10-04 at 02 23 30

Also, when I create a subscriptions from admin then choose a user with wcpay saved payment methods, I can already select Credit card / debit card as payment method and can choose one of the saved payments.

Screen Shot 2021-10-04 at 02 25 44

What needs to be implemented for this issue then? Is it just to change the label from Credit card / debit card to WooCommerce Payments?

Update: actually, I just realized the shown saved payments the dropdown from the above screenshot are the saved payments of the admin who creates the subscription and not of the selected customer for that to-be-created subscriptions, so that's at least one thing that needs fixing.

@james-allan
Copy link
Contributor Author

I see Credit card / debit card as payment method and not WooCommerce Payments

That's the payment method title being used. So if you're WCPayments gateway is titled that, that is what will be displayed. From what I have found, the standard gateway instance has "Credit card / debit card" as its title whereas the UPE gateway has WooCommerce Payments as its title which is why we might be getting different things displayed there.

What needs to be implemented for this issue then?

Taking a step back for a moment. Initially, it was planned that Admin users would be able to create subscriptions manually via the admin interface, and if the customer already had saved payment methods, they would be able to select one and a Stripe billing subscription would be created. This would involve us effectively creating a stripe billing subscription from an existing subscription and to attach the selected payment method as the payment method in Stripe.

Given we've been cutting the scope for MVP, we had a fallback approach of allowing admin to create subscriptions but forcing them to be manual renewal.

Given what you mentioned about the tokens belonging to the admin users and not the customer, that's even further evidence that we should implement the base case first.

So what needs to be done for this issue?

When creating a subscription manually, the only available payment method will need to be manual renewal. WooCommerce payments and other gateways will need to be hidden.

@shendy-a8c
Copy link
Contributor

Created #3101 for this bug:

actually, I just realized the shown saved payments the dropdown from the above screenshot are the saved payments of the admin who creates the subscription and not of the selected customer for that to-be-created subscriptions, so that's at least one thing that needs fixing.

@haszari
Copy link
Contributor

haszari commented Oct 13, 2021

@james-allan can you confirm if this is still in scope for MVP? I see it's in Unprioritized column. If this is not in scope, please update the MVP checklist (or let me know, I can update if it helps).

@james-allan
Copy link
Contributor Author

can you confirm if this is still in scope for MVP?

No longer in MVP. I'll move it off the list. :)

@leonardola
Copy link
Contributor

leonardola commented Nov 1, 2021

Hi there. This sprint I won't be working with WC Pay subscriptions so I have to hand off this issue.

So far I have done this:

  • added an ajax call to load the selected customer credit cards here
  • added an ajax call to load the selected customer valid payment gateways here

What still needs to be done:

  • Create a subscription on stripe and a parent order when saving a new subscription via wp-admin

I will still be looking at the PRs I've created to fix or merge them as necessary.

@haszari
Copy link
Contributor

haszari commented Nov 1, 2021

Thanks the help and the handover @leonardola ! 🏅

@haszari
Copy link
Contributor

haszari commented Nov 1, 2021

Adding this to sprint backlog. Note that the scope of this issue is smaller based on comment above from @james-allan:

When creating a subscription manually, the only available payment method will need to be manual renewal. WooCommerce payments and other gateways will need to be hidden.

I've added this to the top of the description 😁

With that in mind, the PRs from @leonardola may not be needed.

@haszari haszari changed the title WCPay Subscriptions: Create WC Pay Subscriptions from the edit subscription screen WCPay Subscriptions: Admin can create new manual subscriptions from the edit subscription screen Nov 1, 2021
@leonardola
Copy link
Contributor

leonardola commented Nov 2, 2021

Given what you mentioned about the tokens belonging to the admin users and not the customer, that's even further evidence that we should implement the base case first.

@haszari to my understanding the scope was reduced to fit into MVP. But as it was removed from the MVP we could work on a more complete solution here. That's why my PR move on that direction. But I am ok if that's not the case

@james-allan can you confirm this?

@haszari
Copy link
Contributor

haszari commented Nov 2, 2021

to my understanding the scope was reduced to fit into MVP. But as it was removed from the MVP we could work on a more complete solution here.

Aha, I see @leonardola ! Let's implement the simpler, base case first. Then we can discuss what to add to scope in future iterations.

@james-allan
Copy link
Contributor Author

We moved away from prioritising this before shipping v1. I'm going to close this and we can reopen if this becomes a priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: wcpay subscriptions Issues related to Stripe Billing Subscriptions
Projects
None yet
Development

No branches or pull requests

4 participants