mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Use onError instead of deprecated setExpressPaymentError
This commit is contained in:
parent
e990eb2a6e
commit
d887135951
1 changed files with 3 additions and 5 deletions
|
@ -9,9 +9,9 @@ const PayPalComponent = ({
|
||||||
onClick,
|
onClick,
|
||||||
onClose,
|
onClose,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
|
onError,
|
||||||
eventRegistration,
|
eventRegistration,
|
||||||
emitResponse,
|
emitResponse,
|
||||||
setExpressPaymentError,
|
|
||||||
}) => {
|
}) => {
|
||||||
const {onPaymentSetup} = eventRegistration;
|
const {onPaymentSetup} = eventRegistration;
|
||||||
const {responseTypes} = emitResponse;
|
const {responseTypes} = emitResponse;
|
||||||
|
@ -49,7 +49,7 @@ const PayPalComponent = ({
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
||||||
setExpressPaymentError(err.message);
|
onError(err.message);
|
||||||
|
|
||||||
onClose();
|
onClose();
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ const PayPalComponent = ({
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
||||||
setExpressPaymentError(err.message);
|
onError(err.message);
|
||||||
|
|
||||||
onClose();
|
onClose();
|
||||||
|
|
||||||
|
@ -97,8 +97,6 @@ const PayPalComponent = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
setExpressPaymentError('');
|
|
||||||
|
|
||||||
onClick();
|
onClick();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue