Skip to content

beforeSubmit and other props are not called with dropin #3751

@dennis-scorito

Description

@dennis-scorito

Describe the bug
We use dropin like this

const component = new Dropin(checkout, {
	showRadioButton: true,
	openFirstPaymentMethod: false,
	showStoredPaymentMethods: false,
	onSelect: () => {

	},
	beforeSubmit: (data: PaymentData, _: UIElement, actions: BeforeSubmitActions) => {
		console.log("beforeSubmit called with data:", data);
		
	}
}).mount(element);

In version 6.25.1 the beforeSubmit was working, but versions higher than 6.25.1, its broken.

Seems to be removed with v6.25.1...v6.26.0#diff-d4ea9ffb2b598c01783215539ba77ce1a55fcb6931ce873d8e087f16ffced4a7L126.

The props are not wrapped in the getCommonProps anymore which causes the props not to be set again.

To Reproduce
Steps to reproduce the behavior:

  1. Use any version higher than v6.25.1
  2. beforeSubmit is not called
  3. Downgrade to v6.25.1
  4. It works again

Expected behavior
onSubmit should still be called using the Dropin component

Screenshots

Image Image

Desktop:

  • OS: Windows
  • Browser: FireFox
  • Version: 146.0.1
  • Basically anywhere

Additional context
Removed here v6.25.1...v6.26.0#diff-d4ea9ffb2b598c01783215539ba77ce1a55fcb6931ce873d8e087f16ffced4a7L126

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions