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

fix(connector): use enum to deserialize latest_charge in stripe psync response #2444

Merged
merged 3 commits into from
Oct 4, 2023

Conversation

hrithikesh026
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Stripe webhook body deserialization was failing due to latest_charge field in PaymentIntentSyncResponse.
stripe sends one of the following type in that field:

  • String(latest_charge_id)
  • Null
  • LatestCharge json object
    Out of above 3, String response was not handled. This was causing deserialization error during webhooks for bank redirect. and bank debit.
    latest_charge field is being used to populate connector_mandate_id in the DB for bank redirect recurring payment in stripe. But in webhook body, this field is a string(latest_charge_id).

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Manual

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@hrithikesh026 hrithikesh026 added C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Oct 4, 2023
@hrithikesh026 hrithikesh026 added this to the September 2023 Milestone milestone Oct 4, 2023
@hrithikesh026 hrithikesh026 requested a review from a team as a code owner October 4, 2023 10:53
@hrithikesh026 hrithikesh026 self-assigned this Oct 4, 2023
@hrithikesh026 hrithikesh026 changed the title fix(connector): use enum to deserializa latest_charge in stripe psync response fix(connector): use enum to deserialize latest_charge in stripe psync response Oct 4, 2023
@Narayanbhat166 Narayanbhat166 added this pull request to the merge queue Oct 4, 2023
Merged via the queue into main with commit 05ee47a Oct 4, 2023
10 checks passed
@Narayanbhat166 Narayanbhat166 deleted the fix-deserialization-error-due-to-latest-charge branch October 4, 2023 16:01
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants