mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +08:00
refactor(core): add payment method list route to payment_methods (#682)
Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
@ -533,11 +533,11 @@ impl<F, T>
|
||||
.response
|
||||
.err_code
|
||||
.map(|c| c.to_string())
|
||||
.unwrap_or(consts::NO_ERROR_CODE.to_string()),
|
||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||
message: item
|
||||
.response
|
||||
.reason
|
||||
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
|
||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||
reason: None,
|
||||
status_code: item.http_code,
|
||||
}),
|
||||
@ -547,11 +547,11 @@ impl<F, T>
|
||||
.response
|
||||
.gw_error_code
|
||||
.map(|c| c.to_string())
|
||||
.unwrap_or(consts::NO_ERROR_CODE.to_string()),
|
||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||
message: item
|
||||
.response
|
||||
.gw_error_reason
|
||||
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
|
||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||
reason: None,
|
||||
status_code: item.http_code,
|
||||
}),
|
||||
@ -608,11 +608,11 @@ impl TryFrom<types::RefundsResponseRouterData<api::Execute, NuveiPaymentsRespons
|
||||
.response
|
||||
.err_code
|
||||
.map(|c| c.to_string())
|
||||
.unwrap_or(consts::NO_ERROR_CODE.to_string()),
|
||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||
message: item
|
||||
.response
|
||||
.reason
|
||||
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
|
||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||
reason: None,
|
||||
status_code: item.http_code,
|
||||
}),
|
||||
@ -647,11 +647,11 @@ impl TryFrom<types::RefundsResponseRouterData<api::RSync, NuveiPaymentsResponse>
|
||||
.response
|
||||
.err_code
|
||||
.map(|c| c.to_string())
|
||||
.unwrap_or(consts::NO_ERROR_CODE.to_string()),
|
||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||
message: item
|
||||
.response
|
||||
.reason
|
||||
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
|
||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||
reason: None,
|
||||
status_code: item.http_code,
|
||||
}),
|
||||
|
||||
@ -208,7 +208,11 @@ impl PaymentMethods {
|
||||
pub fn server(state: AppState) -> Scope {
|
||||
web::scope("/payment_methods")
|
||||
.app_data(web::Data::new(state))
|
||||
.service(web::resource("").route(web::post().to(create_payment_method_api)))
|
||||
.service(
|
||||
web::resource("")
|
||||
.route(web::post().to(create_payment_method_api))
|
||||
.route(web::get().to(list_payment_method_api)), // TODO : added for sdk compatibility for now, need to deprecate this later
|
||||
)
|
||||
.service(
|
||||
web::resource("/{payment_method_id}")
|
||||
.route(web::get().to(payment_method_retrieve_api))
|
||||
|
||||
Reference in New Issue
Block a user