Parse paypal events in stripe webhooks
Describe the bug
When I test a failed PayPal transaction, the library fails to construct the Webhook Event that's triggered. I get the following:
Err(
BadParse(
Error("unknown variant `paypal`, expected one of `acss_debit`, `affirm`, `afterpay_clearpay`, `alipay`, `au_becs_debit`, `bacs_debit`, `bancontact`, `blik`, `boleto`, `card`, `card_present`, `customer_balance`, `eps`, `fpx`, `giropay`, `grabpay`, `ideal`, `interac_present`, `klarna`, `konbini`, `link`, `oxxo`, `p24`, `paynow`, `pix`, `promptpay`, `sepa_debit`, `sofort`, `us_bank_account`, `wechat_pay`", line: 228, column: 3),
),
)
Weirdly this works when the payment is successful!
To Reproduce
- Setup Webhook environment locally. Use
Webhook::construct_event()to construct the event. - Setup PayPal as a payment method on Stripe's dashboard (Test mode!)
- Initiate a PaymentIntent - use Stripe Payment Element for simplicity
- Try fund the payment the payment via PayPal
- Click
Fail Test Paymenton the test payment page - Observe webhook logs -
Webhook::construct_eventshould produce aErr(BadParse(...))as above
Expected behavior
PayPal should be recognised as a variant! And the webhooks should be constructed as any other valid variant.
Code snippets
No response
OS
Windows 10
Rust version
1.70.0
Library version
0.22.2
API version
2022-11-15
Additional context
Successful PayPal attempts work correctly
Hello, sorry for the delay in replies. Stripe does not to my knowledge publish a list of all the possible webhook formats in an easy-to-consume manner so this is currently hand-written and the paypal event has not been added.
I am marking this as a feature request for now.
No need to apologise. Thanks for this :).