mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
♻️ Apply latest JS structure from ApplePay Gateway
- Partially addresses the known display bug - Simplifies maintainance between both gateways - Reduces component-internal redundancies
This commit is contained in:
parent
8814b1f636
commit
8286085f59
2 changed files with 299 additions and 123 deletions
|
@ -290,6 +290,7 @@ class Button implements ButtonInterface {
|
|||
$render_placeholder,
|
||||
function () {
|
||||
$this->googlepay_button();
|
||||
$this->hide_gateway_until_eligible();
|
||||
},
|
||||
21
|
||||
);
|
||||
|
@ -303,6 +304,7 @@ class Button implements ButtonInterface {
|
|||
$render_placeholder,
|
||||
function () {
|
||||
$this->googlepay_button();
|
||||
$this->hide_gateway_until_eligible();
|
||||
},
|
||||
21
|
||||
);
|
||||
|
@ -335,6 +337,21 @@ class Button implements ButtonInterface {
|
|||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs an inline CSS style that hides the Google Pay gateway (on Classic Checkout).
|
||||
* The style is removed by `GooglepayButton.js` once the eligibility of the payment method
|
||||
* is confirmed.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function hide_gateway_until_eligible() : void {
|
||||
?>
|
||||
<style id="ppcp-hide-google-pay">
|
||||
.wc_payment_method.payment_method_ppcp-googlepay { : none}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueues scripts/styles.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue