mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +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,
|
||||
onClose,
|
||||
onSubmit,
|
||||
onError,
|
||||
eventRegistration,
|
||||
emitResponse,
|
||||
setExpressPaymentError,
|
||||
}) => {
|
||||
const {onPaymentSetup} = eventRegistration;
|
||||
const {responseTypes} = emitResponse;
|
||||
|
@ -49,7 +49,7 @@ const PayPalComponent = ({
|
|||
} catch (err) {
|
||||
console.error(err);
|
||||
|
||||
setExpressPaymentError(err.message);
|
||||
onError(err.message);
|
||||
|
||||
onClose();
|
||||
|
||||
|
@ -88,7 +88,7 @@ const PayPalComponent = ({
|
|||
} catch (err) {
|
||||
console.error(err);
|
||||
|
||||
setExpressPaymentError(err.message);
|
||||
onError(err.message);
|
||||
|
||||
onClose();
|
||||
|
||||
|
@ -97,8 +97,6 @@ const PayPalComponent = ({
|
|||
};
|
||||
|
||||
const handleClick = () => {
|
||||
setExpressPaymentError('');
|
||||
|
||||
onClick();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue