Save checkout form before free trial redirect

This commit is contained in:
Alex P 2023-01-25 09:42:31 +02:00
parent c8e492ed1e
commit 79f2c9a1fa
No known key found for this signature in database
GPG key ID: 54487A734A204D71
8 changed files with 220 additions and 26 deletions

View file

@ -9,6 +9,8 @@ declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\Button;
use WooCommerce\PayPalCommerce\Button\Endpoint\SaveCheckoutFormEndpoint;
use WooCommerce\PayPalCommerce\Button\Helper\CheckoutFormSaver;
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
use WooCommerce\PayPalCommerce\Button\Assets\DisabledSmartButton;
use WooCommerce\PayPalCommerce\Button\Assets\SmartButton;
@ -181,6 +183,16 @@ return array(
$logger
);
},
'button.checkout-form-saver' => static function ( ContainerInterface $container ): CheckoutFormSaver {
return new CheckoutFormSaver();
},
'button.endpoint.save-checkout-form' => static function ( ContainerInterface $container ): SaveCheckoutFormEndpoint {
return new SaveCheckoutFormEndpoint(
$container->get( 'button.request-data' ),
$container->get( 'button.checkout-form-saver' ),
$container->get( 'woocommerce.logger.woocommerce' )
);
},
'button.endpoint.data-client-id' => static function( ContainerInterface $container ) : DataClientIdEndpoint {
$request_data = $container->get( 'button.request-data' );
$identity_token = $container->get( 'api.endpoint.identity-token' );