fix(payouts): saved payment methods list for bank details (#3507)

Co-authored-by: Kashif <mohammed.kashif@juspay.in>
This commit is contained in:
Kashif
2024-02-07 14:50:37 +05:30
committed by GitHub
parent c0e31ed1df
commit a15e7ae9b1
2 changed files with 10 additions and 5 deletions

View File

@ -635,15 +635,20 @@ pub async fn get_payment_method_from_hs_locker<'a>(
.attach_printable("Error getting decrypted response payload for get card")?;
let get_card_resp: payment_methods::RetrieveCardResp = decrypted_payload
.parse_struct("RetrieveCardResp")
.change_context(errors::VaultError::FetchPaymentMethodFailed)?;
.change_context(errors::VaultError::FetchPaymentMethodFailed)
.attach_printable("Failed to parse struct to RetrieveCardResp")?;
let retrieve_card_resp = get_card_resp
.payload
.get_required_value("RetrieveCardRespPayload")
.change_context(errors::VaultError::FetchPaymentMethodFailed)?;
.change_context(errors::VaultError::FetchPaymentMethodFailed)
.attach_printable("Failed to retrieve field - payload from RetrieveCardResp")?;
let enc_card_data = retrieve_card_resp
.enc_card_data
.get_required_value("enc_card_data")
.change_context(errors::VaultError::FetchPaymentMethodFailed)?;
.change_context(errors::VaultError::FetchPaymentMethodFailed)
.attach_printable(
"Failed to retrieve field - enc_card_data from RetrieveCardRespPayload",
)?;
decode_and_decrypt_locker_data(key_store, enc_card_data.peek().to_string()).await?
} else {
mock_get_payment_method(&*state.store, key_store, payment_method_reference)
@ -2571,7 +2576,7 @@ pub async fn list_customer_payment_method(
&key_store,
&token,
&pm.customer_id,
&pm.customer_id,
&pm.merchant_id,
&pm.payment_method_id,
)
.await?,

View File

@ -299,7 +299,7 @@ pub async fn mk_add_locker_request_hs<'a>(
payload: &StoreLockerReq<'a>,
locker_choice: api_enums::LockerChoice,
) -> CustomResult<services::Request, errors::VaultError> {
let payload = utils::Encode::<StoreCardReq<'_>>::encode_to_vec(&payload)
let payload = utils::Encode::<StoreLockerReq<'_>>::encode_to_vec(&payload)
.change_context(errors::VaultError::RequestEncodingFailed)?;
#[cfg(feature = "aws_kms")]