Skip to content

Commit de740fd

Browse files
authored
Do not display VAT setup modal for unsupported merchants (#11011)
1 parent a6db9f9 commit de740fd

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: fix
3+
4+
Fix VAT setup modal for unsupported merchants

client/globals.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ declare global {
6969
pastDue?: boolean;
7070
accountLink: string;
7171
hasSubmittedVatData?: boolean;
72+
isDocumentsEnabled?: boolean;
7273
requirements?: {
7374
errors?: {
7475
code: string;

client/settings/settings-manager/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,14 @@ const SettingsManager = () => {
192192
useEffect( () => {
193193
const urlParams = new URLSearchParams( window.location.search );
194194
if ( urlParams.get( 'woopayments-vat-details-modal' ) === 'true' ) {
195-
if ( ! wcpaySettings.accountStatus.hasSubmittedVatData ) {
195+
if ( ! wcpaySettings.accountStatus.isDocumentsEnabled ) {
196+
dispatch( 'core/notices' ).createErrorNotice(
197+
__(
198+
'Tax details collection is not available for your account.',
199+
'woocommerce-payments'
200+
)
201+
);
202+
} else if ( ! wcpaySettings.accountStatus.hasSubmittedVatData ) {
196203
setVatFormModalOpen( true );
197204
} else {
198205
dispatch( 'core/notices' ).createInfoNotice(

includes/class-wc-payments-account.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ public function get_account_status_data(): array {
362362
// Test-drive accounts don't have access to the Stripe dashboard.
363363
'accountLink' => empty( $account['is_test_drive'] ) ? $this->get_login_url() : false,
364364
'hasSubmittedVatData' => $account['has_submitted_vat_data'] ?? false,
365+
'isDocumentsEnabled' => $account['is_documents_enabled'] ?? false,
365366
'requirements' => [
366367
'errors' => $account['requirements']['errors'] ?? [],
367368
],

0 commit comments

Comments
 (0)