mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Disable Fraudnet checkbox when PUI is enabled
This commit is contained in:
parent
eb4a60e503
commit
ea201a3140
3 changed files with 16 additions and 0 deletions
|
@ -1147,6 +1147,16 @@ return array(
|
|||
|
||||
return false;
|
||||
},
|
||||
'wcgateway.settings.should-disable-fraudnet-checkbox' => static function( ContainerInterface $container ): bool {
|
||||
$pui_helper = $container->get( 'wcgateway.pay-upon-invoice-helper' );
|
||||
assert( $pui_helper instanceof PayUponInvoiceHelper );
|
||||
|
||||
if ( $pui_helper->is_pui_gateway_enabled() ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
'wcgateway.settings.tracking-label' => static function ( ContainerInterface $container ): string {
|
||||
$tracking_label = sprintf(
|
||||
// translators: %1$s and %2$s are the opening and closing of HTML <a> tag.
|
||||
|
|
|
@ -139,6 +139,11 @@ class PayUponInvoice {
|
|||
* @throws NotFoundException When setting is not found.
|
||||
*/
|
||||
public function init(): void {
|
||||
if ( $this->pui_helper->is_pui_gateway_enabled() ) {
|
||||
$this->settings->set( 'fraudnet_enabled', true );
|
||||
$this->settings->persist();
|
||||
}
|
||||
|
||||
add_filter(
|
||||
'ppcp_partner_referrals_data',
|
||||
function ( array $data ): array {
|
||||
|
|
|
@ -411,6 +411,7 @@ return function ( ContainerInterface $container, array $fields ): array {
|
|||
),
|
||||
'requirements' => array(),
|
||||
'gateway' => Settings::CONNECTION_TAB_ID,
|
||||
'input_class' => $container->get( 'wcgateway.settings.should-disable-fraudnet-checkbox' ) ? array( 'ppcp-disabled-checkbox' ) : array(),
|
||||
),
|
||||
|
||||
'credentials_integration_configuration_heading' => array(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue