PluginProbe ʕ •ᴥ•ʔ
WooCommerce PayPal Payments / 3.3.2
WooCommerce PayPal Payments v3.3.2
4.0.4 4.0.3 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1.0 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.4.0 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.7.0 1.7.1 1.8.0 1.8.1 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.4.0 2.4.1 2.4.2 2.4.3 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.6.0 2.6.1 2.7.0 2.7.1 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 4.0.0 4.0.1 4.0.2
woocommerce-paypal-payments / modules / ppcp-save-payment-methods / services.php
woocommerce-paypal-payments / modules / ppcp-save-payment-methods Last commit date
assets 7 months ago src 7 months ago extensions.php 1 year ago module.php 1 year ago services.php 9 months ago
services.php
55 lines
1 <?php
2
3 /**
4 * The save payment methods module services.
5 *
6 * @package WooCommerce\PayPalCommerce\SavePaymentMethods
7 */
8 declare (strict_types=1);
9 namespace WooCommerce\PayPalCommerce\SavePaymentMethods;
10
11 use WooCommerce\PayPalCommerce\SavePaymentMethods\Endpoint\CreatePaymentToken;
12 use WooCommerce\PayPalCommerce\SavePaymentMethods\Endpoint\CreateSetupToken;
13 use WooCommerce\PayPalCommerce\SavePaymentMethods\Endpoint\CreatePaymentTokenForGuest;
14 use WooCommerce\PayPalCommerce\SavePaymentMethods\Helper\SavePaymentMethodsApplies;
15 use WooCommerce\PayPalCommerce\SavePaymentMethods\Service\PaymentMethodTokensChecker;
16 use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
17 return array(
18 // @deprecated - use `save-payment-methods.eligibility.check` instead.
19 'save-payment-methods.eligible' => static function (ContainerInterface $container): bool {
20 $eligibility_check = $container->get('save-payment-methods.eligibility.check');
21 return $eligibility_check();
22 },
23 'save-payment-methods.eligibility.check' => static function (ContainerInterface $container): callable {
24 $save_payment_methods_applies = $container->get('save-payment-methods.helpers.save-payment-methods-applies');
25 assert($save_payment_methods_applies instanceof SavePaymentMethodsApplies);
26 return static function () use ($save_payment_methods_applies): bool {
27 return $save_payment_methods_applies->for_country() && $save_payment_methods_applies->for_merchant();
28 };
29 },
30 'save-payment-methods.helpers.save-payment-methods-applies' => static function (ContainerInterface $container): SavePaymentMethodsApplies {
31 return new SavePaymentMethodsApplies($container->get('save-payment-methods.supported-countries'), $container->get('api.shop.country'));
32 },
33 'save-payment-methods.supported-countries' => static function (ContainerInterface $container): array {
34 if (has_filter('woocommerce_paypal_payments_save_payment_methods_supported_country_currency_matrix')) {
35 _deprecated_hook('woocommerce_paypal_payments_save_payment_methods_supported_country_currency_matrix', '3.0.0', 'woocommerce_paypal_payments_save_payment_methods_supported_countries', esc_attr__('Please use the new Hook to filter countries for saved payments in PayPal Payments.', 'woocommerce-paypal-payments'));
36 }
37 return apply_filters('woocommerce_paypal_payments_save_payment_methods_supported_countries', array('AU', 'AT', 'BE', 'BG', 'CA', 'CN', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'HK', 'HU', 'IE', 'IT', 'LV', 'LI', 'LT', 'LU', 'MT', 'NO', 'NL', 'PL', 'PT', 'RO', 'SG', 'SK', 'SI', 'ES', 'SE', 'GB', 'US', 'YT', 'RE', 'GP', 'GF', 'MQ'));
38 },
39 'save-payment-methods.module.url' => static function (ContainerInterface $container): string {
40 return plugins_url('/modules/ppcp-save-payment-methods/', $container->get('ppcp.path-to-plugin-main-file'));
41 },
42 'save-payment-methods.endpoint.create-setup-token' => static function (ContainerInterface $container): CreateSetupToken {
43 return new CreateSetupToken($container->get('button.request-data'), $container->get('api.endpoint.payment-method-tokens'));
44 },
45 'save-payment-methods.endpoint.create-payment-token' => static function (ContainerInterface $container): CreatePaymentToken {
46 return new CreatePaymentToken($container->get('button.request-data'), $container->get('api.endpoint.payment-method-tokens'), $container->get('vaulting.wc-payment-tokens'));
47 },
48 'save-payment-methods.endpoint.create-payment-token-for-guest' => static function (ContainerInterface $container): CreatePaymentTokenForGuest {
49 return new CreatePaymentTokenForGuest($container->get('button.request-data'), $container->get('api.endpoint.payment-method-tokens'));
50 },
51 'save-payment-methods.service.payment-method-tokens-checker' => static function (ContainerInterface $container): PaymentMethodTokensChecker {
52 return new PaymentMethodTokensChecker($container->get('api.endpoint.payment-tokens'));
53 },
54 );
55