Open robiot opened 9 months ago
How did you reach this bug? It does seem like the invoice.last_finalization_error
already have the customer_tax_location_invalid
@augustoccesar Thats weird, it was reched when a stripe webhook was called. I got it working by using another hook meanwhile.
Now for stripe checkout session creation:
(StripeError(JSONSerialize(Error { path: Path { segments: [Map { key: "error" }, Map { key: "code" }] }, original: Error("unknown variant `customer_tax_location_invalid`, expected one of `account_already_exists`, `account_country_invalid_address`, `account_invalid`, `account_number_invalid`, `alipay_upgrade_required`, `amount_too_large`, `amount_too_small`, `api_key_expired`, `balance_insufficient`, `bank_account_exists`, `bank_account_unusable`, `bank_account_unverified`, `bank_account_verification_failed`, `bitcoin_upgrade_required`, `card_declined`, `charge_already_captured`, `charge_already_refunded`, `charge_disputed`, `charge_expired_for_capture`, `country_unsupported`, `coupon_expired`, `customer_max_subscriptions`, `email_invalid`, `expired_card`, `idempotency_key_in_use`, `incorrect_address`, `incorrect_cvc`, `incorrect_number`, `incorrect_zip`, `instant_payouts_unsupported`, `invalid_card_type`, `invalid_charge_amount`, `invalid_cvc`, `invalid_expiry_month`, `invalid_expiry_year`, `invalid_number`, `invalid_source_usage`, `invoice_no_customer_line_items`, `invoice_no_subscription_line_items`, `invoice_not_editable`, `invoice_upcoming_none`, `livemode_mismatch`, `missing`, `order_creation_failed`, `order_required_settings`, `order_status_invalid`, `order_upstream_timeout`, `out_of_inventory`, `parameter_invalid_empty`, `parameter_invalid_integer`, `parameter_invalid_string_blank`, `parameter_invalid_string_empty`, `parameter_missing`, `parameter_unknown`, `payment_method_unactivated`, `payment_intent_unexpected_state`, `payouts_not_allowed`, `platform_api_key_expired`, `postal_code_invalid`, `processing_error`, `product_inactive`, `rate_limit`, `resource_already_exists`, `resource_missing`, `routing_number_invalid`, `secret_key_required`, `sepa_unsupported_account`, `shipping_calculation_failed`, `sku_inactive`, `state_unsupported`, `tax_id_invalid`, `taxes_calculation_failed`, `testmode_charges_only`, `tls_version_unsupported`, `token_already_used`, `token_in_use`, `transfers_not_allowed`, `upstream_order_creation_failed`, `url_invalid`", line: 3, column: 43) })))
Maybe the option is just added to invoice, but not to session creation? @augustoccesar
WARN - Failed to parse webhook: BadParse(Error("unknown variant `self`, expected `account` or `self_`", line: 213, column: 3)
Seems like there is a whole lot of parse errors. I'm wondering if im doing something wrong or if the crate is out of date?
The webhook api version is 2022-11-15 (latest doens't work either). I cannot downgrade any further.
Readme states that the latest version supported is 2020?
Now for stripe checkout session creation:
(StripeError(JSONSerialize(Error { path: Path { segments: [Map { key: "error" }, Map { key: "code" }] }, original: Error("unknown variant `customer_tax_location_invalid`, expected one of `account_already_exists`, `account_country_invalid_address`, `account_invalid`, `account_number_invalid`, `alipay_upgrade_required`, `amount_too_large`, `amount_too_small`, `api_key_expired`, `balance_insufficient`, `bank_account_exists`, `bank_account_unusable`, `bank_account_unverified`, `bank_account_verification_failed`, `bitcoin_upgrade_required`, `card_declined`, `charge_already_captured`, `charge_already_refunded`, `charge_disputed`, `charge_expired_for_capture`, `country_unsupported`, `coupon_expired`, `customer_max_subscriptions`, `email_invalid`, `expired_card`, `idempotency_key_in_use`, `incorrect_address`, `incorrect_cvc`, `incorrect_number`, `incorrect_zip`, `instant_payouts_unsupported`, `invalid_card_type`, `invalid_charge_amount`, `invalid_cvc`, `invalid_expiry_month`, `invalid_expiry_year`, `invalid_number`, `invalid_source_usage`, `invoice_no_customer_line_items`, `invoice_no_subscription_line_items`, `invoice_not_editable`, `invoice_upcoming_none`, `livemode_mismatch`, `missing`, `order_creation_failed`, `order_required_settings`, `order_status_invalid`, `order_upstream_timeout`, `out_of_inventory`, `parameter_invalid_empty`, `parameter_invalid_integer`, `parameter_invalid_string_blank`, `parameter_invalid_string_empty`, `parameter_missing`, `parameter_unknown`, `payment_method_unactivated`, `payment_intent_unexpected_state`, `payouts_not_allowed`, `platform_api_key_expired`, `postal_code_invalid`, `processing_error`, `product_inactive`, `rate_limit`, `resource_already_exists`, `resource_missing`, `routing_number_invalid`, `secret_key_required`, `sepa_unsupported_account`, `shipping_calculation_failed`, `sku_inactive`, `state_unsupported`, `tax_id_invalid`, `taxes_calculation_failed`, `testmode_charges_only`, `tls_version_unsupported`, `token_already_used`, `token_in_use`, `transfers_not_allowed`, `upstream_order_creation_failed`, `url_invalid`", line: 3, column: 43) })))
Maybe the option is just added to invoice, but not to session creation? @augustoccesar
Hmmm, looking into it it seems like the error enum that I shared above is the one that is up to date with the API specs, but is not the one used to parse responses. The one used to parse error responses is this other re-exported one that seems to need to be manually updated.
One reason for it to not be using the generated one could be, like you mentioned, because of the version support. But I'm not quite sure. So maybe @arlyon can answer this one.
I did a diff on them and there are quite a lot of them that only exist on ApiErrorsCode
and some of them that only exist on the ErrorCode
. So I'm not sure what would be the ideal way to solve this. Maybe a merge between them?
Side note: It seems like errors related to Order
, for example, are listed on the errors page (like order-creation-failed) and exist on ErrorCode
but is not part of the generated ApiErrorsCode
. Probably because got removed from the API.
Probably because it got discontinued in November 16, 2022 (it seems like it was a Beta feature)
WARN - Failed to parse webhook: BadParse(Error("unknown variant `self`, expected `account` or `self_`", line: 213, column: 3)
Seems like there is a whole lot of parse errors. I'm wondering if im doing something wrong or if the crate is out of date?
This one I believe is related the issue #489 and to the PR #490 and , so it will probably get fixed when/if it gets merged.
The readme is out of date. The lastest version of async-stripe
should always track the lastest api version of stripe itself.
Describe the bug
The customer_tax_location_invalid is not added as a valid value for last_finalization_error.code. It should be an easy fix.
To Reproduce
.
Expected behavior
.
Code snippets
No response
OS
Windows
Rust version
any
Library version
0.26.0
API version
2023-08-16
Additional context
No response