mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
|
<?php
|
||
|
/**
|
||
|
* The Axo module services.
|
||
|
*
|
||
|
* @package WooCommerce\PayPalCommerce\Axo
|
||
|
*/
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
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.
|
||
|
'axoblock.available' => static function ( ContainerInterface $container ): bool {
|
||
|
return true;
|
||
|
},
|
||
|
'axoblock.url' => static function ( ContainerInterface $container ): string {
|
||
|
/**
|
||
|
* The path cannot be false.
|
||
|
*
|
||
|
* @psalm-suppress PossiblyFalseArgument
|
||
|
*/
|
||
|
return plugins_url(
|
||
|
'/modules/ppcp-axo-block/',
|
||
|
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
|
||
|
);
|
||
|
},
|
||
|
'axoblock.method' => static function( ContainerInterface $container ): AxoBlockPaymentMethod {
|
||
|
return new AxoBlockPaymentMethod(
|
||
|
$container->get( 'axoblock.url' ),
|
||
|
$container->get( 'ppcp.asset-version' ),
|
||
|
$container->get( 'wcgateway.credit-card-gateway' ),
|
||
|
function () use ( $container ): SmartButtonInterface {
|
||
|
return $container->get( 'button.smart-button' );
|
||
|
},
|
||
|
$container->get( 'wcgateway.settings' ),
|
||
|
$container->get( 'onboarding.environment' ),
|
||
|
$container->get( 'wcgateway.url' )
|
||
|
);
|
||
|
},
|
||
|
);
|