Skip to content

Commit 51f1529

Browse files
authored
Fix full bank statement field description (#2283)
* Fix typo: spacing between words and the dash line * Add tooltip to bank statement field, indicating acceptable input The tooltip indicates what input is acceptable in the bank statement field. * Update changelog: Fixed full bank statement field description * Rephrase bank statement input requirement messages Rephrasing in order to clarify what characters can be input for the bank statement field. * Remove unneeded style: flex-shrink
1 parent ddb78f0 commit 51f1529

File tree

5 files changed

+39
-5
lines changed

5 files changed

+39
-5
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Tweak - Use the newly exposed LoadableMask component provided by WooCommerce Blocks to trigger the loading state for Payment Request Buttons.
55
* Add - Add filter call when updating an existent intent (wc_stripe_update_existing_intent_request).
66
* Add - Add ability to test Stripe account keys' validity.
7+
* Fix - Fixed full bank statement field description.
78

89
= 6.0.0 - 2022-01-05 =
910
* Fix - Fixed capitalization for payment method names: iDEAL, giropay, and Sofort.

client/settings/payments-and-transactions-section/index.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { __ } from '@wordpress/i18n';
22
import React, { useContext } from 'react';
33
import { Card, CheckboxControl, TextControl } from '@wordpress/components';
4+
import { Icon, help } from '@wordpress/icons';
45
import CardBody from '../card-body';
56
import TextLengthHelpInputWrapper from './text-length-help-input-wrapper';
67
import StatementPreviewsWrapper from './statement-previews-wrapper';
78
import StatementPreview from './statement-preview';
89
import ManualCaptureControl from './manual-capture-control';
10+
import Tooltip from 'wcstripe/components/tooltip';
911
import {
1012
useSavedCards,
1113
useSeparateCardForm,
@@ -17,6 +19,19 @@ import {
1719
import InlineNotice from 'wcstripe/components/inline-notice';
1820
import UpeToggleContext from 'wcstripe/settings/upe-toggle/context';
1921

22+
const TooltipBankStatementHelp = () => (
23+
<Tooltip
24+
content={ __(
25+
'The bank statement must contain only Latin characters, be between 5 and 22 characters, and not contain any of the special characters: \' " * < >',
26+
'woocommerce-gateway-stripe'
27+
) }
28+
>
29+
<span>
30+
<Icon style={ { fill: '#949494' } } icon={ help } />
31+
</span>
32+
</Tooltip>
33+
);
34+
2035
const PaymentsAndTransactionsSection = () => {
2136
const [ isSavedCardsEnabled, setIsSavedCardsEnabled ] = useSavedCards();
2237
const [
@@ -104,10 +119,11 @@ const PaymentsAndTransactionsSection = () => {
104119
<TextLengthHelpInputWrapper
105120
textLength={ accountStatementDescriptor.length }
106121
maxLength={ 22 }
122+
iconSlot={ <TooltipBankStatementHelp /> }
107123
>
108124
<TextControl
109125
help={ __(
110-
'Enter the name your customers will see on their transactions. Use a recognizable name – e.g. the legal entity name or website addressto avoid potential disputes and chargebacks.',
126+
'Enter the name your customers will see on their transactions. Use a recognizable name – e.g. the legal entity name or website addressto avoid potential disputes and chargebacks.',
111127
'woocommerce-gateway-stripe'
112128
) }
113129
label={ __(

client/settings/payments-and-transactions-section/text-length-help-input-wrapper.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,32 @@ const HelpText = styled.span`
2929
}
3030
`;
3131

32+
const DivIcon = styled.div`
33+
position: absolute;
34+
top: 33px;
35+
right: -24px;
36+
37+
width: 1.5rem;
38+
height: 1.5rem;
39+
40+
@media ( min-width: 783px ) {
41+
top: 28px;
42+
right: calc( 50% - 28px );
43+
}
44+
`;
45+
3246
const TextLengthHelpInputWrapper = ( {
3347
children,
3448
textLength = 0,
3549
maxLength,
50+
iconSlot = null,
3651
} ) => (
37-
<Wrapper>
52+
<Wrapper style={ { width: iconSlot ? 'calc( 100% - 24px )' : null } }>
3853
{ children }
3954
<HelpText aria-hidden="true">
4055
{ `${ textLength } / ${ maxLength }` }
4156
</HelpText>
57+
{ iconSlot && <DivIcon>{ iconSlot }</DivIcon> }
4258
</Wrapper>
4359
);
4460

includes/class-wc-gateway-stripe.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,10 +1134,10 @@ public function is_automatic_capture_enabled() {
11341134
public function validate_account_statement_descriptor_field( $param, $value, $max_length ) {
11351135
// Since the value is escaped, and we are saving in a place that does not require escaping, apply stripslashes.
11361136
$value = trim( stripslashes( $value ) );
1137-
$field = __( 'Customer bank statement', 'woocommerce-gateway-stripe' );
1137+
$field = __( 'customer bank statement', 'woocommerce-gateway-stripe' );
11381138

11391139
if ( 'short_statement_descriptor' === $param ) {
1140-
$field = __( 'Shortened customer bank statement', 'woocommerce-gateway-stripe' );
1140+
$field = __( 'shortened customer bank statement', 'woocommerce-gateway-stripe' );
11411141
}
11421142

11431143
// Validation can be done with a single regex but splitting into multiple for better readability.
@@ -1153,7 +1153,7 @@ public function validate_account_statement_descriptor_field( $param, $value, $ma
11531153
throw new InvalidArgumentException(
11541154
sprintf(
11551155
/* translators: %1 field name, %2 Number of the maximum characters allowed */
1156-
__( '%1$s is invalid. Statement should be between 5 and %2$u characters long, contain at least single Latin character and does not contain special characters: \' " * &lt; &gt;', 'woocommerce-gateway-stripe' ),
1156+
__( 'The %1$s is invalid. The bank statement must contain only Latin characters, be between 5 and %2$u characters, contain at least one letter, and not contain any of the special characters: \' " * &lt; &gt;', 'woocommerce-gateway-stripe' ),
11571157
$field,
11581158
$max_length
11591159
)

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,6 @@ If you get stuck, you can ask for help in the Plugin Forum.
132132
* Tweak - Use the newly exposed LoadableMask component provided by WooCommerce Blocks to trigger the loading state for Payment Request Buttons.
133133
* Add - Add filter call when updating an existent intent (wc_stripe_update_existing_intent_request).
134134
* Add - Add ability to test Stripe account keys' validity.
135+
* Fix - Fixed full bank statement field description.
135136

136137
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).

0 commit comments

Comments
 (0)