Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Tweak - Update payment method type check for charge.succeeded webhook.
* Add - Disable unsupported payment methods in Stripe settings
* Update - Update handling of PR as a country in the terminal locations endpoint.
* Fix - Hide Amazon Pay in settings when legacy checkout is enabled.

= 9.3.1 - 2025-03-14 =
* Fix - Temporarily disables the subscriptions detached notice feature due to long loading times on stores with many subscriptions.
Expand Down
14 changes: 14 additions & 0 deletions client/settings/payment-request-section/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import {
PAYMENT_METHOD_CARD,
PAYMENT_METHOD_LINK,
PAYMENT_METHOD_AMAZON_PAY,
} from 'wcstripe/stripe-utils/constants';

jest.mock( 'wcstripe/data', () => ( {
Expand Down Expand Up @@ -37,6 +38,7 @@ describe( 'PaymentRequestSection', () => {
useGetAvailablePaymentMethodIds.mockReturnValue( [
PAYMENT_METHOD_CARD,
PAYMENT_METHOD_LINK,
PAYMENT_METHOD_AMAZON_PAY,
] );
useAmazonPayEnabledSettings.mockReturnValue( [ false, jest.fn() ] );
global.wc_stripe_settings_params = {
Expand Down Expand Up @@ -139,6 +141,18 @@ describe( 'PaymentRequestSection', () => {
expect( screen.queryByText( 'Amazon Pay' ) ).toBeNull();
} );

it( 'hide Amazon Pay if legacy checkout is enabled', () => {
// Amazon Pay is only available as a UPE payment method.
useGetAvailablePaymentMethodIds.mockReturnValue( [
PAYMENT_METHOD_CARD,
] );
useAmazonPayEnabledSettings.mockReturnValue( [ true, jest.fn() ] );

render( <PaymentRequestSection /> );

expect( screen.queryByText( 'Amazon Pay' ) ).toBeNull();
} );

it( 'test Amazon Pay checkbox not checked', () => {
const container = render( <PaymentRequestSection /> );
const amazonPayCheckbox = container.getByRole( 'checkbox', {
Expand Down
4 changes: 3 additions & 1 deletion client/settings/payment-request-section/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import PaymentMethodMissingCurrencyPill from '../../components/payment-method-mi
import {
PAYMENT_METHOD_CARD,
PAYMENT_METHOD_LINK,
PAYMENT_METHOD_AMAZON_PAY,
} from 'wcstripe/stripe-utils/constants';

const PaymentRequestSection = () => {
Expand Down Expand Up @@ -77,7 +78,8 @@ const PaymentRequestSection = () => {
);

const isAmazonPayAvailable =
wc_stripe_settings_params.is_amazon_pay_available; // eslint-disable-line camelcase
wc_stripe_settings_params.is_amazon_pay_available && // eslint-disable-line camelcase
availablePaymentMethodIds.includes( PAYMENT_METHOD_AMAZON_PAY );

return (
<Card className="express-checkouts">
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
* Tweak - Update payment method type check for charge.succeeded webhook.
* Add - Disable unsupported payment methods in Stripe settings
* Update - Update handling of PR as a country in the terminal locations endpoint.
* Fix - Hide Amazon Pay in settings when legacy checkout is enabled.

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