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

Earn: Add a Stripe connect prompt to the Donations block. #43166

Merged
merged 3 commits into from
Jun 15, 2020

Conversation

kwight
Copy link
Contributor

@kwight kwight commented Jun 10, 2020

This PR adds a Stripe connection prompt to the (in development) Donations block, for sites that have the appropriate plan but have not yet set themselves up with Stripe.

Testing instructions

  • On this branch locally, run yarn dev --sync to sync the changes to your sandbox.
  • On your sandbox, fetch the new wpcom-block-editor build generated on this PR: ./bin/calypso/build-wpcom-block-editor.sh 770978.
  • Sandbox the API, widgets.wp.com, the store, and a test site that has at least a Personal plan, but no Stripe account connected.
  • On that test site, start a new post at /wp-admin/post-new.php.
  • Enable console monitoring of our Tracks events with localStorage.setItem( 'debug', 'wpcom-block-editor:*' );.
  • Add a Donations block.
  • Verify the Donations block loads with the three tabbed view visible and working, with the prompt to connect to Stripe above it.
  • Click the "connect" button and verify you are sent to a Stripe connect form. With the store sandboxed, you should be able to click the top banner to connect in development mode.
  • Finish connecting, and verify the connect prompt is no longer there when you go back and refresh the editor.
  • Verify a Tracks event in the console for wpcom_block_donations_stripe_connect_click .

@matticbot
Copy link
Contributor

@kwight kwight requested a review from a team June 10, 2020 23:48
@kwight kwight self-assigned this Jun 10, 2020
@kwight
Copy link
Contributor Author

kwight commented Jun 10, 2020

Doesn't work yet.

@matticbot
Copy link
Contributor

Caution: This PR affects files in the FSE Plugin on WordPress.com
Please ensure your changes work on WordPress.com before merging.

D44771-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

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@kwight kwight force-pushed the add/donations-stripe-connect branch from d657c1d to daec76a Compare June 11, 2020 22:50
@kwight
Copy link
Contributor Author

kwight commented Jun 12, 2020

This now handles the Stripe connection process, but the redirect back to the post being edited is still broken. I also need to add Tracks events.

@kwight
Copy link
Contributor Author

kwight commented Jun 12, 2020

This now handles the Stripe connection process, but the redirect back to the post being edited is still broken.

It looks like this is expected behaviour, although I think it's exposing other possible bugs or changes with the Recurring Payments/Premium Content blocks' handling of Stripe connecting.

I suggest we get this PR in as-is, and then evaluate how best the Stripe connect flow should be with all of the blocks requiring it. Currently, a successful connection will land the user on the Calypso Earn page:

Screen Shot 2020-06-12 at 11 52 29 AM

Reloading the post with the block will go straight to displaying the donations tabs, as expected.

@kwight kwight force-pushed the add/donations-stripe-connect branch from 90c2c8d to c9667a5 Compare June 12, 2020 21:36
@kwight kwight added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Jun 13, 2020
Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, verified the nudge only appears when the connection is not set, and it disappear afterwards.

I suggest we get this PR in as-is, and then evaluate how best the Stripe connect flow should be with all of the blocks requiring it

+1

Verify a Tracks event in the console for wpcom_block_donations_stripe_connect_click.

I didn't see this initially, but then realized I didn't update my wpcom-block-editor build. It worked great after that. Updated the testing instructions for clarity.

Screen Shot 2020-06-15 at 12 44 15

@kwight kwight merged commit 94d1e23 into master Jun 15, 2020
@kwight kwight deleted the add/donations-stripe-connect branch June 15, 2020 20:05
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants