2024-11-11 14:02:49 +01:00
import { _ _ } from '@wordpress/i18n' ;
import SettingsBlock , {
SETTINGS _BLOCK _STYLING _TYPE _PRIMARY ,
2024-11-12 10:12:31 +01:00
SETTINGS _BLOCK _STYLING _TYPE _SECONDARY ,
SETTINGS _BLOCK _TYPE _SELECT ,
2024-11-11 14:02:49 +01:00
SETTINGS _BLOCK _TYPE _TOGGLE _CONTENT ,
} from '../../../ReusableComponents/SettingsBlock' ;
import SettingsCard from '../../../ReusableComponents/SettingsCard' ;
import Sandbox from './Blocks/Sandbox' ;
import Troubleshooting from './Blocks/Troubleshooting' ;
import PaypalSettings from './Blocks/PaypalSettings' ;
const ExpertSettings = ( { updateFormValue , settings } ) => {
return (
< SettingsCard
icon = "icon-settings-expert.svg"
className = "ppcp-r-settings-card ppcp-r-settings-card--expert-settings"
title = { _ _ ( 'Expert Settings' , 'woocommerce-paypal-payments' ) }
description = { _ _ (
'Fine-tune your PayPal experience with advanced options.' ,
'woocommerce-paypal-payments'
) }
actionProps = { {
callback : updateFormValue ,
key : 'payNowExperience' ,
} }
>
< Sandbox
updateFormValue = { updateFormValue }
settings = { settings }
/ >
< Troubleshooting
updateFormValue = { updateFormValue }
settings = { settings }
/ >
< PaypalSettings
updateFormValue = { updateFormValue }
settings = { settings }
/ >
< SettingsBlock
title = { _ _ (
'Other payment method settings' ,
'woocommerce-paypal-payments'
) }
description = { _ _ (
'Modify the checkout experience for alternative payment methods, credit cards, and digital wallets' ,
'woocommerce-paypal-payments'
) }
style = { SETTINGS _BLOCK _STYLING _TYPE _PRIMARY }
actionProps = { {
type : SETTINGS _BLOCK _TYPE _TOGGLE _CONTENT ,
} }
2024-11-12 10:12:31 +01:00
>
< SettingsBlock
title = { _ _ (
'Disable specific credit cards' ,
'woocommerce-paypal-payments'
) }
description = { _ _ (
'If left blank, PayPal and other buttons will present in the user’ s detected language. Enter a language here to force all buttons to display in that language.' ,
'woocommerce-paypal-payments'
) }
style = { SETTINGS _BLOCK _STYLING _TYPE _SECONDARY }
actionProps = { {
type : SETTINGS _BLOCK _TYPE _SELECT ,
options : creditCardExamples ,
value : settings . buttonLanguage ,
callback : updateFormValue ,
key : 'buttonLanguage' ,
} }
/ >
< / S e t t i n g s B l o c k >
2024-11-11 14:02:49 +01:00
< / S e t t i n g s C a r d >
) ;
} ;
2024-11-12 10:12:31 +01:00
const creditCardExamples = [
{ value : '' , label : _ _ ( 'Select' , 'woocommerce-paypal-payments' ) } ,
{
value : 'mastercard' ,
label : _ _ ( 'Mastercard' , 'woocommerce-paypal-payments' ) ,
} ,
{ value : 'visa' , label : _ _ ( 'Visa' , 'woocommerce-paypal-payments' ) } ,
{
value : 'amex' ,
label : _ _ ( 'American Express' , 'woocommerce-paypal-payments' ) ,
} ,
{ value : 'jcb' , label : _ _ ( 'JCB' , 'woocommerce-paypal-payments' ) } ,
{
value : 'diners-club' ,
label : _ _ ( 'Diners Club' , 'woocommerce-paypal-payments' ) ,
} ,
] ;
2024-11-11 14:02:49 +01:00
export default ExpertSettings ;