Custom fields checkout typespec is wrong
Closed this issue · 4 comments
Existing Issue or Pull Request Verification
- Confirmed, no existing Issues or Pull Requests found related to my submission.
Package Version
3.1.1
Are you using the latest version?
- Yes, I verified the issue is still present in the latest version.
Steps to Reproduce
The API has many options for custom fields, none of which are the ones typed here.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-custom_fields
https://hexdocs.pm/stripity_stripe/3.1.1/Stripe.Checkout.Session.html#t:custom_fields/0
Stripity only has :name and :value. Both of which are not even in the API.
Expected Result
should include key, label, type, dropdown, numeric, optional, text
Actual Result
only includes name and value (which aren't actually types)
I had a quick look. There's some logic happening to make the function specs more succinct by unnesting them. In cases of name collisions this can give bugs.
I tried what happens if we inline the complete specs, the specs become really unwieldy and slow.
Screen.Recording.2024-01-24.at.13.18.40.mov
I'll try again with wider specs (e.g. map() instead of an map with each field listed). I think this is the way to go for now.
Sure, whatever you think is best.
I think the problem may be that it was copied from Invoice.custom_fields() which is correct.
This issue has been automatically marked as "stale:discard". If this issue still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment.
Closing this issue after a prolonged period of inactivity. If this issue is still relevant, feel free to re-open the issue. Thank you!