mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 12:06:56 +08:00
feat(router): add an api to migrate the payment method (#5186)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -46,6 +46,26 @@ pub async fn create_payment_method_api(
|
||||
.await
|
||||
}
|
||||
|
||||
#[instrument(skip_all, fields(flow = ?Flow::PaymentMethodsMigrate))]
|
||||
pub async fn migrate_payment_method_api(
|
||||
state: web::Data<AppState>,
|
||||
req: HttpRequest,
|
||||
json_payload: web::Json<payment_methods::PaymentMethodMigrate>,
|
||||
) -> HttpResponse {
|
||||
let flow = Flow::PaymentMethodsMigrate;
|
||||
|
||||
Box::pin(api::server_wrap(
|
||||
flow,
|
||||
state,
|
||||
&req,
|
||||
json_payload.into_inner(),
|
||||
|state, _, req, _| async move { Box::pin(cards::migrate_payment_method(state, req)).await },
|
||||
&auth::AdminApiAuth,
|
||||
api_locking::LockAction::NotApplicable,
|
||||
))
|
||||
.await
|
||||
}
|
||||
|
||||
#[instrument(skip_all, fields(flow = ?Flow::PaymentMethodSave))]
|
||||
pub async fn save_payment_method_api(
|
||||
state: web::Data<AppState>,
|
||||
|
||||
Reference in New Issue
Block a user