mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Display pay upon invoice gateway only if store country is germany
This commit is contained in:
parent
2e9cc0b8af
commit
00de9de57e
1 changed files with 25 additions and 12 deletions
|
@ -206,7 +206,9 @@ class WCGatewayModule implements ModuleInterface {
|
|||
$methods[] = $container->get( 'wcgateway.credit-card-gateway' );
|
||||
}
|
||||
|
||||
$methods[] = $container->get('wcgateway.pay-upon-invoice-gateway');
|
||||
if ( 'DE' === $container->get( 'api.shop.country' ) ) {
|
||||
$methods[] = $container->get( 'wcgateway.pay-upon-invoice-gateway' );
|
||||
}
|
||||
|
||||
return (array) $methods;
|
||||
}
|
||||
|
@ -272,24 +274,35 @@ class WCGatewayModule implements ModuleInterface {
|
|||
}
|
||||
);
|
||||
|
||||
add_action('wp_footer', function () { ?>
|
||||
add_action(
|
||||
'wp_footer',
|
||||
function () use ( $container ) {
|
||||
if ( 'DE' === $container->get( 'api.shop.country' ) ) { ?>
|
||||
<script type="application/json" fncls="fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99">
|
||||
{
|
||||
"f":"d4e0d7b9-4f75-43f9-9437-d8a57c901585",
|
||||
"s":"flowid_provided_to_you"
|
||||
}
|
||||
</script>
|
||||
<?php });
|
||||
<?php
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
add_action('wp_enqueue_scripts', function () use($container) {
|
||||
$gateway_module_url = $container->get('wcgateway.url');
|
||||
wp_enqueue_script(
|
||||
'ppcp-fraudnet',
|
||||
trailingslashit($gateway_module_url) . 'assets/js/fraudnet.js',
|
||||
array(),
|
||||
1
|
||||
);
|
||||
});
|
||||
add_action(
|
||||
'wp_enqueue_scripts',
|
||||
function () use ( $container ) {
|
||||
if ( 'DE' === $container->get( 'api.shop.country' ) ) {
|
||||
$gateway_module_url = $container->get( 'wcgateway.url' );
|
||||
wp_enqueue_script(
|
||||
'ppcp-fraudnet',
|
||||
trailingslashit( $gateway_module_url ) . 'assets/js/fraudnet.js',
|
||||
array(),
|
||||
1
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue