bugfix: check if bank_pm exists and then send (#679)

Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
Narayan Bhat
2023-02-28 13:54:02 +05:30
committed by GitHub
parent e6f627d931
commit 76a9b557cc
2 changed files with 49 additions and 43 deletions

View File

@ -659,10 +659,12 @@ pub async fn list_payment_methods(
})
}
payment_method_responses.push(ResponsePaymentMethodsEnabled {
payment_method: api_enums::PaymentMethod::BankRedirect,
payment_method_types: bank_payment_method_types,
});
if !bank_payment_method_types.is_empty() {
payment_method_responses.push(ResponsePaymentMethodsEnabled {
payment_method: api_enums::PaymentMethod::BankRedirect,
payment_method_types: bank_payment_method_types,
});
}
response
.is_empty()