Skip to content

Commit

Permalink
Access name property of wpcom payment method in error handler (#43161)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbrillig authored Jun 10, 2020
1 parent a8b0833 commit d43680b
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,12 @@ export default function createAnalyticsEventHandler( reduxDispatch ) {
reason: String( action.payload.message ),
} )
);
const payment_method = translateCheckoutPaymentMethodToWpcomPaymentMethod(
action.payload.paymentMethodId
);
reduxDispatch(
recordTracksEvent( 'calypso_checkout_composite_payment_error', {
error_code: null,
payment_method,
payment_method:
translateCheckoutPaymentMethodToWpcomPaymentMethod( action.payload.paymentMethodId )
?.name || '',
reason: String( action.payload.message ),
} )
);
Expand Down

0 comments on commit d43680b

Please sign in to comment.