fix(ucs): merchant account metadata parsing of nested json objects
Type of Change
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Description
this pr fixes the unintended none value being returned to merchant_account_metadata when the metadata field in the mca create contains nested json objects in the request.
v.as_str() expects the data to be in the string kv format and when it finds the data not being in that format, it used to return none that resulted in payments via connectors like paysafe in ucs to fail.
Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
Motivation and Context
paysafe connector requires account id to be passed in the mca metadata and in ucs, it was failing. upon debugging, i learnt that it was failing to parse because of as_str().
How did you test it?
payments via paysafe connector is dependent on this change and only after this change was incorporated, payments started to succeed.
Checklist
- [x] I formatted the code
cargo +nightly fmt --all - [x] I addressed lints thrown by
just clippy && just clippy_v2 - [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
Changed Files
| File | Status |
|---|---|
Codecov Report
:x: Patch coverage is 0% with 64 lines in your changes missing coverage. Please review.
:warning: Please upload report for BASE (main@38e3837). Learn more about missing BASE report.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...src/core/unified_connector_service/transformers.rs | 0.00% | 64 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #10244 +/- ##
=======================================
Coverage ? 6.47%
=======================================
Files ? 1249
Lines ? 310672
Branches ? 0
=======================================
Hits ? 20106
Misses ? 290566
Partials ? 0
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.