Skip to content

Conversation

@allendav
Copy link
Contributor

@allendav allendav commented Nov 3, 2021

Closes #5269

@joshheald @jaclync - if either of you could take a look, that would be great - just one of y'all are needed of course, but both of y'all are welcome

This PR undoes the "hack" we introduced in 7.8 ( #5259) to use networkActivated for storing the active state (we did this to avoid a core data change during the 7.8 code freeze) and leverages the core data work done in #5279

To test:

  • Uninstall the WooCommerce Payments plugin if installed on your store

  • Sign into the app as a shop manager for that store

  • Navigate to settings (gear), In-Person Payments

  • Ensure that you are asked to install the plugin

  • Install, but do not activate the WooCommerce Payments plugin

  • Tap on Refresh After Installing

  • Ensure that you are asked to activate the plugin

  • Activate the plugin

  • Tap on Refresh After Activating

  • Ensure that you can now get to the Buy/Manage/Read view for card readers

Also ensure unit tests pass. Unit tests for SystemStatusMapper and CardPresentPaymentsOnboardingUseCase were updated.

Update release notes:

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@allendav allendav added the feature: mobile payments Related to mobile payments / card present payments / Woo Payments. label Nov 3, 2021
@allendav allendav added this to the 8.0 milestone Nov 3, 2021
///
let activePlugins = systemStatus.activePlugins.map {
$0.overrideNetworkActivated(isNetworkActivated: true)
$0.copy(active: true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Props @ctarda

@peril-woocommerce
Copy link

peril-woocommerce bot commented Nov 3, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-woocommerce
Copy link

peril-woocommerce bot commented Nov 3, 2021

You can trigger an installable build for these changes by visiting CircleCI here.

@allendav allendav requested review from jaclync and joshheald November 3, 2021 20:31
@allendav allendav marked this pull request as ready for review November 3, 2021 20:33
@jaclync jaclync self-assigned this Nov 4, 2021
Copy link
Contributor

@jaclync jaclync left a comment

Choose a reason for hiding this comment

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

Looks good! :shipit:

Just wanted to clarify 2 things from testing:

  • Sign into the app as a shop manager for that store
  • Navigate to settings (gear), In-Person Payments
  • Ensure that you are asked to install the plugin
  • Install, but do not activate the WooCommerce Payments plugin

As a shop manager, I wasn't able to manage plugins. The step to install WCPay plugin has to be performed by another admin account right?

  • Tap on Refresh After Activating
  • Ensure that you can now get to the Buy/Manage/Read view for card readers

I saw this screen instead, probably because I haven't finished setting up WCPay with Stripe and all that?


/// Is the plugin active, i.e. false | true
///
public let active: Bool
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: just wondering, "active" and "activated" are interchangeable in the WP plugins context right? I'm just more used to "activated" as in wp-admin. After seeing networkActivated above, I was expecting this to be activated but it's very minor 🙂

TIL'ed "network active plugins" 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IKR?! I went back and forth on active vs activated. I ultimately picked active because that is the term used in the JSON in the system status response (inactive_plugins, active_plugins)

case activePlugins = "active_plugins"
case inactivePlugins = "inactive_plugins"

@allendav
Copy link
Contributor Author

allendav commented Nov 4, 2021

Thanks for the review @jaclync !

As a shop manager, I wasn't able to manage plugins. The step to install WCPay plugin has to be performed by another admin account right?

That's correct.

I saw this screen instead, probably because I haven't finished setting up WCPay with Stripe and all that?

Yep! That's also correct!

@allendav allendav merged commit e67b78f into develop Nov 4, 2021
@allendav allendav deleted the issue/5269-systemplugin-active branch November 4, 2021 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: mobile payments Related to mobile payments / card present payments / Woo Payments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mobile Payments] [Core Data] Use SystemPlugin active attribute instead of networkActivated

3 participants