Check for venmo and vaulting for block pages

This commit is contained in:
Narek Zakarian 2024-05-17 00:25:59 +04:00
parent e95faf565f
commit aacbb3b3ec
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -82,7 +82,7 @@ const PayPalComponent = ({
window.ppcpContinuationFilled = true;
}, [])
const createOrder = async () => {
const createOrder = async (data, actions) => {
try {
const res = await fetch(config.scriptData.ajax.create_order.endpoint, {
method: 'POST',
@ -93,7 +93,8 @@ const PayPalComponent = ({
context: config.scriptData.context,
payment_method: 'ppcp-gateway',
funding_source: window.ppcpFundingSource ?? 'paypal',
createaccount: false
createaccount: false,
payment_source: data.paymentSource
}),
});
@ -296,10 +297,15 @@ const PayPalComponent = ({
onClick();
};
const isVenmoAndVaultingEnabled = () => {
return window.ppcpFundingSource === 'venmo' && config.scriptData.vaultingEnabled;
}
let handleShippingOptionsChange = null;
let handleShippingAddressChange = null;
let handleSubscriptionShippingOptionsChange = null;
let handleSubscriptionShippingAddressChange = null;
if (shippingData.needsShipping && !config.finalReviewEnabled) {
handleShippingOptionsChange = async (data, actions) => {
try {