Skip to content

Commit 9c023b7

Browse files
wjrosadiegocurbelo
andauthored
Rewording invalid keys error message (#3344)
* Rewording invalid keys error message * Readme and changelog updates * Differentiating test and live modes in messages * Updating all references to set keys in the same file * Updating frontend messages * Update frontend links to point to the settings page * Improving wording for some frontend messages * Fix tests * Minor wording fix for changelog and readme files * Improving wording for the frontend keys error message * Improving wording for the backend keys error message * Fix tests --------- Co-authored-by: Diego Curbelo <[email protected]>
1 parent 8852dbf commit 9c023b7

File tree

7 files changed

+29
-37
lines changed

7 files changed

+29
-37
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*** Changelog ***
22

33
= 8.6.0 - xxxx-xx-xx =
4+
* Tweak - Improves the wording of the invalid Stripe keys errors, instructing merchants to click the "Configure connection" button instead of manually setting the keys.
45
* Add - Includes a new promotional surface to encourage merchants to re-connect their Stripe account using the new flow.
56
* Add - Added filter to enable updating Level 3 data based on order data.
67
* Add - Replace account key sharing and replace it with an OAuth connect flow allowing users to connect their Stripe account automatically without the need to find keys.

client/data/account-keys/actions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function* saveAccountKeys( accountKeys ) {
6868
yield dispatch( 'core/notices' ).createSuccessNotice(
6969
isDisconnecting
7070
? __( 'Account disconnected.', 'woocommerce-gateway-stripe' )
71-
: __( 'Account keys saved.', 'woocommerce-gateway-stripe' )
71+
: __( 'Account connected.', 'woocommerce-gateway-stripe' )
7272
);
7373
} catch ( e ) {
7474
error = e;
@@ -79,7 +79,7 @@ export function* saveAccountKeys( accountKeys ) {
7979
'woocommerce-gateway-stripe'
8080
)
8181
: __(
82-
'Error saving account keys.',
82+
'Error connecting account.',
8383
'woocommerce-gateway-stripe'
8484
)
8585
);

client/settings/account-details/index.js

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { createInterpolateElement } from '@wordpress/element';
33
import React from 'react';
44
import { ExternalLink, Icon } from '@wordpress/components';
55
import { help } from '@wordpress/icons';
6-
import interpolateComponents from 'interpolate-components';
76
import styled from '@emotion/styled';
87
import SectionStatus from '../section-status';
98
import Tooltip from 'wcstripe/components/tooltip';
@@ -144,29 +143,20 @@ const AccountDetails = () => {
144143
return (
145144
<AccountDetailsContainer>
146145
<AccountDetailsError>
147-
{ isTestModeEnabled
148-
? interpolateComponents( {
149-
mixedString: __(
150-
"Seems like the test keys we've saved for you are no longer valid. If you recently updated them, enter the new test keys from your {{accountLink}}Stripe Account{{/accountLink}}.",
146+
{ createInterpolateElement(
147+
isTestModeEnabled
148+
? __(
149+
"Seems like the test API keys we've saved for you are no longer valid. If you recently updated them, use the <strong>Configure Connection</strong> button below to reconnect.",
151150
'woocommerce-gateway-stripe'
152-
),
153-
components: {
154-
accountLink: (
155-
<ExternalLink href="https://dashboard.stripe.com/test/apikeys" />
156-
),
157-
},
158-
} )
159-
: interpolateComponents( {
160-
mixedString: __(
161-
"Seems like the live keys we've saved for you are no longer valid. If you recently updated them, enter the new live keys from your {{accountLink}}Stripe Account{{/accountLink}}.",
151+
)
152+
: __(
153+
"Seems like the live API keys we've saved for you are no longer valid. If you recently updated them, use the <strong>Configure Connection</strong> button below to reconnect.",
162154
'woocommerce-gateway-stripe'
163-
),
164-
components: {
165-
accountLink: (
166-
<ExternalLink href="https://dashboard.stripe.com/apikeys" />
167-
),
168-
},
169-
} ) }
155+
),
156+
{
157+
strong: <strong />,
158+
}
159+
) }
170160
</AccountDetailsError>
171161
</AccountDetailsContainer>
172162
);

client/settings/payment-settings/account-keys-connection-status.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const AccountKeysConnectionStatus = ( { formRef } ) => {
5858
) {
5959
dispatch( 'core/notices' ).createErrorNotice(
6060
__(
61-
'Only live account keys should be entered.',
61+
'Only a live account should be connected.',
6262
'woocommerce-gateway-stripe'
6363
)
6464
);
@@ -79,7 +79,7 @@ export const AccountKeysConnectionStatus = ( { formRef } ) => {
7979
) {
8080
dispatch( 'core/notices' ).createErrorNotice(
8181
__(
82-
'Only test account keys should be entered.',
82+
'Only a test account should be connected.',
8383
'woocommerce-gateway-stripe'
8484
)
8585
);

includes/admin/class-wc-stripe-admin-notices.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public function stripe_check_environment() {
211211

212212
$notice_message = sprintf(
213213
/* translators: 1) HTML anchor open tag 2) HTML anchor closing tag */
214-
__( 'Stripe is almost ready. To get started, %1$sset your Stripe account keys%2$s.', 'woocommerce-gateway-stripe' ),
214+
__( 'Stripe is almost ready. To get started, go to %1$syour settings%2$s and use the <strong>Configure Connection</strong> button to connect.', 'woocommerce-gateway-stripe' ),
215215
'<a href="' . $setting_link . '">',
216216
'</a>'
217217
);
@@ -227,7 +227,7 @@ public function stripe_check_environment() {
227227

228228
$notice_message = sprintf(
229229
/* translators: 1) HTML anchor open tag 2) HTML anchor closing tag */
230-
__( 'Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test or rk_test. Please go to your settings and, %1$sset your Stripe account keys%2$s.', 'woocommerce-gateway-stripe' ),
230+
__( 'Stripe is in test mode however your API keys may not be valid. Please go to %1$syour settings%2$s and use the <strong>Configure Connection</strong> button to reconnect.', 'woocommerce-gateway-stripe' ),
231231
'<a href="' . $setting_link . '">',
232232
'</a>'
233233
);
@@ -242,7 +242,7 @@ public function stripe_check_environment() {
242242

243243
$message = sprintf(
244244
/* translators: 1) HTML anchor open tag 2) HTML anchor closing tag */
245-
__( 'Stripe is in live mode however your live keys may not be valid. Live keys start with pk_live and sk_live or rk_live. Please go to your settings and, %1$sset your Stripe account keys%2$s.', 'woocommerce-gateway-stripe' ),
245+
__( 'Stripe is in live mode however your API keys may not be valid. Please go to %1$syour settings%2$s and use the <strong>Configure Connection</strong> button to reconnect.', 'woocommerce-gateway-stripe' ),
246246
'<a href="' . $setting_link . '">',
247247
'</a>'
248248
);
@@ -258,7 +258,7 @@ public function stripe_check_environment() {
258258

259259
$message = sprintf(
260260
/* translators: 1) HTML anchor open tag 2) HTML anchor closing tag */
261-
__( 'Your customers cannot use Stripe on checkout, because we couldn\'t connect to your account. Please go to your settings and, %1$sset your Stripe account keys%2$s.', 'woocommerce-gateway-stripe' ),
261+
__( 'Your customers cannot use Stripe on checkout, because we couldn\'t connect to your account. Please go to %1$syour settings%2$s and use the <strong>Configure Connection</strong> button to connect.', 'woocommerce-gateway-stripe' ),
262262
'<a href="' . $setting_link . '">',
263263
'</a>'
264264
);
@@ -295,7 +295,7 @@ public function stripe_check_environment() {
295295
if ( 'yes' === $changed_keys_notice ) {
296296
$message = sprintf(
297297
/* translators: 1) HTML anchor open tag 2) HTML anchor closing tag */
298-
__( 'The public and/or secret keys for the Stripe gateway have been changed. This might cause errors for existing customers and saved payment methods. %1$sClick here to learn more%2$s.', 'woocommerce-gateway-stripe' ),
298+
__( 'Credentials used for the Stripe gateway have been changed. This might cause errors for existing customers and saved payment methods. %1$sClick here to learn more%2$s.', 'woocommerce-gateway-stripe' ),
299299
'<a href="https://woocommerce.com/document/stripe/customization/database-cleanup/" target="_blank">',
300300
'</a>'
301301
);

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ If you get stuck, you can ask for help in the Plugin Forum.
129129
== Changelog ==
130130

131131
= 8.6.0 - xxxx-xx-xx =
132+
* Tweak - Improves the wording of the invalid Stripe keys errors, instructing merchants to click the "Configure connection" button instead of manually setting the keys.
132133
* Add - Includes a new promotional surface to encourage merchants to re-connect their Stripe account using the new flow.
133134
* Add - Added filter to enable updating Level 3 data based on order data.
134135
* Add - Replace account key sharing and replace it with an OAuth connect flow allowing users to connect their Stripe account automatically without the need to find keys.

tests/phpunit/admin/test-wc-stripe-admin-notices.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public function options_to_notices_map() {
251251
[
252252
'keys',
253253
],
254-
'/set your Stripe account keys/',
254+
'/and use the \<strong\>Configure Connection\<\/strong\> button to reconnect/',
255255
],
256256
[
257257
[
@@ -289,7 +289,7 @@ public function options_to_notices_map() {
289289
[
290290
'page' => 'wc-settings',
291291
],
292-
'/set your Stripe account keys/',
292+
'/and use the \<strong\>Configure Connection\<\/strong\> button to reconnect/',
293293
],
294294
[
295295
[
@@ -306,7 +306,7 @@ public function options_to_notices_map() {
306306
[
307307
'keys',
308308
],
309-
'/your test keys may not be valid/',
309+
'/Stripe is in test mode however your API keys may not be valid/',
310310
],
311311
[
312312
[
@@ -344,7 +344,7 @@ public function options_to_notices_map() {
344344
[
345345
'keys',
346346
],
347-
'/your live keys may not be valid/',
347+
'/Stripe is in live mode however your API keys may not be valid/',
348348
],
349349
[
350350
[
@@ -406,7 +406,7 @@ public function options_to_notices_map() {
406406
'sca',
407407
'changed_keys',
408408
],
409-
'/set your Stripe account keys/',
409+
'/and use the \<strong\>Configure Connection\<\/strong\> button to reconnect/',
410410
],
411411
[
412412
[
@@ -423,7 +423,7 @@ public function options_to_notices_map() {
423423
'sca',
424424
'changed_keys',
425425
],
426-
'/set your Stripe account keys/',
426+
'/and use the \<strong\>Configure Connection\<\/strong\> button to reconnect/',
427427
],
428428
[
429429
[

0 commit comments

Comments
 (0)