mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
Add ApplePay validation file display conditions
This commit is contained in:
parent
37104d1646
commit
4de7191d7c
1 changed files with 11 additions and 6 deletions
|
@ -84,11 +84,12 @@ class ApplepayModule implements ModuleInterface {
|
|||
return;
|
||||
}
|
||||
|
||||
$module->load_assets( $c, $apple_payment_method );
|
||||
$module->handle_validation_file( $c );
|
||||
$module->render_buttons( $c, $apple_payment_method );
|
||||
|
||||
$apple_payment_method->bootstrap_ajax_request();
|
||||
if ( $apple_payment_method->is_enabled() ) {
|
||||
$module->load_assets( $c, $apple_payment_method );
|
||||
$module->handle_validation_file( $c, $apple_payment_method );
|
||||
$module->render_buttons( $c, $apple_payment_method );
|
||||
$apple_payment_method->bootstrap_ajax_request();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -214,9 +215,13 @@ class ApplepayModule implements ModuleInterface {
|
|||
* Handles the validation file.
|
||||
*
|
||||
* @param ContainerInterface $c The container.
|
||||
* @param ApplePayButton $button The button.
|
||||
* @return void
|
||||
*/
|
||||
public function handle_validation_file( ContainerInterface $c ): void {
|
||||
public function handle_validation_file( ContainerInterface $c, ApplePayButton $button ): void {
|
||||
if ( ! $button->is_enabled() ) {
|
||||
return;
|
||||
}
|
||||
$env = $c->get( 'onboarding.environment' );
|
||||
assert( $env instanceof Environment );
|
||||
$is_sandobx = $env->current_environment_is( Environment::SANDBOX );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue