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

Error when constructing event #499

Closed
vincent-thomas opened this issue Feb 8, 2024 · 1 comment
Closed

Error when constructing event #499

vincent-thomas opened this issue Feb 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@vincent-thomas
Copy link

Describe the bug

When constructing the webhook event it something happens with the body so every event fails.

To Reproduce

This code

  let payload_str = std::str::from_utf8(&payload).unwrap();
  let stripe_signature = get_header(&req, "Stripe-Signature").unwrap_or_default();
  let stripe_secret_key = c.config.get_stripe_webhook_secret().await;
  let event = match Webhook::construct_event(payload_str, stripe_signature, &stripe_secret_key) {
    Ok(event) => event,
    Err(e) => {
      eprintln!("Error constructing event: {:?} {:?}", e, payload_str);
      return Ok(());
    }
  };

Every single event it goes to the Err and prints error

Error constructing event: BadParse(Error("unknown variant `self`, expected `account` or `self_`", line: 133, column: 3))

Expected behavior

It parses the event like it should

Code snippets

No response

OS

Not relevant

Rust version

1.77.0-nightly - but not relevant

Library version

0.31.0

API version

2023-10-16

Additional context

No response

@vincent-thomas vincent-thomas added the bug Something isn't working label Feb 8, 2024
@augustoccesar
Copy link
Contributor

I believe this is related to #490, so should get fixed once that gets merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants