Skip to content

Commit

Permalink
rename old gateway to deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Dec 19, 2024
1 parent 6c9277d commit 9cc28e0
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Gateway/inc/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Dhii\Services\Factory;
use Inpsyde\PaymentGateway\PaymentRequestValidatorInterface;
use Inpsyde\PaymentGateway\RefundProcessorInterface;
use Mollie\WooCommerce\Gateway\OldGatewayBuilder;
use Mollie\WooCommerce\Gateway\DeprecatedGatewayBuilder;
use Mollie\WooCommerce\Gateway\OrderMandatoryGatewayDisabler;
use Mollie\WooCommerce\Gateway\Refund\RefundProcessor;
use Mollie\WooCommerce\Gateway\Surcharge;
Expand Down Expand Up @@ -37,7 +37,7 @@
return SharedDataDictionary::GATEWAY_CLASSNAMES;
},
'__deprecated.gateway_helpers' => static function (ContainerInterface $container): array {
$oldGatewayBuilder = new OldGatewayBuilder();
$oldGatewayBuilder = new DeprecatedGatewayBuilder();
return $oldGatewayBuilder->instantiatePaymentMethodGateways($container);
},
'gateway.paymentMethods' => static function (ContainerInterface $container): array {
Expand Down Expand Up @@ -210,11 +210,6 @@
return $paymentMethods[$methodId];
};
},
'payment_gateway.getOldGatewayInstances' => static function (ContainerInterface $container): callable {
return static function () use ($container): array {
return $container->get('__deprecated.gateway_helpers');
};
},
'gateway.subscriptionHooks' => static function (): array {
return [
'subscriptions',
Expand Down Expand Up @@ -243,9 +238,9 @@
};
$dynamicServices["payment_gateway.$gatewayId.payment_processor"] = static function (ContainerInterface $container) use ($gatewayId): PaymentService {
$oldGatewayInstances = $container->get('__deprecated.gateway_helpers');
$gateway = $oldGatewayInstances[$gatewayId];
$deprecatedGatewayHelper = $oldGatewayInstances[$gatewayId];
$paymentService = $container->get(PaymentService::class);
$paymentService->setGateway($gateway);
$paymentService->setGateway($deprecatedGatewayHelper);
return $paymentService;
};
$dynamicServices["payment_gateway.$gatewayId.refund_processor"] = static function (ContainerInterface $container
Expand Down

0 comments on commit 9cc28e0

Please sign in to comment.