diff --git a/example/package-lock.json b/example/package-lock.json index d4496ba..df4b642 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -28,7 +28,7 @@ }, "..": { "name": "@getopenpay/openpay-js-react", - "version": "0.0.7", + "version": "0.0.8", "license": "ISC", "dependencies": { "react": "^18.3.1", diff --git a/lib/components/form.tsx b/lib/components/form.tsx index fab6806..47791fd 100644 --- a/lib/components/form.tsx +++ b/lib/components/form.tsx @@ -175,7 +175,8 @@ const ElementsForm: FC = (props) => { if (onLoadError) onLoadError(eventPayload.message); } else if (eventType === EventType.enum.VALIDATION_ERROR) { - if (extraData?.checkoutPaymentMethod.provider === 'credit_card') { + const provider = extraData?.checkoutPaymentMethod.provider; + if (provider === 'credit_card' || provider === undefined) { console.error(`[form] Validation error for ${eventPayload.elementType}:`, eventPayload.errors); if (onValidationError) onValidationError(eventPayload.elementType, eventPayload.errors, elementId); } diff --git a/package-lock.json b/package-lock.json index 14a9812..1fe2323 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@getopenpay/openpay-js-react", - "version": "0.0.7", + "version": "0.0.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@getopenpay/openpay-js-react", - "version": "0.0.7", + "version": "0.0.8", "license": "ISC", "dependencies": { "react": "^18.3.1",