-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Plans in Site Creation: Create functionality to add domain with a plan to a cart #21667
Plans in Site Creation: Create functionality to add domain with a plan to a cart #21667
Conversation
- Rename DomainPurchasing to SiteCreationPurchasing - Replace RegisterDomainDetailsServiceProxyProtocol with ShoppingCartServiceProtocol
- planId can now be set during SiteCreation flow - Show checkout if planId exists
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
…in-with-a-plan-to-a-cart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and working great:
- ✅ Checkout opens if plan selected
- ✅ Regression test
I left some non-blocking comments.
Regarding the "Checkout opens if plan selected" test:
- When a paid domain is chosen: I see the domain & the hard-coded plan (1009) in the cart as expected.
- When a free domain is chosen: Before testing, I removed the hard-coded plan. The app correctly skipped checkout and went to site assembly. My understanding is that we'll still show plans (in a later PR) when a user chooses a free domain, to give them the choice between a free and paid plan. I presume the above video, "Video - free domain", was taken with a hard-coded plan because otherwise, it shouldn't open the checkout.
import Foundation | ||
|
||
protocol ShoppingCartServiceProtocol { | ||
func createSiteCreationShoppingCart( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the repeated word "creation" makes this less readable. Maybe makeSiteCreationShoppingCart
would be more readable.
/// The site must be created before attempting domain and plan bundle purchasing. | ||
private func attemptPlanAndDomainPurchasing(domain: DomainSuggestion, planId: Int, site: Blog) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Is this checkout web view shown to users who choose a free domain (e.g. xyz.wordpress.com`) and a paid plan? If so, it might be more descriptive to not mention "plan and domain" here since it could be a plan and domain bundle OR just a plan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. Yes, it will be shown to users who choose a free domain and paid plan. I will try to make it clearer.
@guarani correct. Both cases had a plan hardcoded, therefore both cases had Checkout opened. 👍 |
Fixes #21636
Related WordPress Kit PR: wordpress-mobile/WordPressKit-iOS#628
Description
createTemporaryDomainShoppingCart
andcreatePersistentDomainShoppingCart
methods with a newcreateShoppingCart
methodShoppingCartService
to use the new APIDomainPurchasing...
toSiteCreationPurchasing...
planId
into the flow and intoSiteCreator
In the future PRs, will be able to set
planId: Int
value ofSiteCreator
after the user selects the plan and the changes made here will allow the flow to finish with the checkout.To test:
Checkout opens if plan selected
Before testing:
planId: Int?
value to1009
inSiteCreator.swift
Video - paid domain
Plan.Purchase.with.Paid.Domain.mp4
Video - free domain
Plan.Purchase.with.Free.Domain.mp4
Regression
Regression Notes
Breaking current Site Creation flow
Manual testing
None
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: