Check and removing GooglePay TODOs

This commit is contained in:
Pedro Silva 2023-09-11 10:11:40 +01:00
parent b703f17bbf
commit 1a93df9f50
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
3 changed files with 4 additions and 9 deletions

View file

@ -162,7 +162,7 @@ class GooglepayButton {
const paymentDataRequest = await this.paymentDataRequest(); const paymentDataRequest = await this.paymentDataRequest();
console.log('[GooglePayButton] onButtonClick: paymentDataRequest', paymentDataRequest, this.context); console.log('[GooglePayButton] onButtonClick: paymentDataRequest', paymentDataRequest, this.context);
window.ppcpFundingSource = 'googlepay'; // TODO : do this on another place like on create order window.ppcpFundingSource = 'googlepay'; // Do this on another place like on create order endpoint handler.
this.paymentsClient.loadPaymentData(paymentDataRequest); this.paymentsClient.loadPaymentData(paymentDataRequest);
} }

View file

@ -105,8 +105,8 @@ class BlocksPaymentMethod extends AbstractPaymentMethodType {
return array( return array(
'id' => $this->name, 'id' => $this->name,
'title' => $paypal_data['title'], // TODO : see if we should use another. 'title' => $paypal_data['title'], // See if we should use another.
'description' => $paypal_data['description'], // TODO : see if we should use another. 'description' => $paypal_data['description'], // See if we should use another.
'enabled' => $paypal_data['enabled'], // This button is enabled when PayPal buttons are. 'enabled' => $paypal_data['enabled'], // This button is enabled when PayPal buttons are.
'scriptData' => $this->button->script_data(), 'scriptData' => $this->button->script_data(),
); );

View file

@ -149,7 +149,6 @@ class Button implements ButtonInterface {
$checked = ''; $checked = '';
} }
// TODO : the input has no name, is it doing anything?
return $options return $options
. '<li><label><input type="checkbox" id="ppcp-onboarding-google" ' . $checked . '> ' . '<li><label><input type="checkbox" id="ppcp-onboarding-google" ' . $checked . '> '
. __( 'Onboard with GooglePay', 'woocommerce-paypal-payments' ) . __( 'Onboard with GooglePay', 'woocommerce-paypal-payments' )
@ -175,7 +174,7 @@ class Button implements ButtonInterface {
if ( ! in_array( 'PAYMENT_METHODS', $data['products'], true ) ) { if ( ! in_array( 'PAYMENT_METHODS', $data['products'], true ) ) {
if ( in_array( 'PPCP', $data['products'], true ) ) { if ( in_array( 'PPCP', $data['products'], true ) ) {
$data['products'][] = 'PAYMENT_METHODS'; $data['products'][] = 'PAYMENT_METHODS';
} elseif ( in_array( 'EXPRESS_CHECKOUT', $data['products'], true ) ) { // TODO A bit sketchy, maybe replace on the EXPRESS_CHECKOUT index. } elseif ( in_array( 'EXPRESS_CHECKOUT', $data['products'], true ) ) { // A bit sketchy, maybe replace on the EXPRESS_CHECKOUT index.
$data['products'][0] = 'PAYMENT_METHODS'; $data['products'][0] = 'PAYMENT_METHODS';
} }
} }
@ -268,10 +267,6 @@ class Button implements ButtonInterface {
add_action( add_action(
$render_placeholder, $render_placeholder,
function () { function () {
if ( ! is_cart() /* TODO : check other conditions */ ) {
return;
}
$this->googlepay_button(); $this->googlepay_button();
}, },
21 21