mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Create countryPriceInfo
util
This commit is contained in:
parent
d768c4e24f
commit
db8a6cccd2
6 changed files with 6 additions and 95 deletions
|
@ -2,13 +2,13 @@ import BadgeBox, { BADGE_BOX_TITLE_BIG } from '../BadgeBox';
|
||||||
import { __, sprintf } from '@wordpress/i18n';
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
import Separator from '../Separator';
|
import Separator from '../Separator';
|
||||||
import generatePriceText from '../../../utils/badgeBoxUtils';
|
import generatePriceText from '../../../utils/badgeBoxUtils';
|
||||||
|
import { countryPriceInfo } from '../../../utils/countryPriceInfo';
|
||||||
|
|
||||||
const AcdcOptionalPaymentMethods = ( {
|
const AcdcOptionalPaymentMethods = ( {
|
||||||
isFastlane,
|
isFastlane,
|
||||||
isPayLater,
|
isPayLater,
|
||||||
storeCountry,
|
storeCountry,
|
||||||
storeCurrency,
|
storeCurrency,
|
||||||
countryPriceInfo,
|
|
||||||
} ) => {
|
} ) => {
|
||||||
if ( isFastlane && isPayLater && storeCountry === 'us' ) {
|
if ( isFastlane && isPayLater && storeCountry === 'us' ) {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import BadgeBox from '../BadgeBox';
|
import BadgeBox from '../BadgeBox';
|
||||||
import { __, sprintf } from '@wordpress/i18n';
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
import generatePriceText from '../../../utils/badgeBoxUtils';
|
import generatePriceText from '../../../utils/badgeBoxUtils';
|
||||||
|
import { countryPriceInfo } from '../../../utils/countryPriceInfo';
|
||||||
|
|
||||||
const BcdcOptionalPaymentMethods = ( {
|
const BcdcOptionalPaymentMethods = ( {
|
||||||
isPayLater,
|
isPayLater,
|
||||||
storeCountry,
|
storeCountry,
|
||||||
storeCurrency,
|
storeCurrency,
|
||||||
countryPriceInfo,
|
|
||||||
} ) => {
|
} ) => {
|
||||||
if ( isPayLater && storeCountry === 'us' ) {
|
if ( isPayLater && storeCountry === 'us' ) {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -7,7 +7,6 @@ const OptionalPaymentMethods = ( {
|
||||||
isPayLater,
|
isPayLater,
|
||||||
storeCountry,
|
storeCountry,
|
||||||
storeCurrency,
|
storeCurrency,
|
||||||
countryPriceInfo,
|
|
||||||
} ) => {
|
} ) => {
|
||||||
return (
|
return (
|
||||||
<div className="ppcp-r-optional-payment-methods">
|
<div className="ppcp-r-optional-payment-methods">
|
||||||
|
@ -17,14 +16,12 @@ const OptionalPaymentMethods = ( {
|
||||||
isPayLater={ isPayLater }
|
isPayLater={ isPayLater }
|
||||||
storeCountry={ storeCountry }
|
storeCountry={ storeCountry }
|
||||||
storeCurrency={ storeCurrency }
|
storeCurrency={ storeCurrency }
|
||||||
countryPriceInfo={ countryPriceInfo }
|
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<BcdcOptionalPaymentMethods
|
<BcdcOptionalPaymentMethods
|
||||||
isPayLater={ isPayLater }
|
isPayLater={ isPayLater }
|
||||||
storeCountry={ storeCountry }
|
storeCountry={ storeCountry }
|
||||||
storeCurrency={ storeCurrency }
|
storeCurrency={ storeCurrency }
|
||||||
countryPriceInfo={ countryPriceInfo }
|
|
||||||
/>
|
/>
|
||||||
) }
|
) }
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,6 +2,8 @@ import BadgeBox, { BADGE_BOX_TITLE_BIG } from '../BadgeBox';
|
||||||
import { __, sprintf } from '@wordpress/i18n';
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
import Separator from '../Separator';
|
import Separator from '../Separator';
|
||||||
import generatePriceText from '../../../utils/badgeBoxUtils';
|
import generatePriceText from '../../../utils/badgeBoxUtils';
|
||||||
|
import { countryPriceInfo } from '../../../utils/countryPriceInfo';
|
||||||
|
|
||||||
import OptionalPaymentMethods from '../OptionalPaymentMethods/OptionalPaymentMethods';
|
import OptionalPaymentMethods from '../OptionalPaymentMethods/OptionalPaymentMethods';
|
||||||
|
|
||||||
const AcdcFlow = ( {
|
const AcdcFlow = ( {
|
||||||
|
@ -9,7 +11,6 @@ const AcdcFlow = ( {
|
||||||
isPayLater,
|
isPayLater,
|
||||||
storeCountry,
|
storeCountry,
|
||||||
storeCurrency,
|
storeCurrency,
|
||||||
countryPriceInfo,
|
|
||||||
} ) => {
|
} ) => {
|
||||||
if ( isFastlane && isPayLater && storeCountry === 'us' ) {
|
if ( isFastlane && isPayLater && storeCountry === 'us' ) {
|
||||||
return (
|
return (
|
||||||
|
@ -116,7 +117,6 @@ const AcdcFlow = ( {
|
||||||
isPayLater={ isPayLater }
|
isPayLater={ isPayLater }
|
||||||
storeCountry={ storeCountry }
|
storeCountry={ storeCountry }
|
||||||
storeCurrency={ storeCurrency }
|
storeCurrency={ storeCurrency }
|
||||||
countryPriceInfo={ countryPriceInfo }
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -202,7 +202,6 @@ const AcdcFlow = ( {
|
||||||
isPayLater={ isPayLater }
|
isPayLater={ isPayLater }
|
||||||
storeCountry={ storeCountry }
|
storeCountry={ storeCountry }
|
||||||
storeCurrency={ storeCurrency }
|
storeCurrency={ storeCurrency }
|
||||||
countryPriceInfo={ countryPriceInfo }
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -282,7 +281,6 @@ const AcdcFlow = ( {
|
||||||
isPayLater={ isPayLater }
|
isPayLater={ isPayLater }
|
||||||
storeCountry={ storeCountry }
|
storeCountry={ storeCountry }
|
||||||
storeCurrency={ storeCurrency }
|
storeCurrency={ storeCurrency }
|
||||||
countryPriceInfo={ countryPriceInfo }
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,14 +2,10 @@ import BadgeBox, { BADGE_BOX_TITLE_BIG } from '../BadgeBox';
|
||||||
import { __, sprintf } from '@wordpress/i18n';
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
import Separator from '../Separator';
|
import Separator from '../Separator';
|
||||||
import generatePriceText from '../../../utils/badgeBoxUtils';
|
import generatePriceText from '../../../utils/badgeBoxUtils';
|
||||||
|
import { countryPriceInfo } from '../../../utils/countryPriceInfo';
|
||||||
import OptionalPaymentMethods from '../OptionalPaymentMethods/OptionalPaymentMethods';
|
import OptionalPaymentMethods from '../OptionalPaymentMethods/OptionalPaymentMethods';
|
||||||
|
|
||||||
const BcdcFlow = ( {
|
const BcdcFlow = ( { isPayLater, storeCountry, storeCurrency } ) => {
|
||||||
isPayLater,
|
|
||||||
storeCountry,
|
|
||||||
storeCurrency,
|
|
||||||
countryPriceInfo,
|
|
||||||
} ) => {
|
|
||||||
if ( isPayLater && storeCountry === 'us' ) {
|
if ( isPayLater && storeCountry === 'us' ) {
|
||||||
return (
|
return (
|
||||||
<div className="ppcp-r-welcome-docs__wrapper">
|
<div className="ppcp-r-welcome-docs__wrapper">
|
||||||
|
@ -115,7 +111,6 @@ const BcdcFlow = ( {
|
||||||
isPayLater={ isPayLater }
|
isPayLater={ isPayLater }
|
||||||
storeCountry={ storeCountry }
|
storeCountry={ storeCountry }
|
||||||
storeCurrency={ storeCurrency }
|
storeCurrency={ storeCurrency }
|
||||||
countryPriceInfo={ countryPriceInfo }
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -187,7 +182,6 @@ const BcdcFlow = ( {
|
||||||
isPayLater={ isPayLater }
|
isPayLater={ isPayLater }
|
||||||
storeCountry={ storeCountry }
|
storeCountry={ storeCountry }
|
||||||
storeCurrency={ storeCurrency }
|
storeCurrency={ storeCurrency }
|
||||||
countryPriceInfo={ countryPriceInfo }
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -19,82 +19,6 @@ const WelcomeDocs = ( {
|
||||||
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
|
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
|
||||||
);
|
);
|
||||||
|
|
||||||
const countryPriceInfo = {
|
|
||||||
us: {
|
|
||||||
currencySymbol: '$',
|
|
||||||
fixedFee: 0.49,
|
|
||||||
checkout: 3.49,
|
|
||||||
ccf: 2.59,
|
|
||||||
dw: 2.59,
|
|
||||||
apm: 2.59,
|
|
||||||
fastlane: 2.59,
|
|
||||||
standardCardFields: 2.99,
|
|
||||||
},
|
|
||||||
uk: {
|
|
||||||
currencySymbol: '£',
|
|
||||||
fixedFee: 0.3,
|
|
||||||
checkout: 2.9,
|
|
||||||
ccf: 1.2,
|
|
||||||
dw: 1.2,
|
|
||||||
apm: 1.2,
|
|
||||||
standardCardFields: 1.2,
|
|
||||||
},
|
|
||||||
ca: {
|
|
||||||
currencySymbol: '$',
|
|
||||||
fixedFee: 0.3,
|
|
||||||
checkout: 2.9,
|
|
||||||
ccf: 2.7,
|
|
||||||
dw: 2.7,
|
|
||||||
apm: 2.9,
|
|
||||||
standardCardFields: 2.9,
|
|
||||||
},
|
|
||||||
au: {
|
|
||||||
currencySymbol: '$',
|
|
||||||
fixedFee: 0.3,
|
|
||||||
checkout: 2.6,
|
|
||||||
ccf: 1.75,
|
|
||||||
dw: 1.75,
|
|
||||||
apm: 2.6,
|
|
||||||
standardCardFields: 2.6,
|
|
||||||
},
|
|
||||||
fr: {
|
|
||||||
currencySymbol: '€',
|
|
||||||
fixedFee: 0.35,
|
|
||||||
checkout: 2.9,
|
|
||||||
ccf: 1.2,
|
|
||||||
dw: 1.2,
|
|
||||||
apm: 1.2,
|
|
||||||
standardCardFields: 1.2,
|
|
||||||
},
|
|
||||||
it: {
|
|
||||||
currencySymbol: '€',
|
|
||||||
fixedFee: 0.35,
|
|
||||||
checkout: 3.4,
|
|
||||||
ccf: 1.2,
|
|
||||||
dw: 1.2,
|
|
||||||
apm: 1.2,
|
|
||||||
standardCardFields: 1.2,
|
|
||||||
},
|
|
||||||
de: {
|
|
||||||
currencySymbol: '€',
|
|
||||||
fixedFee: 0.39,
|
|
||||||
checkout: 2.99,
|
|
||||||
ccf: 2.99,
|
|
||||||
dw: 2.99,
|
|
||||||
apm: 2.99,
|
|
||||||
standardCardFields: 2.99,
|
|
||||||
},
|
|
||||||
es: {
|
|
||||||
currencySymbol: '€',
|
|
||||||
fixedFee: 0.35,
|
|
||||||
checkout: 2.9,
|
|
||||||
ccf: 1.2,
|
|
||||||
dw: 1.2,
|
|
||||||
apm: 1.2,
|
|
||||||
standardCardFields: 1.2,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="ppcp-r-welcome-docs">
|
<div className="ppcp-r-welcome-docs">
|
||||||
<h2 className="ppcp-r-welcome-docs__title">
|
<h2 className="ppcp-r-welcome-docs__title">
|
||||||
|
@ -109,14 +33,12 @@ const WelcomeDocs = ( {
|
||||||
isPayLater={ isPayLater }
|
isPayLater={ isPayLater }
|
||||||
storeCountry={ storeCountry }
|
storeCountry={ storeCountry }
|
||||||
storeCurrency={ storeCurrency }
|
storeCurrency={ storeCurrency }
|
||||||
countryPriceInfo={ countryPriceInfo }
|
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<BcdcFlow
|
<BcdcFlow
|
||||||
isPayLater={ isPayLater }
|
isPayLater={ isPayLater }
|
||||||
storeCountry={ storeCountry }
|
storeCountry={ storeCountry }
|
||||||
storeCurrency={ storeCurrency }
|
storeCurrency={ storeCurrency }
|
||||||
countryPriceInfo={ countryPriceInfo }
|
|
||||||
/>
|
/>
|
||||||
) }
|
) }
|
||||||
<p
|
<p
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue