Skip to content

Commit

Permalink
fix(connector): [BOA/CYB] Fix Metadata Error (#3283)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepanshu-iiitu authored Jan 9, 2024
1 parent 5484cf4 commit 71044a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions crates/router/src/connector/bankofamerica/transformers.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::collections::HashMap;

use api_models::payments;
use base64::Engine;
use common_utils::pii;
Expand Down Expand Up @@ -323,8 +321,9 @@ impl From<&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>>

impl ForeignFrom<Value> for Vec<MerchantDefinedInformation> {
fn foreign_from(metadata: Value) -> Self {
let hashmap: HashMap<String, Value> =
serde_json::from_str(&metadata.to_string()).unwrap_or(HashMap::new());
let hashmap: std::collections::BTreeMap<String, Value> =
serde_json::from_str(&metadata.to_string())
.unwrap_or(std::collections::BTreeMap::new());
let mut vector: Self = Self::new();
let mut iter = 1;
for (key, value) in hashmap {
Expand Down
7 changes: 3 additions & 4 deletions crates/router/src/connector/cybersource/transformers.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::collections::HashMap;

use api_models::payments;
use base64::Engine;
use common_utils::pii;
Expand Down Expand Up @@ -543,8 +541,9 @@ fn build_bill_to(

impl ForeignFrom<Value> for Vec<MerchantDefinedInformation> {
fn foreign_from(metadata: Value) -> Self {
let hashmap: HashMap<String, Value> =
serde_json::from_str(&metadata.to_string()).unwrap_or(HashMap::new());
let hashmap: std::collections::BTreeMap<String, Value> =
serde_json::from_str(&metadata.to_string())
.unwrap_or(std::collections::BTreeMap::new());
let mut vector: Self = Self::new();
let mut iter = 1;
for (key, value) in hashmap {
Expand Down

0 comments on commit 71044a1

Please sign in to comment.