Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
optometrists
/
cache
/
cache
/
cache
/
cache
/
cache
/
cache
/
cache
/
.wp-cli
/
wp-content
/
plugins
/
woocommerce
/
packages
/
woocommerce-blocks
/
assets
/
js
/
blocks
/
cart-checkout
/
checkout
/
form
:
payment-method-step.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { FormStep } from '@woocommerce/base-components/cart-checkout'; import { useCheckoutContext, StoreNoticesProvider, } from '@woocommerce/base-context'; import { useStoreCart, useEmitResponse, usePaymentMethods, } from '@woocommerce/base-context/hooks'; /** * Internal dependencies */ import { PaymentMethods } from '../../payment-methods'; const PaymentMethodStep = () => { const { isProcessing: checkoutIsProcessing } = useCheckoutContext(); const { cartNeedsPayment } = useStoreCart(); const { paymentMethods } = usePaymentMethods(); const { noticeContexts } = useEmitResponse(); if ( ! cartNeedsPayment ) { return null; } return ( <FormStep id="payment-method" disabled={ checkoutIsProcessing } className="wc-block-checkout__payment-method" title={ __( 'Payment method', 'woocommerce' ) } description={ Object.keys( paymentMethods ).length > 1 ? __( 'Select a payment method below.', 'woocommerce' ) : '' } > <StoreNoticesProvider context={ noticeContexts.PAYMENTS }> <PaymentMethods /> </StoreNoticesProvider> </FormStep> ); }; export default PaymentMethodStep;