mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
17 lines
431 B
JavaScript
17 lines
431 B
JavaScript
|
/**
|
||
|
* @param {Object} scriptData
|
||
|
* @returns {Boolean}
|
||
|
*/
|
||
|
export const isPayPalSubscription = (scriptData) => {
|
||
|
return scriptData.data_client_id.has_subscriptions
|
||
|
&& scriptData.data_client_id.paypal_subscriptions_enabled;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param {Object} scriptData
|
||
|
* @returns {Boolean}
|
||
|
*/
|
||
|
export const cartHasSubscriptionProducts = (scriptData) => {
|
||
|
return !! scriptData?.locations_with_subscription_product?.cart;
|
||
|
}
|