Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

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

Kashifa15e7ae9b156
diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs
index cae116fdac..e9beb84c7b 100644
--- a/crates/router/src/core/payment_methods/cards.rs
+++ b/crates/router/src/core/payment_methods/cards.rs
@@ -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?,
diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rs
index 12bb5981b1..360efb7dda 100644
--- a/crates/router/src/core/payment_methods/transformers.rs
+++ b/crates/router/src/core/payment_methods/transformers.rs
@@ -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")]