woocommerce-paypal-payments/modules/ppcp-local-alternative-payment-methods/services.php

111 lines
3.8 KiB
PHP
Raw Normal View History

2024-08-08 12:43:29 +02:00
<?php
/**
* The local alternative payment methods module services.
*
* @package WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods
*/
declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods;
2024-08-08 14:24:47 +02:00
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
2024-08-08 12:43:29 +02:00
2024-08-08 14:24:47 +02:00
return array(
'ppcp-local-apms.url' => static function ( ContainerInterface $container ): string {
/**
* The path cannot be false.
*
* @psalm-suppress PossiblyFalseArgument
*/
return plugins_url(
'/modules/ppcp-local-alternative-payment-methods/',
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
);
},
'ppcp-local-apms.payment-methods' => static function( ContainerInterface $container): array {
return [
'bancontact' => array(
'id' => BancontactGateway::ID,
'country' => 'BE',
'currency' => 'EUR',
),
'blik' => array(
'id' => BlikGateway::ID,
'country' => 'PL',
'currency' => 'PLN',
),
'eps' => array(
'id' => EPSGateway::ID,
'country' => 'AT',
'currency' => 'EUR',
),
2024-08-21 13:04:16 +02:00
'ideal' => array(
'id' => IDealGateway::ID,
'country' => 'NL',
'currency' => 'EUR',
),
];
},
'ppcp-local-apms.bancontact.wc-gateway' => static function ( ContainerInterface $container ): BancontactGateway {
return new BancontactGateway(
$container->get( 'api.endpoint.orders' ),
$container->get( 'api.factory.purchase-unit' ),
$container->get( 'wcgateway.processor.refunds' ),
$container->get( 'wcgateway.transaction-url-provider' )
);
2024-08-08 14:24:47 +02:00
},
2024-08-20 15:00:06 +02:00
'ppcp-local-apms.blik.wc-gateway' => static function ( ContainerInterface $container ): BlikGateway {
return new BlikGateway(
$container->get( 'api.endpoint.orders' ),
$container->get( 'api.factory.purchase-unit' ),
$container->get( 'wcgateway.processor.refunds' ),
$container->get( 'wcgateway.transaction-url-provider' )
);
},
2024-08-20 17:27:03 +02:00
'ppcp-local-apms.eps.wc-gateway' => static function ( ContainerInterface $container ): EPSGateway {
return new EPSGateway(
$container->get( 'api.endpoint.orders' ),
$container->get( 'api.factory.purchase-unit' ),
$container->get( 'wcgateway.processor.refunds' ),
$container->get( 'wcgateway.transaction-url-provider' )
);
},
2024-08-21 13:04:16 +02:00
'ppcp-local-apms.ideal.wc-gateway' => static function ( ContainerInterface $container ): IDealGateway {
return new IDealGateway(
$container->get( 'api.endpoint.orders' ),
$container->get( 'api.factory.purchase-unit' ),
$container->get( 'wcgateway.processor.refunds' ),
$container->get( 'wcgateway.transaction-url-provider' )
);
},
'ppcp-local-apms.bancontact.payment-method' => static function( ContainerInterface $container ): BancontactPaymentMethod {
return new BancontactPaymentMethod(
$container->get( 'ppcp-local-apms.url' ),
$container->get( 'ppcp.asset-version' ),
$container->get( 'ppcp-local-apms.bancontact.wc-gateway' )
);
},
2024-08-20 16:02:35 +02:00
'ppcp-local-apms.blik.payment-method' => static function( ContainerInterface $container ): BlikPaymentMethod {
return new BlikPaymentMethod(
$container->get( 'ppcp-local-apms.url' ),
$container->get( 'ppcp.asset-version' ),
$container->get( 'ppcp-local-apms.blik.wc-gateway' )
);
},
2024-08-20 17:27:03 +02:00
'ppcp-local-apms.eps.payment-method' => static function( ContainerInterface $container ): EPSPaymentMethod {
return new EPSPaymentMethod(
$container->get( 'ppcp-local-apms.url' ),
$container->get( 'ppcp.asset-version' ),
$container->get( 'ppcp-local-apms.eps.wc-gateway' )
);
},
2024-08-21 13:04:16 +02:00
'ppcp-local-apms.ideal.payment-method' => static function( ContainerInterface $container ): IDealPaymentMethod {
return new IDealPaymentMethod(
$container->get( 'ppcp-local-apms.url' ),
$container->get( 'ppcp.asset-version' ),
$container->get( 'ppcp-local-apms.ideal.wc-gateway' )
);
},
2024-08-08 12:43:29 +02:00
);