Skip to content

Commit

Permalink
Add additional status message to ApplePay domain validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrosilva-pt committed Dec 12, 2023
1 parent be28f81 commit c987bc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/ppcp-applepay/extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@

// Domain validation.
$domain_validation_text = __( 'Status: Domain validation failed ❌', 'woocommerce-paypal-payments' );
if ( $container->get( 'applepay.is_validated' ) ) {
if ( ! $container->get( 'applepay.has_validated' ) ) {
$domain_validation_text = __( 'The domain has not yet been validated. Use the Apple Pay button to validate the domain ❌', 'woocommerce-paypal-payments' );
} elseif ( $container->get( 'applepay.is_validated' ) ) {
$domain_validation_text = __( 'Status: Domain successfully validated ✔️', 'woocommerce-paypal-payments' );
}

Expand Down
5 changes: 5 additions & 0 deletions modules/ppcp-applepay/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
);
},

'applepay.has_validated' => static function ( ContainerInterface $container ): bool {
$settings = $container->get( 'wcgateway.settings' );
return $settings->has( 'applepay_validated' );
},

'applepay.is_validated' => static function ( ContainerInterface $container ): bool {
$settings = $container->get( 'wcgateway.settings' );
return $settings->has( 'applepay_validated' ) ? $settings->get( 'applepay_validated' ) === true : false;
Expand Down

0 comments on commit c987bc6

Please sign in to comment.