-
Notifications
You must be signed in to change notification settings - Fork 67
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
Update Interface Types #397
Conversation
embed?: MaybeArray<PaymentEmbed>; | ||
testmode?: boolean; | ||
} | ||
|
||
export type PageParameters = PaginationParameters & { | ||
profileId?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fjbender This param was not in the DOCS, which is why I assumed it does not exist and removed it.
If that is correct, the removal won't break anything since any current use wouldn't have worked anyway.
Can you confirm this Query Param is not available for list payments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just tried out listing my payments with this param set, and got this response:
{
"status": 422,
"title": "Unprocessable Entity",
"detail": "Non-existent query parameter \"profileId\" for this API call. Did you mean: \"previous\"?",
"field": "profileId",
"_links": {
"documentation": {
"href": "https://docs.mollie.com/overview/handling-errors",
"type": "text/html"
}
}
}
So yes, if it was ever possible to filter by profile ID, it's not possible anymore.
* | ||
* @see https://docs.mollie.com/reference/v2/payments-api/create-payment?path=billingAddress#credit-card | ||
*/ | ||
billingAddress?: Address; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not actually removed, but picked from data (see above)
/** | ||
* The card token you got from Mollie Components. The token contains the card information (such as card holder, card number, and expiry date) needed to complete the payment. | ||
* | ||
* @see https://docs.mollie.com/reference/v2/payments-api/create-payment?path=cardToken#credit-card | ||
*/ | ||
cardToken?: string; | ||
shippingAddress?: Address & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not actually removed, but picked from data (see above)
* | ||
* @see https://docs.mollie.com/overview/common-data-types?path=email#address-object | ||
*/ | ||
email?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fjbender email
is missing from the common type definition, but I think that's a mistake, as it is included where the address is used (payments/orders)
@@ -102,7 +120,13 @@ export interface Address { | |||
* | |||
* @see https://docs.mollie.com/overview/common-data-types?path=postalCode#address-object | |||
*/ | |||
postalCode: string; | |||
postalCode?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the only potentially breaking change, as for this was used for orders and is actually optional.
This means users, who consumed order.billingAddress.postalCode may now get a type error.
This resolve several type discrepancies between the client and the mollie API.
Since the official docs are too inconsistent to be used as source of truth, the actual optional-ness of these properties was aligned directly with mollie.
No properties were removed and Types should be wider, not narrower, making this a backwards compatible change.
The only exception I could find was the
address.postCode
, which was defined to be required, when it is actually optional, since not all countries have a post code.This change will concern the organization.address and order.address.
I don't believe this warrants a major version release.
This resolves: