mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-28 03:09:16 +08:00
Some checks are pending
CI / PHP 7.4 (push) Waiting to run
CI / PHP 8.0 (push) Waiting to run
CI / PHP 8.1 (push) Waiting to run
CI / PHP 8.2 (push) Waiting to run
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run
PR Playground Demo / prepare_version (push) Waiting to run
PR Playground Demo / build_plugin (push) Blocked by required conditions
PR Playground Demo / create_archive (push) Blocked by required conditions
PR Playground Demo / Comment on PR with Playground details (push) Blocked by required conditions
47 lines
1.8 KiB
PHP
47 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare( strict_types = 1 );
|
|
|
|
namespace WooCommerce\PayPalCommerce\FraudProtection;
|
|
|
|
use WooCommerce\PayPalCommerce\FraudProtection\Recaptcha\Recaptcha;
|
|
use WooCommerce\PayPalCommerce\FraudProtection\Recaptcha\RecaptchaIntegration;
|
|
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
|
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CardButtonGateway;
|
|
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
|
|
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
|
|
|
|
return array(
|
|
'fraud-protection.url' => static function ( ContainerInterface $container ): string {
|
|
return plugins_url( '/modules/ppcp-fraud-protection/', $container->get( 'ppcp.path-to-plugin-main-file' ) );
|
|
},
|
|
|
|
'fraud-protection.recaptcha' => static function ( ContainerInterface $container ): Recaptcha {
|
|
return new Recaptcha(
|
|
$container->get( 'fraud-protection.recaptcha.integration' ),
|
|
$container->get( 'fraud-protection.recaptcha.payment-methods' ),
|
|
$container->get( 'fraud-protection.url' ),
|
|
$container->get( 'ppcp.asset-version' ),
|
|
$container->get( 'woocommerce.logger.woocommerce' ),
|
|
$container->get( 'fraud-protection.recaptcha.rejection-counter' )
|
|
);
|
|
},
|
|
'fraud-protection.recaptcha.integration' => static function (): RecaptchaIntegration {
|
|
return new RecaptchaIntegration();
|
|
},
|
|
'fraud-protection.recaptcha.payment-methods' => static function (): array {
|
|
return apply_filters(
|
|
'woocommerce_paypal_payments_recaptcha_payment_methods',
|
|
array(
|
|
PayPalGateway::ID,
|
|
CreditCardGateway::ID,
|
|
CardButtonGateway::ID,
|
|
)
|
|
);
|
|
},
|
|
'fraud-protection.recaptcha.rejection-counter' => static function ( ContainerInterface $container ): PersistentCounter {
|
|
return new PersistentCounter(
|
|
Recaptcha::REJECTION_COUNTER_OPTION
|
|
);
|
|
},
|
|
);
|