🔀 Merge branch 'temp/settings-ui'

This commit is contained in:
Philipp Stracker 2024-12-06 15:24:29 +01:00
commit 8c578fff11
No known key found for this signature in database
13 changed files with 184 additions and 7 deletions

View file

@ -4,12 +4,25 @@ import PaymentMethodItem from '../../ReusableComponents/PaymentMethodItem';
import ModalPayPal from './Modals/ModalPayPal';
import ModalFastlane from './Modals/ModalFastlane';
import ModalAcdc from './Modals/ModalAcdc';
import { CommonHooks } from '../../../data';
const TabPaymentMethods = () => {
const renderPaymentMethods = ( data ) => {
const { storeCountry, storeCurrency } = CommonHooks.useWooSettings();
const conditionallyUpdatedPaymentMethods = [
...data,
...( storeCountry === 'DE' && storeCurrency === 'EUR'
? [ puiPaymentMethod ]
: [] ),
...( storeCountry === 'MX' && storeCurrency === 'MXN'
? [ oxxoPaymentMethod ]
: [] ),
];
return (
<div className="ppcp-r-payment-method-item-list">
{ data.map( ( paymentMethod ) => (
{ conditionallyUpdatedPaymentMethods.map( ( paymentMethod ) => (
<PaymentMethodItem
key={ paymentMethod.id }
{ ...paymentMethod }
@ -173,7 +186,7 @@ const paymentMethodsAlternativeDefault = [
id: 'eps',
title: __( 'eps', 'woocommerce-paypal-payments' ),
description: __(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum porttitor massa ex, eget luctus lacus iaculis at.',
'An online payment method in Austria, enabling Austrian buyers to make secure payments directly through their bank accounts. Transactions are processed in EUR.',
'woocommerce-paypal-payments'
),
icon: 'payment-method-eps',
@ -182,11 +195,67 @@ const paymentMethodsAlternativeDefault = [
id: 'blik',
title: __( 'BLIK', 'woocommerce-paypal-payments' ),
description: __(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum porttitor massa ex, eget luctus lacus iaculis at.',
'A widely used mobile payment method in Poland, allowing Polish customers to pay directly via their banking apps. Transactions are processed in PLN.',
'woocommerce-paypal-payments'
),
icon: 'payment-method-blik',
},
{
id: 'mybank',
title: __( 'MyBank', 'woocommerce-paypal-payments' ),
description: __(
'A European online banking payment solution primarily used in Italy, enabling customers to make secure bank transfers during checkout. Transactions are processed in EUR.',
'woocommerce-paypal-payments'
),
icon: 'payment-method-mybank',
},
{
id: 'przelewy24',
title: __( 'Przelewy24', 'woocommerce-paypal-payments' ),
description: __(
'A popular online payment gateway in Poland, offering various payment options for Polish customers. Transactions can be processed in PLN or EUR.',
'woocommerce-paypal-payments'
),
icon: 'payment-method-przelewy24',
},
{
id: 'trustly',
title: __( 'Trustly', 'woocommerce-paypal-payments' ),
description: __(
'A European payment method that allows buyers to make payments directly from their bank accounts, suitable for customers across multiple European countries. Supported currencies include EUR, DKK, SEK, GBP, and NOK.',
'woocommerce-paypal-payments'
),
icon: 'payment-method-trustly',
},
{
id: 'multibanco',
title: __( 'Multibanco', 'woocommerce-paypal-payments' ),
description: __(
'An online payment method in Portugal, enabling Portuguese buyers to make secure payments directly through their bank accounts. Transactions are processed in EUR.',
'woocommerce-paypal-payments'
),
icon: 'payment-method-multibanco',
},
];
const puiPaymentMethod = {
id: 'pui',
title: __( 'Pay upon Invoice', 'woocommerce-paypal-payments' ),
description: __(
'Pay upon Invoice is an invoice payment method in Germany. It is a local buy now, pay later payment method that allows the buyer to place an order, receive the goods, try them, verify they are in good order, and then pay the invoice within 30 days.',
'woocommerce-paypal-payments'
),
icon: 'payment-method-ratepay',
};
const oxxoPaymentMethod = {
id: 'oxxo',
title: __( 'OXXO', 'woocommerce-paypal-payments' ),
description: __(
'OXXO is a Mexican chain of convenience stores. *Get PayPal account permission to use OXXO payment functionality by contacting us at (+52) 8009250304',
'woocommerce-paypal-payments'
),
icon: 'payment-method-oxxo',
};
export default TabPaymentMethods;

View file

@ -27,7 +27,7 @@ const defaultPersistent = {
completed: false,
step: 0,
isCasualSeller: null, // null value will uncheck both options in the UI.
areOptionalPaymentMethodsEnabled: true,
areOptionalPaymentMethodsEnabled: null,
products: [],
};