components/checkout/common/PaymentDetails.js
/**
   * Renders a Stripe Elements form for capturing payment information using Stripe as the gateway
   *
   * @returns {JSX.Element}
   */
Renders a Stripe Elements form for capturing payment information using Stripe as the gateway
@returns {JSX.Element}
Renders a Stripe Elements form for capturing payment information using Stripe as the gateway @returns { JSX . Element }
renderStripe() {
    const { gateways, onChangeGateway, selectedGateway, t } = this.props;
    if (!gateways || !gateways.available['stripe']) {
      return null;
    }
    const cardElementOptions = {
      style: {
        base: {
          fontSize: '16px',
          color: '#424770',
          '::placeholder': {
            color: '#aab7c4',
          },
        },
        invalid: {
          color: '#9e2146',
        },
      }
    }
    return (
      <div className="borderbottom border-color-gray500">
        <label
          onClick={() => onChangeGateway('stripe')}
          className="p-3 d-flex align-items-center cursor-pointer"
        >
          <Radiobox
            checked={selectedGateway === 'stripe'}
            className="mr-3"
          />
          <p className="font-weight-medium">
            {t('checkout.payment.stripe')}
          </p>
        </label>
        { selectedGateway === 'stripe' && (
          <div className="pl-5 pr-3 pb-3 ml-2">
            <CardElement options={cardElementOptions} />
          </div>
        ) }
      </div>
    );
  }
renderStripe ( ) { const { gateways , onChangeGateway , selectedGateway , t } = this . props ; if ( ! gateways || ! gateways . available [ 'stripe' ] ) { return null ; } const cardElementOptions = { style : { base : { fontSize : '16px' , color : '#424770' , '::placeholder' : { color : '#aab7c4' , } , } , invalid : { color : '#9e2146' , } , } } return ( < div className = "borderbottom border-color-gray500" > < label onClick = { ( ) => onChangeGateway ( 'stripe' ) } className = "p-3 d-flex align-items-center cursor-pointer" > < Radiobox checked = { selectedGateway === 'stripe' } className = "mr-3" / > < p className = "font-weight-medium" > { t ( 'checkout.payment.stripe' ) } < / p > < / label > { selectedGateway === 'stripe' && ( < div className = "pl-5 pr-3 pb-3 ml-2" > < CardElement options = { cardElementOptions } / > < / div > ) } < / div > ) ; }
Renders a Stripe Elements form for capturing payment information using Stripe as the gateway
 @returns {JSX.Element}
Renders a Stripe Elements form for capturing payment information using Stripe as the gateway @returns { JSX . Element }