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

feat(donations-stripe): integrate w/ woocommerce-memberships #1599

Merged
merged 4 commits into from
Apr 18, 2022

Conversation

adekbadek
Copy link
Member

@adekbadek adekbadek commented Apr 11, 2022

All Submissions:

Changes proposed in this Pull Request:

Adds integration with woocommerce-memberships plugin.

How to test the changes in this Pull Request:

  1. Switch to add/handle-wc-memberships branch of newspack-blocks plugin (feat(donate): handle woocommerce-memberships newspack-blocks#1096)
  2. Follow the setup from feat(stripe-donations): update WooCommerce on successful donation #1593 (steps 1-3)
  3. Activate woocommerce-memberships plugin and set up a membership plan* tied to donations
  4. In a session as a non-logged-in visitor, confirm the content is restricted (as per membership plan) and make a donation
  5. Observe the restricted content is now visible
  6. Observe that a user account was created and you're now logged in by visiting /wp-admin page
  7. In a different session, make a donation as an already logged-on user. Observe the restricted content is now visible as per plan

* e.g. restrict all post content unless one of the Newspack Donations products was bought

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@adekbadek adekbadek added the [Status] Needs Review The issue or pull request needs to be reviewed label Apr 11, 2022
@adekbadek adekbadek requested a review from a team as a code owner April 11, 2022 13:34
Copy link
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

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

Not sure exactly why, but after the succesful purchase, the user account is created and authenticated but the order is not set to the customer ID and the user doesn't get access to the membership. Accessing /my-account/orders/ I get No order has been made yet. and the same to /my-account/members-area/.

This is the membership plan config:

image

Don't know if related but with debug mode I get several warnings regarding deprecated usage of is_offline() and is_500() from the Membership plugin:

PHP Notice:  is_offline was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false.
PHP Notice:  is_500 was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false.

The plugin version is 1.23.0

@adekbadek
Copy link
Member Author

@miguelpeixe Fixed now, must've messed it up in some last-minute refactor. Also updated the newspack-blocks part.

Don't know if related but with debug mode I get several warnings regarding deprecated usage of is_offline() and is_500() from the Membership plugin:

Are you sure these are coming from WC Memberships? I can't see any use of these functions in the plugin code.

@miguelpeixe
Copy link
Member

miguelpeixe commented Apr 14, 2022

Are you sure these are coming from WC Memberships? I can't see any use of these functions in the plugin code.

The stack trace points to it:

image

I don't see it affecting the plugin behavior in any way.

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Apr 14, 2022
@adekbadek adekbadek merged commit 807e224 into master Apr 18, 2022
@adekbadek adekbadek deleted the add/handle-wc-memberships branch April 18, 2022 10:13
matticbot pushed a commit that referenced this pull request May 2, 2022
# [1.82.0-alpha.1](v1.81.0...v1.82.0-alpha.1) (2022-05-02)

### Bug Fixes

* **ads:** update refresh control help text ([#1601](#1601)) ([fc70afc](fc70afc))
* crashes with autocomplete inputs in Campaigns wizard and CategoryAutocomplete ([#1609](#1609)) ([101d1d6](101d1d6))
* handle Yoast Premium as a replacement for Yoast ([#1614](#1614)) ([9a503c0](9a503c0)), closes [#298](#298)
* **popups:** improve formatting of human-readable numbers ([#1603](#1603)) ([3106f18](3106f18))
* relax capabilities required to interact with Newspack ([04eb0be](04eb0be)), closes [#543](#543)
* **salesforce:** a PHP warning on sync completion due to incorrect variable ([#1616](#1616)) ([492a439](492a439))

### Features

* **ads:** use ad sizes from plugin ([#1577](#1577)) ([d238b08](d238b08))
* **donations-stripe:** integrate w/ woocommerce-memberships ([#1599](#1599)) ([807e224](807e224))
* **setup:** notice on Setup wizard after setup completed ([#1610](#1610)) ([22d6b1c](22d6b1c)), closes [#1561](#1561)
* **starter-content:** add excerpt & subtitle ([36c4452](36c4452)), closes [#514](#514)
* update debug mode notice style and position ([#1605](#1605)) ([b28075c](b28075c))
* **woocommerce:** hide setup task list ([#1615](#1615)) ([78854e8](78854e8)), closes [#1156](#1156)
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.82.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request May 3, 2022
# [1.82.0](v1.81.0...v1.82.0) (2022-05-03)

### Bug Fixes

* **ads:** update refresh control help text ([#1601](#1601)) ([fc70afc](fc70afc))
* crashes with autocomplete inputs in Campaigns wizard and CategoryAutocomplete ([#1609](#1609)) ([101d1d6](101d1d6))
* handle Yoast Premium as a replacement for Yoast ([#1614](#1614)) ([9a503c0](9a503c0)), closes [#298](#298)
* **popups:** improve formatting of human-readable numbers ([#1603](#1603)) ([3106f18](3106f18))
* relax capabilities required to interact with Newspack ([04eb0be](04eb0be)), closes [#543](#543)
* **salesforce:** a PHP warning on sync completion due to incorrect variable ([#1616](#1616)) ([492a439](492a439))

### Features

* **ads:** use ad sizes from plugin ([#1577](#1577)) ([d238b08](d238b08))
* **donations-stripe:** integrate w/ woocommerce-memberships ([#1599](#1599)) ([807e224](807e224))
* **setup:** notice on Setup wizard after setup completed ([#1610](#1610)) ([22d6b1c](22d6b1c)), closes [#1561](#1561)
* **starter-content:** add excerpt & subtitle ([36c4452](36c4452)), closes [#514](#514)
* update debug mode notice style and position ([#1605](#1605)) ([b28075c](b28075c))
* **woocommerce:** hide setup task list ([#1615](#1615)) ([78854e8](78854e8)), closes [#1156](#1156)
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.82.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants