Description
When a Drop-in is initialized without an onSubmit callback (a valid setup when the host app drives submission via its own button and uses the Drop-in only as an encrypted-field collector), pressing Enter inside any Drop-in input crashes with:
TypeError: undefined is not an object (evaluating 'this.makePaymentsCall().then')
Stacktrace
@adyen/adyen-web/src/components/Dropin/Dropin.tsx:242 Dropin.handleKeyPress
@adyen/adyen-web/src/components/internal/UIElement/UIElement.tsx:502 UIElement.handleKeyPress
@adyen/adyen-web/src/components/Dropin/Dropin.tsx:249 Dropin.onEnterKeyPressed
@adyen/adyen-web/src/components/internal/UIElement/UIElement.tsx:516 UIElement.onEnterKeyPressed
@adyen/adyen-web/src/components/internal/UIElement/UIElement.tsx:224 UIElement.setStatus
makePaymentsCall() returns undefined when no onSubmit is configured, and the Enter-key path then calls .then() on it unconditionally.
Reproduction
const checkout = await AdyenCheckout({
clientKey: '...',
environment: 'test',
countryCode: 'US',
showPayButton: false,
// no onSubmit
paymentMethodsResponse: {
paymentMethods: [{ type: 'scheme', brands: ['visa'], name: 'Credit Card' }],
},
})
new Dropin(checkout, {
paymentMethodsConfiguration: {
card: { billingAddressRequired: true, billingAddressRequiredFields: ['postalCode'] },
},
}).mount('#dropin')
- Fill in card details.
- Focus the billing postal code field.
- Press Enter (or "Go" on a mobile keyboard).
- →
TypeError thrown from makePaymentsCall().then.
Reproduces on mobile Safari (iOS 18.7) and desktop browsers. We see ~140 occurrences across 113 users in production.
Expected behavior
Either:
- Guard
makePaymentsCall to no-op (or warn) when no onSubmit is configured, instead of throwing.
- Throw a clear error at init time if a Drop-in is constructed without
onSubmit, so integrators discover the misconfiguration immediately rather than via a runtime TypeError deep in a keypress handler.
A clearer error at init would have let us identify and fix our integration in minutes instead of triaging a cryptic Sentry stack.
Workaround
Provide a no-op onSubmit that resolves immediately:
onSubmit: (_state, _component, actions) => {
actions.resolve({ resultCode: 'Received' })
}
Environment
@adyen/adyen-web: 6.33.0
- Browser: Mobile Safari 26.1 / iOS 18.7 (also reproducible on desktop)
- Framework: Next.js 16 + React 19
Description
When a Drop-in is initialized without an
onSubmitcallback (a valid setup when the host app drives submission via its own button and uses the Drop-in only as an encrypted-field collector), pressing Enter inside any Drop-in input crashes with:Stacktrace
makePaymentsCall()returnsundefinedwhen noonSubmitis configured, and the Enter-key path then calls.then()on it unconditionally.Reproduction
TypeErrorthrown frommakePaymentsCall().then.Reproduces on mobile Safari (iOS 18.7) and desktop browsers. We see ~140 occurrences across 113 users in production.
Expected behavior
Either:
makePaymentsCallto no-op (or warn) when noonSubmitis configured, instead of throwing.onSubmit, so integrators discover the misconfiguration immediately rather than via a runtimeTypeErrordeep in a keypress handler.A clearer error at init would have let us identify and fix our integration in minutes instead of triaging a cryptic Sentry stack.
Workaround
Provide a no-op
onSubmitthat resolves immediately:Environment
@adyen/adyen-web: 6.33.0