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