woocommerce/plugins/woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/stripe/index.js

26 lines
659 B
JavaScript

/**
* External dependencies
*/
import {
registerPaymentMethod,
registerExpressPaymentMethod,
} from '@woocommerce/blocks-registry';
/**
* Internal dependencies
*/
import stripeCcPaymentMethod from './credit-card';
import PaymentRequestPaymentMethod from './payment-request';
import { getStripeServerData } from './stripe-utils';
// Register Stripe Credit Card.
registerPaymentMethod( ( Config ) => new Config( stripeCcPaymentMethod ) );
// Register Stripe Payment Request (Apple/Chrome Pay) if enabled.
if ( getStripeServerData().allowPaymentRequest ) {
registerExpressPaymentMethod(
( Config ) => new Config( PaymentRequestPaymentMethod )
);
}