mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Merge branch 'trunk' into PCP-3742-disable-gpay-sub
This commit is contained in:
commit
ad07c05cb7
37 changed files with 11765 additions and 301 deletions
|
@ -233,6 +233,15 @@ class SingleProductBootstap {
|
|||
this.form(),
|
||||
this.errorHandler
|
||||
);
|
||||
if (
|
||||
! this.gateway.vaultingEnabled &&
|
||||
[ 'subscription', 'variable-subscription' ].includes(
|
||||
this.gateway.productType
|
||||
) &&
|
||||
this.gateway.manualRenewalEnabled !== '1'
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
PayPalCommerceGateway.data_client_id.has_subscriptions &&
|
||||
|
|
|
@ -1321,8 +1321,26 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
|
|||
'should_handle_shipping_in_paypal' => $this->should_handle_shipping_in_paypal && ! $this->is_checkout(),
|
||||
'needShipping' => $this->need_shipping(),
|
||||
'vaultingEnabled' => $this->settings->has( 'vault_enabled' ) && $this->settings->get( 'vault_enabled' ),
|
||||
'productType' => null,
|
||||
'manualRenewalEnabled' => false,
|
||||
);
|
||||
|
||||
if ( is_product() ) {
|
||||
$product = wc_get_product( get_the_ID() );
|
||||
if ( is_a( $product, \WC_Product::class ) ) {
|
||||
$localize['productType'] = $product->get_type();
|
||||
}
|
||||
}
|
||||
|
||||
if ( class_exists( '\WCS_Manual_Renewal_Manager' ) ) {
|
||||
/**
|
||||
* We verify the existence of the class prior to invoking a static method.
|
||||
*
|
||||
* @psalm-suppress UndefinedClass
|
||||
*/
|
||||
$localize['manualRenewalEnabled'] = \WCS_Manual_Renewal_Manager::is_manual_renewal_enabled();
|
||||
}
|
||||
|
||||
if ( 'pay-now' === $this->context() ) {
|
||||
$localize['pay_now'] = $this->pay_now_script_data();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue