Sometimes this service returns DisabledSmartButton
This commit is contained in:
Alex P 2023-05-24 09:36:36 +03:00
parent 28e831de0f
commit f1c91d5508
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -11,7 +11,7 @@ namespace WooCommerce\PayPalCommerce\Blocks;
use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry;
use WooCommerce\PayPalCommerce\Blocks\Endpoint\UpdateShippingEndpoint;
use WooCommerce\PayPalCommerce\Button\Assets\SmartButton;
use WooCommerce\PayPalCommerce\Button\Assets\SmartButtonInterface;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\ServiceProvider;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Modular\Module\ModuleInterface;
use WooCommerce\PayPalCommerce\Vendor\Interop\Container\ServiceProviderInterface;
@ -68,7 +68,7 @@ class BlocksModule implements ModuleInterface {
array(
'data_callback' => function() use ( $c ): array {
$smart_button = $c->get( 'button.smart-button' );
assert( $smart_button instanceof SmartButton );
assert( $smart_button instanceof SmartButtonInterface );
if ( isset( $smart_button->script_data()['continuation'] ) ) {
return array( 'ppcp_continuation' );