Open
Description
Describe the bug
Webhook can't deserialize an invoice.paid
event due to the CreateInvoicePaymentSettingsPaymentMethodTypes
and InvoicesPaymentSettingsPaymentMethodTypes
enums missing an amazon_pay
variant.
Error:
Error("unknown variant `amazon_pay`, expected one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `au_becs_debit`, `bacs_debit`, `bancontact`, `boleto`, `card`, `cashapp`, `customer_balance`, `eps`, `fpx`, `giropay`, `grabpay`, `ideal`, `konbini`, `link`, `p24`, `paynow`, `paypal`, `promptpay`, `sepa_credit_transfer`, `sepa_debit`, `sofort`, `us_bank_account`, `wechat_pay`", line: 260, column: 2)
To Reproduce
-
Receive an
invoice.paid
event with the followingpayment_method_types
:"payment_method_types": [ "acss_debit", "amazon_pay", "cashapp", "link", "us_bank_account", "card" ]
-
Try to deserialize it:
let raw = serde_json::json!("amazon_pay").to_string(); let payment_method_type: CreateInvoicePaymentSettingsPaymentMethodTypes = serde_json::from_str(&raw).unwrap(); println!("{:?}", payment_method_type);
-
Error:
Error("unknown variant `amazon_pay`, expected one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `au_becs_debit`, `bacs_debit`, `bancontact`, `boleto`, `card`, `cashapp`, `customer_balance`, `eps`, `fpx`, `giropay`, `grabpay`, `ideal`, `konbini`, `link`, `p24`, `paynow`, `paypal`, `promptpay`, `sepa_credit_transfer`, `sepa_debit`, `sofort`, `us_bank_account`, `wechat_pay`", line: 1, column: 12
Expected behavior
CreateInvoicePaymentSettingsPaymentMethodTypes
and InvoicesPaymentSettingsPaymentMethodTypes
should deserialize amazon_pay
Code snippets
No response
OS
Docker debian:bookworm-slim
Rust version
1.82.0
Library version
async-stripe 0.39.1
API version
2023-10-16
Additional context
Our API has been affected by this change on Stripe's side, making it return 400 errors.