mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Check for venmo and vaulting for block pages
This commit is contained in:
parent
e95faf565f
commit
aacbb3b3ec
1 changed files with 8 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue