Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse paypal events in stripe webhooks #430

Open
Overdash opened this issue Aug 27, 2023 · 2 comments
Open

Parse paypal events in stripe webhooks #430

Overdash opened this issue Aug 27, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Overdash
Copy link

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

  1. Setup Webhook environment locally. Use Webhook::construct_event() to construct the event.
  2. Setup PayPal as a payment method on Stripe's dashboard (Test mode!)
  3. Initiate a PaymentIntent - use Stripe Payment Element for simplicity
  4. Try fund the payment the payment via PayPal
  5. Click Fail Test Payment on the test payment page
  6. Observe webhook logs - Webhook::construct_event should produce a Err(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

@Overdash Overdash added the bug Something isn't working label Aug 27, 2023
@Overdash Overdash changed the title BadParse for PayPal failures BadParse error on PayPal failures Aug 27, 2023
@arlyon
Copy link
Owner

arlyon commented Sep 25, 2023

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.

@arlyon arlyon added enhancement New feature or request and removed bug Something isn't working labels Sep 25, 2023
@arlyon arlyon changed the title BadParse error on PayPal failures Parse paypal events in stripe webhooks Sep 25, 2023
@Overdash
Copy link
Author

No need to apologise. Thanks for this :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants