Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unused arguments from usePaymentCompleteHandler #10473

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/chore-usePaymentCompleteHandler-unused-arguments
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: chore: remove unused arguments from usePaymentCompleteHandler


4 changes: 1 addition & 3 deletions client/checkout/blocks/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import {

export const usePaymentCompleteHandler = (
api,
stripe,
elements,
onCheckoutSuccess,
emitResponse,
shouldSavePayment
Expand All @@ -33,7 +31,7 @@ export const usePaymentCompleteHandler = (
),
// not sure if we need to disable this, but kept it as-is to ensure nothing breaks. Please consider passing all the deps.
// eslint-disable-next-line react-hooks/exhaustive-deps
[ elements, stripe, api, shouldSavePayment ]
[ api, shouldSavePayment ]
);
};

Expand Down
9 changes: 1 addition & 8 deletions client/checkout/blocks/payment-processor.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/**
* External dependencies
*/
import {
PaymentElement,
useElements,
useStripe,
} from '@stripe/react-stripe-js';
import { PaymentElement, useElements } from '@stripe/react-stripe-js';
import {
getPaymentMethods,
// eslint-disable-next-line import/no-unresolved
Expand Down Expand Up @@ -70,7 +66,6 @@ const PaymentProcessor = ( {
onLoadError = noop,
theme,
} ) => {
const stripe = useStripe();
const elements = useElements();
const hasLoadErrorRef = useRef( false );
const linkCleanupRef = useRef( null );
Expand Down Expand Up @@ -269,8 +264,6 @@ const PaymentProcessor = ( {

usePaymentCompleteHandler(
api,
stripe,
elements,
onCheckoutSuccess,
emitResponse,
shouldSavePayment
Expand Down
4 changes: 0 additions & 4 deletions client/checkout/blocks/saved-token-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { removeLinkButton } from '../stripe-link';

export const SavedTokenHandler = ( {
api,
stripe,
elements,
eventRegistration: { onPaymentSetup, onCheckoutSuccess },
emitResponse,
} ) => {
Expand Down Expand Up @@ -38,8 +36,6 @@ export const SavedTokenHandler = ( {
// Once the server has completed payment processing, confirm the intent of necessary.
usePaymentCompleteHandler(
api,
stripe,
elements,
onCheckoutSuccess,
emitResponse,
false // No need to save a payment that has already been saved.
Expand Down
Loading