fix: populate meta_data in payment_intent (#1240)

This commit is contained in:
SamraatBansal
2023-05-23 18:15:07 +05:30
committed by GitHub
parent 27610361b9
commit 1ac3eb0a36

View File

@ -3,6 +3,7 @@ use std::marker::PhantomData;
use async_trait::async_trait;
use common_utils::ext_traits::{AsyncExt, Encode, ValueExt};
use error_stack::{self, ResultExt};
use masking::Secret;
use router_derive::PaymentOperation;
use router_env::{instrument, tracing};
use storage_models::ephemeral_key;
@ -544,6 +545,7 @@ impl PaymentCreate {
.transpose()
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Encoding Metadata to value failed")?;
let meta_data = metadata.clone().map(Secret::new);
let (business_country, business_label) = helpers::get_business_details(
request.business_country,
@ -573,6 +575,7 @@ impl PaymentCreate {
business_country,
business_label,
active_attempt_id,
meta_data,
..storage::PaymentIntentNew::default()
})
}