mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Use custom save card payment checkbox and show/hide it based on vaulting setting
This commit is contained in:
parent
13b5338627
commit
880bd48271
6 changed files with 45 additions and 13 deletions
|
@ -14,11 +14,14 @@ export function CardFields({config, eventRegistration, emitResponse}) {
|
|||
const {responseTypes} = emitResponse;
|
||||
|
||||
const [cardFieldsForm, setCardFieldsForm] = useState();
|
||||
|
||||
const getCardFieldsForm = (cardFieldsForm) => {
|
||||
setCardFieldsForm(cardFieldsForm)
|
||||
}
|
||||
|
||||
const getSavePayment = (savePayment) => {
|
||||
localStorage.setItem('ppcp-save-card-payment', savePayment);
|
||||
}
|
||||
|
||||
const wait = (milliseconds) => {
|
||||
return new Promise((resolve) => {
|
||||
console.log('start...')
|
||||
|
@ -65,7 +68,12 @@ export function CardFields({config, eventRegistration, emitResponse}) {
|
|||
}}
|
||||
>
|
||||
<PayPalCardFieldsForm/>
|
||||
<CheckoutHandler getCardFieldsForm={getCardFieldsForm}/>
|
||||
<CheckoutHandler
|
||||
getCardFieldsForm={getCardFieldsForm}
|
||||
getSavePayment={getSavePayment}
|
||||
saveCardText={config.save_card_text}
|
||||
is_vaulting_enabled={config.is_vaulting_enabled}
|
||||
/>
|
||||
</PayPalCardFieldsProvider>
|
||||
</PayPalScriptProvider>
|
||||
</>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue