Skip to content

Commit c598036

Browse files
authored
chore: remove unused arguments from usePaymentCompleteHandler (#10473)
1 parent e3fd503 commit c598036

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: dev
3+
Comment: chore: remove unused arguments from usePaymentCompleteHandler
4+
5+

client/checkout/blocks/hooks.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import {
1414

1515
export const usePaymentCompleteHandler = (
1616
api,
17-
stripe,
18-
elements,
1917
onCheckoutSuccess,
2018
emitResponse,
2119
shouldSavePayment
@@ -33,7 +31,7 @@ export const usePaymentCompleteHandler = (
3331
),
3432
// not sure if we need to disable this, but kept it as-is to ensure nothing breaks. Please consider passing all the deps.
3533
// eslint-disable-next-line react-hooks/exhaustive-deps
36-
[ elements, stripe, api, shouldSavePayment ]
34+
[ api, shouldSavePayment ]
3735
);
3836
};
3937

client/checkout/blocks/payment-processor.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/**
22
* External dependencies
33
*/
4-
import {
5-
PaymentElement,
6-
useElements,
7-
useStripe,
8-
} from '@stripe/react-stripe-js';
4+
import { PaymentElement, useElements } from '@stripe/react-stripe-js';
95
import {
106
getPaymentMethods,
117
// eslint-disable-next-line import/no-unresolved
@@ -70,7 +66,6 @@ const PaymentProcessor = ( {
7066
onLoadError = noop,
7167
theme,
7268
} ) => {
73-
const stripe = useStripe();
7469
const elements = useElements();
7570
const hasLoadErrorRef = useRef( false );
7671
const linkCleanupRef = useRef( null );
@@ -269,8 +264,6 @@ const PaymentProcessor = ( {
269264

270265
usePaymentCompleteHandler(
271266
api,
272-
stripe,
273-
elements,
274267
onCheckoutSuccess,
275268
emitResponse,
276269
shouldSavePayment

client/checkout/blocks/saved-token-handler.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import { removeLinkButton } from '../stripe-link';
88

99
export const SavedTokenHandler = ( {
1010
api,
11-
stripe,
12-
elements,
1311
eventRegistration: { onPaymentSetup, onCheckoutSuccess },
1412
emitResponse,
1513
} ) => {
@@ -38,8 +36,6 @@ export const SavedTokenHandler = ( {
3836
// Once the server has completed payment processing, confirm the intent of necessary.
3937
usePaymentCompleteHandler(
4038
api,
41-
stripe,
42-
elements,
4339
onCheckoutSuccess,
4440
emitResponse,
4541
false // No need to save a payment that has already been saved.

0 commit comments

Comments
 (0)