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

Introduce a test drive mode into the onboarding process #9109

Merged
merged 74 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
2b0d340
Add a test drive mode button on connect page
mordeth Jul 17, 2024
57547a7
Merge branch 'develop' into add/test-drive-mode
mordeth Jul 17, 2024
08fe035
Add overviewUrl to wcPaySettings
mordeth Jul 17, 2024
b67bd92
Onboard test drive accounts async
mordeth Jul 17, 2024
387440e
Remove obsolete text string
mordeth Jul 18, 2024
f1e138d
Redirect to connect page after Jetpack connection
mordeth Jul 18, 2024
2cb4c68
Test drive redirect to Jetpack connect screen
mordeth Jul 18, 2024
8269574
Merge branch 'develop' into add/test-drive-mode
mordeth Jul 20, 2024
5e8b5f9
Check account status only if account is onboarded
mordeth Jul 20, 2024
d98fc5c
Merge branch 'add/test-drive-mode' of github.com:Automattic/woocommer…
mordeth Jul 20, 2024
2c3fee0
Merge branch 'develop' into add/test-drive-mode
mordeth Jul 24, 2024
c489d99
Install @woocommerce/onboarding
mordeth Jul 24, 2024
c503f62
Add loader for test drive onboarding
mordeth Jul 24, 2024
1953e1d
Show error if the sandbox account creation failed
mordeth Jul 24, 2024
5faf107
Show a success message on the overview page
mordeth Jul 24, 2024
b98d260
Fake test onboarding progress bar
mordeth Jul 24, 2024
d658133
Fix onboarding loader on tablet and mobile screens
mordeth Jul 25, 2024
9f734ec
Force refresh account cache after onboarding
mordeth Jul 25, 2024
d361ffb
Merge branch 'develop' into add/test-drive-mode
mordeth Jul 25, 2024
69cc111
Add changelog
mordeth Jul 26, 2024
3504b3e
Update test drive loader styling
mordeth Jul 29, 2024
215c82b
Merge branch 'develop' into add/test-drive-mode
mordeth Jul 29, 2024
63a625e
Fallback in case Stripe never provide complete account
mordeth Jul 29, 2024
cc9478b
Restart loader progress in case of error
mordeth Jul 29, 2024
0d9044a
Merge branch 'develop' into add/test-drive-mode
mordeth Jul 29, 2024
a924d18
Merge branch 'develop' into add/test-drive-mode
mordeth Aug 1, 2024
9a2e2c6
Merge branch 'develop' into add/test-drive-mode
mordeth Aug 5, 2024
f80fea1
Update changelog and block comment
mordeth Aug 5, 2024
3a84f96
Update sandbox mode copy
mordeth Aug 5, 2024
bf80405
Merge branch 'develop' into add/test-drive-mode
mordeth Aug 6, 2024
deaf1af
Merge branch 'develop' into add/test-drive-mode
vladolaru Aug 9, 2024
a21c718
Add array_filter_recursive util
vladolaru Aug 9, 2024
0d48264
test: Add unit tests for array utils
vladolaru Aug 9, 2024
35078f1
Better filter onboarding data
vladolaru Aug 9, 2024
7f4dc19
Add array_merge_recursive_distinct util
vladolaru Aug 9, 2024
cb2c16b
test: Add unit tests for array_merge_recursive_distinct
vladolaru Aug 9, 2024
058c592
Test-drive accounts don't have access to the Stripe dashboard
vladolaru Aug 9, 2024
0bd7eb8
Add required props
vladolaru Aug 9, 2024
7a989fb
Minor refactoring on Overview page
vladolaru Aug 9, 2024
a56bad4
Carry over sandbox params
vladolaru Aug 9, 2024
f94fcb3
Ensure proper cache and state handling
vladolaru Aug 9, 2024
ded3690
Refactor init_stripe_onboarding around three setup modes
vladolaru Aug 9, 2024
d8d0e05
Look for pending-like status to determine test-drive completion
vladolaru Aug 9, 2024
10ab2ee
Show test-drive error on Connect
vladolaru Aug 9, 2024
164ea6c
Improvements to the test-drive FE logic
vladolaru Aug 9, 2024
a97f96b
test: Fix unit tests
vladolaru Aug 9, 2024
0309f3c
Merge branch 'develop' into add/test-drive-mode
vladolaru Aug 9, 2024
9618aa2
Use a bigger icon size
vladolaru Aug 9, 2024
c34320d
Include login error class with notice
vladolaru Aug 9, 2024
1d61c0c
test: Fix login error test
vladolaru Aug 9, 2024
45eff84
test: Fix Account Status tests
vladolaru Aug 9, 2024
064d10e
Fix test drive onboarding without an existing Jetpack connection
vladolaru Aug 9, 2024
a3dd2a6
Merge branch 'develop' into add/test-drive-mode
mordeth Aug 15, 2024
85cdfd6
Fallback to express accounts for Singapore and UAE
mordeth Aug 15, 2024
5bb8f08
Do not redirect to onboarding wizard for builder accounts
mordeth Aug 15, 2024
49d4f60
Skip MOX for sandbox accounts already in progress
mordeth Aug 15, 2024
1ea0e0a
Merge branch 'develop' into add/test-drive-mode
mordeth Aug 15, 2024
3392118
Prevent JS error
vladolaru Aug 15, 2024
668fa62
Merge branch 'develop' into add/test-drive-mode
vladolaru Aug 16, 2024
7d47f18
Revert "Fallback to express accounts for Singapore and UAE"
vladolaru Aug 16, 2024
9bd946d
Revert "Do not redirect to onboarding wizard for builder accounts"
vladolaru Aug 16, 2024
8434523
Revert "Skip MOX for sandbox accounts already in progress"
vladolaru Aug 16, 2024
9a893d5
Add cache control headers
vladolaru Aug 16, 2024
19da916
Handle test-driven mode fallback to regular test accounts
vladolaru Aug 16, 2024
97b13ca
Ensure more consistent data submitted on onboarding
vladolaru Aug 16, 2024
515bef4
Fix undefined error
mordeth Aug 16, 2024
2c09ae8
Refactor JS test-drive logic to work with just JSON
vladolaru Aug 16, 2024
4cbd41a
Pass through the sandbox success param
vladolaru Aug 16, 2024
b9b77ee
Fix error when account data is false
vladolaru Aug 16, 2024
9afe041
Merge branch 'develop' into add/test-drive-mode
vladolaru Aug 16, 2024
b2af679
Don't show test drive success notice when account is not complete or …
vladolaru Aug 16, 2024
81121b5
Skip InlineNotices on deposits when the account link is not present
mordeth Aug 16, 2024
7d37c45
test: fix unit test
vladolaru Aug 16, 2024
fbe7b82
Merge branch 'develop' into add/test-drive-mode
mordeth Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/add-test-drive-mode
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: add

