Closed thomasmost closed 1 month ago
The PlanId
is defined so that it can be any arbitrary string in here. The issue is that, since the "new way" is to use Price instead of Plan, they fill the price
data with the plan
to keep compatibility.
You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.
This causes the code to try to parse the price.id
that is the arbitrary string from the plan.id
, as we can see from the example you sent:
"plan": {
"id": "monthly8usd",
"object": "plan",
(...)
},
"price": {
"id": "monthly8usd",
"object": "price",
(...)
}
I guess there might be the need to lift the restriction of the Price ID needing to be one of price_
or plan_
, to instead be the same as the PlanId
, any String
🤔
Price
had a plan_
id: https://github.com/arlyon/async-stripe/issues/470plan_
on Price
: https://github.com/arlyon/async-stripe/pull/471Got it! @augustoccesar thank you for the more thorough explanation/understanding than I possessed... I forked the repo earlier to fix this bug in our live service and I just opened a PR. Happy to make adjustments to get it up to merge-standard if you want to take a look!
:tada: This issue has been resolved in version 0.38.1 :tada:
The release is available on:
v0.38.1
Your semantic-release bot :package::rocket:
Describe the bug
My
invoice.paid
webhook event parse is failing with "invalidPriceId
, expected id to start with "price" or "plan"The price ID is "monthly8usd" — and this is from Stripe, mind you... so I think this must be a false presumption?
To Reproduce
Webhook
Event payload (scrubbed):
Expected behavior
It should parse a valid
invoice.paid
eventCode snippets
No response
OS
debian
Rust version
1.79.0
Library version
async-stripe 0.37.1
API version
2024-06-20
Additional context
No response