Use onError instead of deprecated setExpressPaymentError

This commit is contained in:
Alex P 2023-03-23 15:54:24 +02:00
parent e990eb2a6e
commit d887135951
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -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();
};