wyyerd / stripe-rs

Rust API bindings for the Stripe HTTP API.
Apache License 2.0
224 stars 88 forks source link

Properly support the 2020 api. #133

Open ruseinov opened 4 years ago

ruseinov commented 4 years ago

Currently there is a problem with a webhook:

[2020-05-21T08:43:02Z DEBUG actix_web::middleware::logger] Error in response: Error(Webhook(BadParse(Error("invalid `InvoiceLineItemId`, expected unknown id prefix", line: 161, column: 3))), State { next_error: None, backtrace: InternalBacktrace { backtrace: Some(   0: backtrace::backtrace::trace_unsynchronized

It has been temporary fixed here: https://github.com/ruseinov/stripe-rs/pull/1

I'm not sure exactly how good that fix is but it's definitely better than a failing webhook.

ruseinov commented 4 years ago

One other thing that I have noticed is that the current implementation fails when receiving test-webhooks. The reason for that is pretty simple, unlike stripe-cli, test webhooks send bogus Ids that look like "_000000" and that breaks id validation. I'm not exactly sure that needs to be fixed, but figured I'd report it anyway.

bryanburgers commented 4 years ago

Is there a reason you haven't submitted this as a pull request?

ruseinov commented 4 years ago

@bryanburgers I am not 100% sure this is a proper fix as I didn’t dig too deep in the code and the lack of documentation makes it hard to understand some of the implementation details and the reasoning behind them.

I’m guessing these was a reason for certain ID types to be restricted in the way they were, so I would love to hear author’s opinion on the matter.

vcombey commented 3 years ago

I am having the same issue.

vcombey commented 3 years ago

Is this only on tests webhooks ?

vcombey commented 3 years ago

what is blocking from the PR to be merged ? I would like to use it with the current master which use tokio v1