From ec575f19d83bc4eb2d0324e230345777513a3e67 Mon Sep 17 00:00:00 2001 From: Philipp Stracker Date: Thu, 13 Feb 2025 16:52:07 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Initial=20=E2=80=9Cdefault=20con?= =?UTF-8?q?fig=E2=80=9D=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pplying-default-values-after-onboarding.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 modules/ppcp-settings/docs/applying-default-values-after-onboarding.md diff --git a/modules/ppcp-settings/docs/applying-default-values-after-onboarding.md b/modules/ppcp-settings/docs/applying-default-values-after-onboarding.md new file mode 100644 index 000000000..bfeefc65e --- /dev/null +++ b/modules/ppcp-settings/docs/applying-default-values-after-onboarding.md @@ -0,0 +1,54 @@ +# Applying Default Configuration After Onboarding + +The `OnboardingProfile` has a property named `setup_done`, which indicated whether the default +configuration was set up. + +### `OnboardingProfile::is_setup_done()` + +This flag indicated, whether the default plugin configuration was applied or not. +It's set to true after the merchant's authentication attempt was successful, and settings were +adjusted. + +The only way to reset this flag, is to enable the "**Start Over**" toggle and disconnecting the +merchant: +https://example.com/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway&panel=settings#disconnect-merchant + +### `class SettingsDataManager` + +The `SettingsDataManager` service is responsible for applying all defaults options at the end of the +onboarding process. + +### `SettingsDataManager::set_defaults_for_new_merchant()` + +This method expects a DTO argument (`ConfigurationFlagsDTO`) that provides relevant details about +the merchant and onboarding choices. + +It verifies, if default settings were already applied (by checking the +`OnboardingProfile::is_setup_done()` state). If not done yet, the DTO object is inspected to +initialize the plugin's configuration, before marking the `setup_done` flag as completed. + +## Default Settings Matrix + +### Payment Methods + + + +### Settings + +| Feature | Country | Seller-Type | Subscriptions | Cards | +|-----------------------------|---------|-------------|---------------|-------| +| Pay Now Experience | US | _any_ | _any_ | _any_ | +| Save PayPal and Venmo | US | Business | ✅ | _any_ | +| Save Credit and Debit Cards | US | Business | ✅ | ✅ | + +### Styling + +All US merchants use the same settings, regardless of any onboarding choices. + +| Button Location | Enabled | Displayed Payment Methods | +|------------------|---------|-------------------------------------------------| +| Cart | ✅ | PayPal, Venmo, Pay Later, Google Pay, Apple Pay | +| Classic Checkout | ✅ | PayPal, Venmo, Pay Later, Google Pay, Apple Pay | +| Express Checkout | ✅ | PayPal, Venmo, Pay Later, Google Pay, Apple Pay | +| Mini Cart | ✅ | PayPal, Venmo, Pay Later, Google Pay, Apple Pay | +| Product Page | ✅ | PayPal, Venmo, Pay Later |