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

Simple Payments Block: Fix availability #10833

Merged
merged 1 commit into from
Dec 11, 2018

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Dec 5, 2018

Untested Counterpart to @enejb's D21761-code, to get files back in sync. Copying that diff's description:

Previously when we called the load blocks methods the call is being done too early in the rest api context. Which resulted in the api returnig the wrong data because we haven't switched to the correct blog contexts. We were always returning the availability as if we from the public-api.wordpress.com domain.

Changes proposed in this Pull Request:

This PR fixes this by making sure we load/register the blocks in the right context. And by allowing the blocks to pass a callback that gets called once in the right context ensuring that the data is as expected.

Testing instructions:

  • Start with a Jetpack test site with a free plan
  • Install either the REST API Console plugin or the Basic Authentication plugin.
  • Use either plugin to run a GET request to /wp-json/wpcom/v2/gutenberg/available-extensions
  • the simple payments block should be unavailable
  • Now buy a Jetpack Premium plan
  • Run the same GET request again
  • the simple payments block should be available

@matticbot
Copy link
Contributor

D21832-code. (newly created revision)

@jetpackbot
Copy link

Warnings
⚠️ "Proposed changelog entry" is missing for this PR. Please include any meaningful changes

This is automated check which relies on PULL_REQUEST_TEMPLATE.We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS

@dereksmart
Copy link
Member

@ockham this changeset was already deployed to wpcom, why still labeled in progress here?

@ockham
Copy link
Contributor Author

ockham commented Dec 6, 2018

@ockham this changeset was already deployed to wpcom, why still labeled in progress here?

Uh, good point. Mostly to signal that I hadn't tested this (and that it might require fixing to make it actually work). Should I set it to 'Needs Review' regardless?

(Not sure I'll get to it by EOW, I mostly filed it so it wouldn't fall through the cracks and so I could come back to it later.)

@roccotripaldi roccotripaldi added [Status] Tested on WP.com [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] In Progress labels Dec 6, 2018
@dereksmart dereksmart merged commit 0625cf5 into master Dec 11, 2018
@dereksmart dereksmart deleted the fix/simple-payments-availability branch December 11, 2018 20:57
@dereksmart
Copy link
Member

Worked like a charm!

jeherve added a commit that referenced this pull request Dec 19, 2018
jeherve added a commit that referenced this pull request Jan 3, 2019
jeherve added a commit that referenced this pull request Jan 3, 2019
* Add first version of the Changelog and testing list for 6.9

* Changelog: add #10710

* changelog: add #10538

* changelog: add #10741

* changelog: add #10749

* changelog: add #10664

* changelog: add #10224

* changelog: add #10788

* Changelog: add #10560

* Chanegelog: add #10812

* changelog: add #10556

* Changelog: add #10668

* Changelog: add #10846

* Changelog: add #10947

* Changelog: add #10962

* Changelog: add #10956

* Changelog: add #10940

* Changelog: add #10934

* Changelog: add #10912

* changelog: add #10866

* changelog: add #10924

* Changelog: add #10936

* Changelog: add #10833

* changelog: add #10867

* Changelog: add #10960

* Changelog: add #10888

* changelog: add #10840

* changelog: add #10972

* Changelog: add #10979

* changelog: add #10909

* Changelog: add #10958

* Changelog: add #10981

* Changelog: add #10564

* Changelog: add #10809

* Changelog: add #10982

* Changelog: add #10706

* Changelog: add #10978

* Changelog: add #10132

* Changelog: add #11022

* Changelog: add #11024

* Changelog: add #10875

* Changelog: add #11030

* Changelog: add #11053

* Changelog: add #10880

* Changelog: add #9359

* Changelog: add #11037

* Update block list

* Changelog: add #11060

* Changelog: add #10755

* changelog: add #11000

* Changelog: add #10786

* Changelog: add #10945

* Changelog: add #10597
@kraftbj kraftbj removed the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label May 13, 2019
@jeherve jeherve added the [Feature] Pay with PayPal aka Simple Payments label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants