2024-09-05 21:17:36 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The Axo module services.
|
|
|
|
*
|
|
|
|
* @package WooCommerce\PayPalCommerce\Axo
|
|
|
|
*/
|
|
|
|
|
2024-09-09 16:00:33 +02:00
|
|
|
declare( strict_types = 1 );
|
2024-09-05 21:17:36 +02:00
|
|
|
|
|
|
|
namespace WooCommerce\PayPalCommerce\AxoBlock;
|
|
|
|
|
|
|
|
use WooCommerce\PayPalCommerce\Button\Assets\SmartButtonInterface;
|
|
|
|
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
|
|
|
|
|
|
|
return array(
|
|
|
|
// If AXO Block is configured and onboarded.
|
2024-09-09 16:00:33 +02:00
|
|
|
'axoblock.available' => static function ( ContainerInterface $container ) : bool {
|
2024-09-05 21:17:36 +02:00
|
|
|
return true;
|
|
|
|
},
|
2024-09-09 16:00:33 +02:00
|
|
|
'axoblock.url' => static function ( ContainerInterface $container ) : string {
|
2024-09-05 21:17:36 +02:00
|
|
|
/**
|
|
|
|
* The path cannot be false.
|
|
|
|
*
|
|
|
|
* @psalm-suppress PossiblyFalseArgument
|
|
|
|
*/
|
|
|
|
return plugins_url(
|
|
|
|
'/modules/ppcp-axo-block/',
|
|
|
|
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
|
|
|
|
);
|
|
|
|
},
|
2024-09-09 16:00:33 +02:00
|
|
|
'axoblock.method' => static function ( ContainerInterface $container ) : AxoBlockPaymentMethod {
|
2024-09-05 21:17:36 +02:00
|
|
|
return new AxoBlockPaymentMethod(
|
2024-11-19 11:23:38 +01:00
|
|
|
$container->get( 'axoblock.url' ),
|
|
|
|
$container->get( 'ppcp.asset-version' ),
|
|
|
|
$container->get( 'axo.gateway' ),
|
|
|
|
fn(): SmartButtonInterface => $container->get( 'button.smart-button' ),
|
|
|
|
$container->get( 'wcgateway.settings' ),
|
|
|
|
$container->get( 'wcgateway.configuration.dcc' ),
|
|
|
|
$container->get( 'onboarding.environment' ),
|
|
|
|
$container->get( 'wcgateway.url' ),
|
|
|
|
$container->get( 'axo.payment_method_selected_map' ),
|
2024-11-27 12:18:28 +01:00
|
|
|
$container->get( 'axo.supported-country-card-type-matrix' )
|
2024-09-05 21:17:36 +02:00
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|