Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Typescript properties in Payment model #390

Open
PaquitoSoft opened this issue Nov 9, 2024 · 4 comments
Open

Missing Typescript properties in Payment model #390

PaquitoSoft opened this issue Nov 9, 2024 · 4 comments
Labels
API discrepancy Inconsistency between Mollie's REST API and this SDK.

Comments

@PaquitoSoft
Copy link

Hello 👋

We're starting to consume Mollie APIs and I think I'm missing some properties in the Payment model typescript definition.

Based on the API documentation (reference), a payment can have these optional properties:

  • lines
  • billingAddress
  • shippingAddress

However the Typescript type describing this model does not contain those properties (reference).

Are we missing something?

Thanks.

@fjbender
Copy link
Contributor

You're not missing anything :)

The properties you mentioned have been introduced fairly recently to eventually enable transition from the Orders API to the Payments API. We will include them in a future version of this library to support this.

@fjbender fjbender added the API extension Previously missing endpoints/binders. label Nov 11, 2024
@janpaepke janpaepke added API discrepancy Inconsistency between Mollie's REST API and this SDK. and removed API extension Previously missing endpoints/binders. labels Nov 11, 2024
@janpaepke
Copy link
Collaborator

janpaepke commented Nov 11, 2024

Especially since payments should replace the orders API, these are very sensible additions.
As these are only type additions, I am confident, we can add them fairly soon to the client.

In the meantime, you can get around Typescript complaining by spreading them into your payment.create options like this:

lines = {
  [...]
}
client.payments.create({
	amount: {
		value: 100
		currency: "EUR",
	},
	...{ lines }, // tmp syntax, until @mollie/api-client includes correct property types
});

This way you don't have to disable ts checking for the whole object.

@PaquitoSoft
Copy link
Author

Ok. Thanks for your reply 🙇

Should we keep this opened until the types are added to the package?

@fjbender
Copy link
Contributor

Should we keep this opened until the types are added to the package?

Yes! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API discrepancy Inconsistency between Mollie's REST API and this SDK.
Projects
None yet
Development

No branches or pull requests

3 participants