Enhance Sandbox mode onboarding by skipping KYC and making it fully automated for all supported countries.
44 changes: 25 additions & 19 deletions client/components/account-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ const AccountStatusError = () => {

const AccountStatusDetails = ( props ) => {
const { accountStatus, accountFees } = props;
const accountLink = addQueryArgs( accountStatus.accountLink, {
from: 'WCPAY_ACCOUNT_DETAILS',
source: 'wcpay-account-details',
} );
const accountLink = accountStatus.accountLink
? addQueryArgs( accountStatus.accountLink, {
from: 'WCPAY_ACCOUNT_DETAILS',
source: 'wcpay-account-details',
} )
: false;
const cardTitle = (
<>
<FlexItem className={ 'account-details' }>
Expand All @@ -78,21 +80,23 @@ const AccountStatusDetails = ( props ) => {
}
/>
</FlexBlock>
<FlexItem className={ 'edit-details' }>
<Button
variant={ 'link' }
onClick={ () =>
recordEvent( 'wcpay_account_details_link_clicked', {
from: 'WCPAY_ACCOUNT_DETAILS',
source: 'wcpay-account-details',
} )
}
href={ accountLink }
target={ '_blank' }
>
{ __( 'Edit details', 'woocommerce-payments' ) }
</Button>
</FlexItem>
{ accountLink && (
<FlexItem className={ 'edit-details' }>
<Button
variant={ 'link' }
onClick={ () =>
recordEvent( 'wcpay_account_details_link_clicked', {
from: 'WCPAY_ACCOUNT_DETAILS',
source: 'wcpay-account-details',
} )
}
href={ accountLink }
target={ '_blank' }
>
{ __( 'Edit details', 'woocommerce-payments' ) }
</Button>
</FlexItem>
) }
</>
);

Expand All @@ -104,6 +108,7 @@ const AccountStatusDetails = ( props ) => {
<PaymentsStatus
paymentsEnabled={ accountStatus.paymentsEnabled }
accountStatus={ accountStatus.status }
iconSize={ 24 }
/>
</AccountStatusItem>
<AccountStatusItem
Expand All @@ -117,6 +122,7 @@ const AccountStatusDetails = ( props ) => {
poComplete={
accountStatus.progressiveOnboarding.isComplete
}
iconSize={ 24 }
/>
</AccountStatusItem>
<AccountTools />
Expand Down
159 changes: 157 additions & 2 deletions client/components/account-status/test/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,160 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`AccountStatus does not render edit details when no account link 1`] = `
<div>
<div
class="components-surface components-card css-nsno0f-View-Surface-getBorders-primary-Card-rounded em57xhy0"
data-wp-c16t="true"
data-wp-component="Card"
>
<div
class="css-mgwsf4-View-Content em57xhy0"
>
<div
class="components-flex components-card__header components-card-header woocommerce-account-status__header css-1g7xfrj-View-Flex-sx-Base-sx-Items-ItemsRow-Header-borderRadius-borderColor-medium em57xhy0"
data-wp-c16t="true"
data-wp-component="CardHeader"
>
<div
class="components-flex-item account-details css-mw3lhz-View-Item-sx-Base em57xhy0"
data-wp-c16t="true"
data-wp-component="FlexItem"
>
Account details
</div>
<div
class="components-flex-item components-flex-block account-status css-14wzr73-View-Item-sx-Base-block em57xhy0"
data-wp-c16t="true"
data-wp-component="FlexBlock"
>
<span
class="chip chip-success"
>
Complete
</span>
</div>
</div>
<div
class="components-card__body components-card-body css-1nwhnu3-View-Body-borderRadius-medium em57xhy0"
data-wp-c16t="true"
data-wp-component="CardBody"
>
<div
class="components-flex woocommerce-account-status-item css-h2ogiv-View-Flex-sx-Base-sx-Items-ItemsRow em57xhy0"
data-wp-c16t="true"
data-wp-component="Flex"
>
<div
class="components-flex-item item-label css-mw3lhz-View-Item-sx-Base em57xhy0"
data-wp-c16t="true"
data-wp-component="FlexItem"
>
Payments:
</div>
<div
class="components-flex-item components-flex-block item-value css-14wzr73-View-Item-sx-Base-block em57xhy0"
data-wp-c16t="true"
data-wp-component="FlexBlock"
>
<span
class="account-status__info__green"
>
<svg
class="gridicon gridicons-checkmark-circle"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<g>
<path
d="M11 17.768l-4.884-4.884 1.768-1.768L11 14.232l8.658-8.658A9.98 9.98 0 0012 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10a9.94 9.94 0 00-.966-4.266L11 17.768z"
/>
</g>
</svg>
Enabled
</span>
</div>
</div>
<div
class="components-flex woocommerce-account-status-item css-h2ogiv-View-Flex-sx-Base-sx-Items-ItemsRow em57xhy0"
data-wp-c16t="true"
data-wp-component="Flex"
>
<div
class="components-flex-item item-label css-mw3lhz-View-Item-sx-Base em57xhy0"
data-wp-c16t="true"
data-wp-component="FlexItem"
>
Deposits:
</div>
<div
class="components-flex-item components-flex-block item-value css-14wzr73-View-Item-sx-Base-block em57xhy0"
data-wp-c16t="true"
data-wp-component="FlexBlock"
>
<span
class="account-status__info__green"
>
<svg
class="gridicon gridicons-checkmark-circle"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<g>
<path
d="M11 17.768l-4.884-4.884 1.768-1.768L11 14.232l8.658-8.658A9.98 9.98 0 0012 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10a9.94 9.94 0 00-.966-4.266L11 17.768z"
/>
</g>
</svg>
Automatic
</span>
</div>
</div>
<div
class="account-fees"
>
<hr
aria-orientation="horizontal"
class="components-divider components-card__divider components-card-divider css-yo8r29-DividerView-renderBorder-renderSize-renderMargin-Divider-borderColor e19on6iw0"
data-wp-c16t="true"
data-wp-component="CardDivider"
role="separator"
/>
<h4>
Active discounts
</h4>
</div>
<p>
Card transactions
:
</p>
Euro
(EUR)
<s>
2.9% + 0,00 € per transaction
</s>
2.9% + 0,30 € per transaction
</div>
</div>
<div
aria-hidden="true"
class="components-elevation css-91yjwm-View-Elevation-sx-Base-elevationClassName em57xhy0"
data-wp-c16t="true"
data-wp-component="Elevation"
/>
<div
aria-hidden="true"
class="components-elevation css-91yjwm-View-Elevation-sx-Base-elevationClassName em57xhy0"
data-wp-c16t="true"
data-wp-component="Elevation"
/>
</div>
</div>
`;

exports[`AccountStatus renders account tools 1`] = `
<div>
<div
Expand Down Expand Up @@ -40,7 +195,7 @@ exports[`AccountStatus renders account tools 1`] = `
>
<a
class="components-button is-link"
href="?from=WCPAY_ACCOUNT_DETAILS&source=wcpay-account-details"
href="https://stripe.example.com/account?from=WCPAY_ACCOUNT_DETAILS&source=wcpay-account-details"
target="_blank"
>
Edit details
Expand Down Expand Up @@ -276,7 +431,7 @@ exports[`AccountStatus renders normal status 1`] = `
>
<a
class="components-button is-link"
href="?from=WCPAY_ACCOUNT_DETAILS&source=wcpay-account-details"
href="https://stripe.example.com/account?from=WCPAY_ACCOUNT_DETAILS&source=wcpay-account-details"
target="_blank"
>
Edit details
Expand Down
43 changes: 43 additions & 0 deletions client/components/account-status/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,48 @@ describe( 'AccountStatus', () => {
const { container: accountStatus } = renderAccountStatus(
{
status: 'complete',
accountLink: 'https://stripe.example.com/account',
paymentsEnabled: 1,
deposits: {
status: 'enabled',
interval: 'weekly',
},
progressiveOnboarding: {
isEnabled: false,
isComplete: false,
},
},
[
{
payment_method: 'card',
fee: {
base: {
currency: 'EUR',
percentage_rate: 0.029,
fixed_rate: 0.3,
},
discount: [
{
end_time: null,
volume_allowance: null,
volume_currency: null,
current_volume: null,
percentage_rate: 0.029,
fixed_rate: 30,
},
],
},
},
]
);
expect( accountStatus ).toMatchSnapshot();
} );

test( 'does not render edit details when no account link', () => {
const { container: accountStatus } = renderAccountStatus(
{
status: 'complete',
accountLink: false,
paymentsEnabled: 1,
deposits: {
status: 'enabled',
Expand Down Expand Up @@ -85,6 +127,7 @@ describe( 'AccountStatus', () => {
const { container: accountStatus } = renderAccountStatus(
{
status: 'complete',
accountLink: 'https://stripe.example.com/account',
paymentsEnabled: 1,
deposits: {
status: 'enabled',
Expand Down
Loading
Loading