2024-11-11 14:02:49 +01:00
|
|
|
import { useState } from '@wordpress/element';
|
|
|
|
import CommonSettings from './TabSettingsElements/CommonSettings';
|
|
|
|
import ExpertSettings from './TabSettingsElements/ExpertSettings';
|
|
|
|
|
2024-10-25 14:35:16 +02:00
|
|
|
const TabSettings = () => {
|
2024-11-11 14:02:49 +01:00
|
|
|
const [ settings, setSettings ] = useState( {
|
|
|
|
invoicePrefix: '',
|
|
|
|
authorizeOnly: false,
|
|
|
|
captureVirtualOnlyOrders: false,
|
|
|
|
savePaypalAndVenmo: false,
|
|
|
|
saveCreditCardAndDebitCard: false,
|
|
|
|
payNowExperience: false,
|
|
|
|
sandboxAccountCredentials: false,
|
2024-11-13 17:29:11 +01:00
|
|
|
sandboxMode: null,
|
|
|
|
sandboxEnabled: false,
|
|
|
|
sandboxClientId: '',
|
|
|
|
sandboxSecretKey: '',
|
|
|
|
sandboxConnected: false,
|
2024-11-11 14:02:49 +01:00
|
|
|
logging: false,
|
|
|
|
subtotalMismatchFallback: null,
|
|
|
|
brandName: '',
|
|
|
|
softDescriptor: '',
|
|
|
|
paypalLandingPage: null,
|
2024-11-12 10:12:31 +01:00
|
|
|
buttonLanguage: '',
|
2024-11-11 14:02:49 +01:00
|
|
|
} );
|
|
|
|
const updateFormValue = ( key, value ) => {
|
|
|
|
console.log( key, value );
|
|
|
|
setSettings( { ...settings, [ key ]: value } );
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div className="ppcp-r-settings">
|
|
|
|
<CommonSettings
|
|
|
|
settings={ settings }
|
|
|
|
updateFormValue={ updateFormValue }
|
|
|
|
/>
|
|
|
|
<ExpertSettings
|
|
|
|
settings={ settings }
|
|
|
|
updateFormValue={ updateFormValue }
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
);
|
2024-10-25 14:35:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default TabSettings;
|