-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Earn: add one time payment option to payment plans #43417
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~24 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
This tests well on a Recurring Payments block, but there is a fatal error after subscribing using a Premium Content block:
Likely the end_date
checked here is unset on one-time plans:
Line 170 in 8306287
if ( in_array( $product_id, $product_ids, true ) && strtotime( $token_subscription->end_date ) > time() ) { |
Verified that I could create a new product with the one-time option, and that the option is not available in non-dev environments. Once I created the one-time product though, I started getting fatals related to Adding a check before it fixes it, but I'm not sure I understand why it would suddenly be an issue after creating a one-time product. I also had the same experience as @mmtr with the |
c7f47e9
to
3c4d4b7
Compare
Oh hmm the format of end_date is different if it's a one time vs recurring: Recurring:
One Time
Is this expected @Automattic/earn ? |
@Automattic/cylon are there updated instructions for installing and running phpcs? I ended up having to commit with --no-verify since it was running into |
Caution: This PR affects files in the FSE Plugin on WordPress.com D45169-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing in the FSE Plugin for more info: PCYsg-ly5-p2 |
@gwwar great question I also keep seeing that error locally 🤔. running phpcs earlier today, I did the following (from wp-calypso root) and it worked:
|
we are also introducing phpcs in CI here: #43458 |
Thanks @noahtallen I think that did the trick. There's a lot of warnings to tidy though 🙈 |
we briefly talked about spending a few hours trying to fix all phpcs errors in the FSE plugin today 😅 I may start doing that. It sounds relaxing compared to what i've been working on this week |
Fantastico, all works as expected 👍 |
Apparently. Looking in As discussed in slack, we might want to use some constant here and/or have @artpi determine if longreads depends on using the |
Thanks for digging into that @n3f We can also return now + 1 year, but in the same ISO string format as well. Mainly it's rather unexpected to have different types here for a product, so this may be a good chance to tidy this before we have more records. |
🤔 Since this is behind a feature flag, I'll land this one first, then follow up with a more general fix for types. |
Thanks for the reviews folks! |
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/3925227 Thank you @gwwar for including a screenshot in the description! This is really helpful for our translators. |
Translation for this Pull Request has now been finished. |
Changes proposed in this Pull Request
Exposes the one time payment option. Copy changes are handled in #42848 under the same feature flag
This also includes a fix for one time payments being used to back premium content.
Payments button testing instructions
?flags=-earn/rename-payment-blocks
and refreshPremium Content Testing Instructions
Fixes #42858