Revert commit as payment_source is needed for creating the vaulted payment

This commit is contained in:
Emili Castells Guasch 2023-11-27 10:58:49 +01:00
parent 90c364cb60
commit c5a90d8ca3

View file

@ -36,8 +36,6 @@ loadPaypalJsScript(
}
},
onApprove: async ({ vaultSetupToken }) => {
console.log(vaultSetupToken)
const response = await fetch(ppcp_add_payment_method.ajax.create_payment_token.endpoint, {
method: "POST",
credentials: 'same-origin',
@ -60,8 +58,6 @@ loadPaypalJsScript(
`#ppc-button-${PaymentMethods.PAYPAL}-save-payment-method`
);
const init = () => {
setVisibleByClass(ORDER_BUTTON_SELECTOR, getCurrentPaymentMethod() !== PaymentMethods.PAYPAL, 'ppcp-hidden');
setVisible(`#ppc-button-${PaymentMethods.PAYPAL}-save-payment-method`, getCurrentPaymentMethod() === PaymentMethods.PAYPAL);