Skip to content

Commit

Permalink
Merge branch 'develop' into cobranded-cards
Browse files Browse the repository at this point in the history
  • Loading branch information
gpressutto5 authored Apr 5, 2024
2 parents f14c016 + 01be26a commit dc017ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog/8499-fix-js-error-on-gpay-click
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix JS error when clicking GPay button on blocks checkout with subscription (w/sign up fee) in cart.
9 changes: 5 additions & 4 deletions client/payment-request/blocks/payment-request-express.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,18 @@ const PaymentRequestExpressComponent = ( {
onPaymentRequestAvailable( paymentRequestType );
} );

const onPaymentRequestButtonClick = () => {
onButtonClick();
const onPaymentRequestButtonClick = ( event ) => {
onButtonClick( event, paymentRequest );

const paymentRequestTypeEvents = {
google_pay: 'gpay_button_click',
apple_pay: 'applepay_button_click',
};

if ( paymentRequestTypeEvents.hasOwnProperty( paymentRequestType ) ) {
const event = paymentRequestTypeEvents[ paymentRequestType ];
recordUserEvent( event, {
const paymentRequestEvent =
paymentRequestTypeEvents[ paymentRequestType ];
recordUserEvent( paymentRequestEvent, {
source: wcpayPaymentRequestParams?.button_context,
} );
}
Expand Down

0 comments on commit dc017ec

Please sign in to comment.