Skip to content

Commit

Permalink
Merge branch 'develop' into remove/woopay-express-button-on-pay-for-o…
Browse files Browse the repository at this point in the history
…rder-page
  • Loading branch information
hsingyuc authored Sep 27, 2023
2 parents 4953b3b + 8416f1f commit 802908d
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Comment: Behind a feature flag: Update documentation links (new/changed docs content) when notifying merchant that a dispute needs response.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: update

Adapt the PO congratulations card copy for pending account status.
31 changes: 22 additions & 9 deletions client/overview/connection-sucess-notice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ const ConnectionSuccessNotice: React.FC = () => {

const {
accountStatus: {
progressiveOnboarding: { isComplete, isEnabled },
progressiveOnboarding: {
isEnabled: isPoEnabled,
isComplete: isPoComplete,
},
status: accountStatus,
},
onboardingTestMode,
} = wcpaySettings;
Expand All @@ -41,9 +45,9 @@ const ConnectionSuccessNotice: React.FC = () => {
<Card className="wcpay-connection-success">
{ /* Show dismiss button only at the end of Progressive Onboarding //
or at the end of the full KYC flow. */ }
{ ! ( isEnabled && ! isComplete ) && <DismissMenu /> }
{ ! ( isPoEnabled && ! isPoComplete ) && <DismissMenu /> }
<img src={ ConfettiImage } alt="confetti" />
{ isEnabled && ! isComplete ? (
{ isPoEnabled && ! isPoComplete ? (
<>
<h2>
{ __(
Expand All @@ -60,12 +64,21 @@ const ConnectionSuccessNotice: React.FC = () => {
</>
) : (
<>
<h2>
{ __(
'Congratulations! Your store has been verified.',
'woocommerce-payments'
) }
</h2>
{ accountStatus !== 'complete' ? (
<h2>
{ __(
'Congratulations! Your store is being verified.',
'woocommerce-payments'
) }
</h2>
) : (
<h2>
{ __(
'Congratulations! Your store has been verified.',
'woocommerce-payments'
) }
</h2>
) }
</>
) }
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ import type { Dispute } from 'wcpay/types/disputes';
import type { ChargeBillingDetails } from 'wcpay/types/charges';
import wcpayTracks from 'tracks';
import { useDisputeAccept } from 'wcpay/data';
import {
getDisputeFeeFormatted,
isAwaitingResponse,
isInquiry,
} from 'wcpay/disputes/utils';
import { getDisputeFeeFormatted, isInquiry } from 'wcpay/disputes/utils';
import { getAdminUrl } from 'wcpay/utils';
import DisputeNotice from './dispute-notice';
import IssuerEvidenceList from './evidence-list';
Expand Down Expand Up @@ -70,7 +66,7 @@ const DisputeAwaitingResponseDetails: React.FC< Props > = ( {
<CardBody className="transaction-details-dispute-details-body">
<DisputeNotice
dispute={ dispute }
urgent={ countdownDays <= 2 }
isUrgent={ countdownDays <= 2 }
/>
{ hasStagedEvidence && (
<InlineNotice icon={ edit } isDismissible={ false }>
Expand Down
60 changes: 32 additions & 28 deletions client/payment-details/dispute-details/dispute-notice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
import React from 'react';
import { __, sprintf } from '@wordpress/i18n';
import { ExternalLink } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';

/**
Expand All @@ -18,52 +19,55 @@ import { isInquiry } from 'wcpay/disputes/utils';

interface DisputeNoticeProps {
dispute: Dispute;
urgent: boolean;
isUrgent: boolean;
}

const DisputeNotice: React.FC< DisputeNoticeProps > = ( {
dispute,
urgent,
isUrgent,
} ) => {
const clientClaim =
const shopperDisputeReason =
reasons[ dispute.reason ]?.claim ??
__(
'The cardholder claims this is an unrecognized charge.',
'woocommerce-payments'
);

const noticeText = isInquiry( dispute )
? /* translators: <a> link to dispute documentation. %s is the clients claim for the dispute, eg "The cardholder claims this is an unrecognized charge." */
__(
// eslint-disable-next-line max-len
'<strong>%s</strong> You can challenge their claim if you believe it’s invalid. Not responding will result in an automatic loss. <a>Learn more</a>',
'woocommerce-payments'
)
: /* translators: <a> link to dispute documentation. %s is the clients claim for the dispute, eg "The cardholder claims this is an unrecognized charge." */
__(
// eslint-disable-next-line max-len
'<strong>%s</strong> Challenge the dispute if you believe the claim is invalid, or accept to forfeit the funds and pay the dispute fee. Non-response will result in an automatic loss. <a>Learn more about responding to disputes</a>',
'woocommerce-payments'
);
/* translators: <a> link to dispute documentation. %s is the clients claim for the dispute, eg "The cardholder claims this is an unrecognized charge." */
let noticeText = __(
'<strong>%s</strong> Challenge the dispute if you believe the claim is invalid, ' +
'or accept to forfeit the funds and pay the dispute fee. ' +
'Non-response will result in an automatic loss. <a>Learn more about responding to disputes</a>',
'woocommerce-payments'
);
let learnMoreDocsUrl =
'https://woocommerce.com/document/woopayments/fraud-and-disputes/managing-disputes/#responding';

if ( isInquiry( dispute ) ) {
/* translators: <a> link to dispute inquiry documentation. %s is the clients claim for the dispute, eg "The cardholder claims this is an unrecognized charge." */
noticeText = __(
'<strong>%s</strong> You can challenge their claim if you believe it’s invalid. ' +
'Not responding will result in an automatic loss. <a>Learn more about payment inquiries</a>',
'woocommerce-payments'
);
learnMoreDocsUrl =
'https://woocommerce.com/document/woopayments/fraud-and-disputes/managing-disputes/#inquiries';
}

return (
<InlineNotice
icon
status={ urgent ? 'error' : 'warning' }
status={ isUrgent ? 'error' : 'warning' }
className="dispute-notice"
isDismissible={ false }
>
{ createInterpolateElement( sprintf( noticeText, clientClaim ), {
a: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a
target="_blank"
rel="noopener noreferrer"
href="https://woocommerce.com/document/woopayments/fraud-and-disputes/managing-disputes/#section-3"
/>
),
strong: <strong />,
} ) }
{ createInterpolateElement(
sprintf( noticeText, shopperDisputeReason ),
{
a: <ExternalLink href={ learnMoreDocsUrl } />,
strong: <strong />,
}
) }
</InlineNotice>
);
};
Expand Down

0 comments on commit 802908d

Please sign in to comment.