mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
♻️ Extract code into separate components
This commit is contained in:
parent
90cce3b19b
commit
17f5b9dd85
2 changed files with 7 additions and 106 deletions
|
@ -3,6 +3,7 @@ import { __ } from '@wordpress/i18n';
|
|||
import BadgeBox from '../../../ReusableComponents/BadgeBox';
|
||||
import { Separator } from '../../../ReusableComponents/Elements';
|
||||
import PricingTitleBadge from '../../../ReusableComponents/PricingTitleBadge';
|
||||
import { CardFields } from './PaymentOptions';
|
||||
|
||||
const AcdcOptionalPaymentMethods = ( {
|
||||
isFastlane,
|
||||
|
@ -12,26 +13,7 @@ const AcdcOptionalPaymentMethods = ( {
|
|||
if ( isFastlane && isPayLater && storeCountry === 'US' ) {
|
||||
return (
|
||||
<div className="ppcp-r-optional-payment-methods__wrapper">
|
||||
<BadgeBox
|
||||
title={ __(
|
||||
'Custom Card Fields',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
imageBadge={ [
|
||||
'icon-button-visa.svg',
|
||||
'icon-button-mastercard.svg',
|
||||
'icon-button-amex.svg',
|
||||
'icon-button-discover.svg',
|
||||
] }
|
||||
textBadge={ <PricingTitleBadge item="ccf" /> }
|
||||
description={ __(
|
||||
'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection.',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
learnMoreLink={
|
||||
'https://www.paypal.com/us/business/paypal-business-fees'
|
||||
}
|
||||
/>
|
||||
<CardFields />
|
||||
<Separator className="ppcp-r-optional-payment-methods__separator" />
|
||||
<BadgeBox
|
||||
title={ __(
|
||||
|
@ -93,26 +75,7 @@ const AcdcOptionalPaymentMethods = ( {
|
|||
if ( isPayLater && storeCountry === 'uk' ) {
|
||||
return (
|
||||
<div className="ppcp-r-optional-payment-methods__wrapper">
|
||||
<BadgeBox
|
||||
title={ __(
|
||||
'Custom Card Fields',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
imageBadge={ [
|
||||
'icon-button-visa.svg',
|
||||
'icon-button-mastercard.svg',
|
||||
'icon-button-amex.svg',
|
||||
'icon-button-discover.svg',
|
||||
] }
|
||||
textBadge={ <PricingTitleBadge item="ccf" /> }
|
||||
description={ __(
|
||||
'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection.',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
learnMoreLink={
|
||||
'https://www.paypal.com/us/business/paypal-business-fees'
|
||||
}
|
||||
/>
|
||||
<CardFields />
|
||||
<Separator className="ppcp-r-optional-payment-methods__separator" />
|
||||
<BadgeBox
|
||||
title={ __(
|
||||
|
@ -159,26 +122,7 @@ const AcdcOptionalPaymentMethods = ( {
|
|||
|
||||
return (
|
||||
<div className="ppcp-r-optional-payment-methods__wrapper">
|
||||
<BadgeBox
|
||||
title={ __(
|
||||
'Custom Card Fields',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
imageBadge={ [
|
||||
'icon-button-visa.svg',
|
||||
'icon-button-mastercard.svg',
|
||||
'icon-button-amex.svg',
|
||||
'icon-button-discover.svg',
|
||||
] }
|
||||
textBadge={ <PricingTitleBadge item="ccf" /> }
|
||||
description={ __(
|
||||
'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection.',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
learnMoreLink={
|
||||
'https://www.paypal.com/us/business/paypal-business-fees'
|
||||
}
|
||||
/>
|
||||
<CardFields />
|
||||
<Separator className="ppcp-r-optional-payment-methods__separator" />
|
||||
<BadgeBox
|
||||
title={ __( 'Digital Wallets', 'woocommerce-paypal-payments' ) }
|
||||
|
|
|
@ -1,60 +1,17 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
import BadgeBox from '../../../ReusableComponents/BadgeBox';
|
||||
import PricingTitleBadge from '../../../ReusableComponents/PricingTitleBadge';
|
||||
import { CreditDebitCards } from './PaymentOptions';
|
||||
|
||||
const BcdcOptionalPaymentMethods = ( { isPayLater, storeCountry } ) => {
|
||||
if ( isPayLater && storeCountry === 'us' ) {
|
||||
return (
|
||||
<div className="ppcp-r-optional-payment-methods__wrapper">
|
||||
<BadgeBox
|
||||
title={ __(
|
||||
'Credit and Debit Cards',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
imageBadge={ [
|
||||
'icon-button-visa.svg',
|
||||
'icon-button-mastercard.svg',
|
||||
'icon-button-amex.svg',
|
||||
'icon-button-discover.svg',
|
||||
] }
|
||||
textBadge={
|
||||
<PricingTitleBadge item="standardCardFields" />
|
||||
}
|
||||
description={ __(
|
||||
'Process major credit and debit cards through PayPal’s card fields.',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
learnMoreLink={
|
||||
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
|
||||
}
|
||||
/>
|
||||
<CreditDebitCards />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="ppcp-r-optional-payment-methods__wrapper">
|
||||
<BadgeBox
|
||||
title={ __(
|
||||
'Credit and Debit Cards',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
imageBadge={ [
|
||||
'icon-button-visa.svg',
|
||||
'icon-button-mastercard.svg',
|
||||
'icon-button-amex.svg',
|
||||
'icon-button-discover.svg',
|
||||
] }
|
||||
textBadge={ <PricingTitleBadge item="standardCardFields" /> }
|
||||
description={ __(
|
||||
'Process major credit and debit cards through PayPal’s card fields.',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
learnMoreLink={
|
||||
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
|
||||
}
|
||||
/>
|
||||
<CreditDebitCards />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue