mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
move module.local to module
This commit is contained in:
parent
c443e4053c
commit
f8e82bdfaf
217 changed files with 8 additions and 2 deletions
58
modules/ppcp-webhooks/services.php
Normal file
58
modules/ppcp-webhooks/services.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
/**
|
||||
* The webhook module services.
|
||||
*
|
||||
* @package Inpsyde\PayPalCommerce\Webhooks
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Inpsyde\PayPalCommerce\Webhooks;
|
||||
|
||||
use Inpsyde\PayPalCommerce\Webhooks\Handler\CheckoutOrderApproved;
|
||||
use Inpsyde\PayPalCommerce\Webhooks\Handler\CheckoutOrderCompleted;
|
||||
use Inpsyde\PayPalCommerce\Webhooks\Handler\PaymentCaptureCompleted;
|
||||
use Inpsyde\PayPalCommerce\Webhooks\Handler\PaymentCaptureRefunded;
|
||||
use Inpsyde\PayPalCommerce\Webhooks\Handler\PaymentCaptureReversed;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
return array(
|
||||
|
||||
'webhook.registrar' => function( ContainerInterface $container ) : WebhookRegistrar {
|
||||
$factory = $container->get( 'api.factory.webhook' );
|
||||
$endpoint = $container->get( 'api.endpoint.webhook' );
|
||||
$rest_endpoint = $container->get( 'webhook.endpoint.controller' );
|
||||
return new WebhookRegistrar(
|
||||
$factory,
|
||||
$endpoint,
|
||||
$rest_endpoint
|
||||
);
|
||||
},
|
||||
'webhook.endpoint.controller' => function( ContainerInterface $container ) : IncomingWebhookEndpoint {
|
||||
$webhook_endpoint = $container->get( 'api.endpoint.webhook' );
|
||||
$webhook_factory = $container->get( 'api.factory.webhook' );
|
||||
$handler = $container->get( 'webhook.endpoint.handler' );
|
||||
$logger = $container->get( 'woocommerce.logger.woocommerce' );
|
||||
$verify_request = ! defined( 'PAYPAL_WEBHOOK_REQUEST_VERIFICATION' ) || PAYPAL_WEBHOOK_REQUEST_VERIFICATION;
|
||||
|
||||
return new IncomingWebhookEndpoint(
|
||||
$webhook_endpoint,
|
||||
$webhook_factory,
|
||||
$logger,
|
||||
$verify_request,
|
||||
... $handler
|
||||
);
|
||||
},
|
||||
'webhook.endpoint.handler' => function( ContainerInterface $container ) : array {
|
||||
$logger = $container->get( 'woocommerce.logger.woocommerce' );
|
||||
$prefix = $container->get( 'api.prefix' );
|
||||
$order_endpoint = $container->get( 'api.endpoint.order' );
|
||||
return array(
|
||||
new CheckoutOrderApproved( $logger, $prefix, $order_endpoint ),
|
||||
new CheckoutOrderCompleted( $logger, $prefix ),
|
||||
new PaymentCaptureRefunded( $logger, $prefix ),
|
||||
new PaymentCaptureReversed( $logger, $prefix ),
|
||||
new PaymentCaptureCompleted( $logger, $prefix ),
|
||||
);
|
||||
},
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue