mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
✨ Draft a paylater messaging data service
This commit is contained in:
parent
3fb710f174
commit
1c25075ea4
1 changed files with 22 additions and 0 deletions
|
@ -40,6 +40,9 @@ use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
|||
use WooCommerce\PayPalCommerce\Settings\Service\DataSanitizer;
|
||||
use WooCommerce\PayPalCommerce\Settings\Service\SettingsDataManager;
|
||||
use WooCommerce\PayPalCommerce\Settings\Data\Definition\PaymentMethodsDefinition;
|
||||
use WooCommerce\PayPalCommerce\PayLaterConfigurator\Factory\ConfigFactory;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
|
||||
use WooCommerce\PayPalCommerce\PayLaterConfigurator\Endpoint\SaveConfig;
|
||||
|
||||
return array(
|
||||
'settings.url' => static function ( ContainerInterface $container ) : string {
|
||||
|
@ -93,6 +96,25 @@ return array(
|
|||
$container->get( 'settings.service.sanitizer' )
|
||||
);
|
||||
},
|
||||
'settings.data.paylater-messaging' => static function ( ContainerInterface $container ) : array {
|
||||
// TODO: Create an AbstractDataModel wrapper for this configuration!
|
||||
|
||||
$config_factors = $container->get( 'paylater-configurator.factory.config' );
|
||||
assert( $config_factors instanceof ConfigFactory );
|
||||
|
||||
$save_config = $container->get( 'paylater-configurator.endpoint.save-config' );
|
||||
assert( $save_config instanceof SaveConfig );
|
||||
|
||||
$settings = $container->get( 'wcgateway.settings' );
|
||||
assert( $settings instanceof Settings );
|
||||
|
||||
$pay_later_config = $config_factors->from_settings( $settings );
|
||||
|
||||
return array(
|
||||
'read' => $pay_later_config,
|
||||
'save' => $save_config,
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Checks if valid merchant connection details are stored in the DB.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue