Skip to content

Commit c2c8fce

Browse files
Default express checkout button label to "Only icon" (#9429)
1 parent 26c54dd commit c2c8fce

11 files changed

+17
-13
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: update
3+
4+
Default express checkout button label to "Only icon".

client/settings/express-checkout-settings/general-payment-request-button-settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ const GeneralPaymentRequestButtonSettings = ( { type } ) => {
199199
className="payment-method-settings__cta-selection"
200200
label={ __( 'Call to action', 'woocommerce-payments' ) }
201201
help={ __(
202-
'Select a button label that fits best wit the flow of purchase or payment experience on your store.',
202+
'Select a button label that fits best with the flow of purchase or payment experience on your store.',
203203
'woocommerce-payments'
204204
) }
205205
hideLabelFromVision

client/settings/express-checkout-settings/test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jest.mock( '../../../data', () => ( {
2323
useWooPayEnabledSettings: jest.fn().mockReturnValue( [ true, jest.fn() ] ),
2424
useWooPayCustomMessage: jest.fn().mockReturnValue( [ 'test', jest.fn() ] ),
2525
useWooPayStoreLogo: jest.fn().mockReturnValue( [ 'test', jest.fn() ] ),
26-
usePaymentRequestButtonType: jest.fn().mockReturnValue( [ 'buy' ] ),
26+
usePaymentRequestButtonType: jest.fn().mockReturnValue( [ 'default' ] ),
2727
usePaymentRequestButtonSize: jest.fn().mockReturnValue( [ 'small' ] ),
2828
usePaymentRequestButtonTheme: jest.fn().mockReturnValue( [ 'dark' ] ),
2929
usePaymentRequestButtonBorderRadius: jest.fn().mockReturnValue( [ 4 ] ),

client/settings/express-checkout-settings/test/payment-request-settings.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
jest.mock( '../../../data', () => ( {
2424
usePaymentRequestEnabledSettings: jest.fn(),
2525
usePaymentRequestLocations: jest.fn(),
26-
usePaymentRequestButtonType: jest.fn().mockReturnValue( [ 'buy' ] ),
26+
usePaymentRequestButtonType: jest.fn().mockReturnValue( [ 'default' ] ),
2727
usePaymentRequestButtonBorderRadius: jest.fn().mockReturnValue( [ 4 ] ),
2828
usePaymentRequestButtonSize: jest.fn().mockReturnValue( [ 'small' ] ),
2929
usePaymentRequestButtonTheme: jest.fn().mockReturnValue( [ 'dark' ] ),
@@ -148,7 +148,7 @@ describe( 'PaymentRequestSettings', () => {
148148
screen.getByRole( 'combobox', {
149149
name: 'Call to action',
150150
} )
151-
).toHaveValue( 'buy' );
151+
).toHaveValue( 'default' );
152152
expect( screen.getByLabelText( 'Small (40 px)' ) ).toBeChecked();
153153
expect( screen.getByLabelText( /Dark/ ) ).toBeChecked();
154154
} );
@@ -189,7 +189,7 @@ describe( 'PaymentRequestSettings', () => {
189189
const setButtonThemeMock = jest.fn();
190190

191191
usePaymentRequestButtonType.mockReturnValue( [
192-
'buy',
192+
'default',
193193
setButtonTypeMock,
194194
] );
195195
usePaymentRequestButtonSize.mockReturnValue( [

client/settings/express-checkout-settings/test/woopay-settings.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe( 'WooPaySettings', () => {
9393
);
9494

9595
usePaymentRequestButtonType.mockReturnValue(
96-
getMockPaymentRequestButtonType( [ 'buy' ], jest.fn() )
96+
getMockPaymentRequestButtonType( [ 'default' ], jest.fn() )
9797
);
9898

9999
usePaymentRequestButtonSize.mockReturnValue(

client/tokenized-payment-request/test/payment-request.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe( 'WooPaymentsPaymentRequest', () => {
7171
currency_code: 'usd',
7272
},
7373
total_label: 'wcpay.test (via WooCommerce)',
74-
button: { type: 'buy', theme: 'dark', height: '48' },
74+
button: { type: 'default', theme: 'dark', height: '48' },
7575
};
7676
wcpayApi = {
7777
getStripe: () => ( {

includes/class-wc-payment-gateway-wcpay.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ public function __construct(
401401
'title' => __( 'Button type', 'woocommerce-payments' ),
402402
'type' => 'select',
403403
'description' => __( 'Select the button type you would like to show.', 'woocommerce-payments' ),
404-
'default' => 'buy',
404+
'default' => 'default',
405405
'desc_tip' => true,
406406
'options' => [
407407
'default' => __( 'Only icon', 'woocommerce-payments' ),

tests/unit/admin/test-class-wc-rest-payments-settings-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ public function test_update_settings_saves_payment_request_button_size() {
550550
}
551551

552552
public function test_update_settings_saves_payment_request_button_type() {
553-
$this->assertEquals( 'buy', $this->gateway->get_option( 'payment_request_button_type' ) );
553+
$this->assertEquals( 'default', $this->gateway->get_option( 'payment_request_button_type' ) );
554554

555555
$request = new WP_REST_Request();
556556
$request->set_param( 'payment_request_button_type', 'book' );

tests/unit/test-class-wc-payments-express-checkout-button-helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private function make_wcpay_gateway() {
190190
public function test_common_get_button_settings() {
191191
$this->assertEquals(
192192
[
193-
'type' => 'buy',
193+
'type' => 'default',
194194
'theme' => 'dark',
195195
'height' => '48',
196196
'radius' => '',

tests/unit/test-class-wc-payments-payment-request-button-handler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,11 @@ public function test_get_button_settings() {
802802

803803
$this->assertEquals(
804804
[
805-
'type' => 'buy',
805+
'type' => 'default',
806806
'theme' => 'dark',
807807
'height' => '48',
808808
'locale' => 'en',
809-
'branded_type' => 'long',
809+
'branded_type' => 'short',
810810
'radius' => '',
811811
],
812812
$this->pr->get_button_settings()

0 commit comments

Comments
 (0)