mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	feat(customer_v2): customer v2 refactor customer v2 update endpoint (#5490)
Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in> Co-authored-by: hrithikesh026 <hrithikesh.vm@juspay.in> Co-authored-by: Prajjwal Kumar <prajjwal.kumar@juspay.in> Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -110,8 +110,9 @@ pub async fn customer_update( | ||||
|     }; | ||||
|  | ||||
|     let customer_id = path.into_inner(); | ||||
|     let mut cust_update_req: customer_types::CustomerRequest = payload.into(); | ||||
|     let mut cust_update_req: customer_types::CustomerUpdateRequest = payload.into(); | ||||
|     cust_update_req.customer_id = Some(customer_id); | ||||
|     let customer_update_id = customer_types::UpdateCustomerId::new("temp_global_id".to_string()); | ||||
|  | ||||
|     let flow = Flow::CustomersUpdate; | ||||
|  | ||||
| @ -130,7 +131,13 @@ pub async fn customer_update( | ||||
|         &req, | ||||
|         cust_update_req, | ||||
|         |state, auth, req, _| { | ||||
|             customers::update_customer(state, auth.merchant_account, req, auth.key_store) | ||||
|             customers::update_customer( | ||||
|                 state, | ||||
|                 auth.merchant_account, | ||||
|                 req, | ||||
|                 auth.key_store, | ||||
|                 customer_update_id.clone(), | ||||
|             ) | ||||
|         }, | ||||
|         &auth::HeaderAuth(auth::ApiKeyAuth), | ||||
|         api_locking::LockAction::NotApplicable, | ||||
|  | ||||
| @ -135,7 +135,7 @@ impl From<CreateCustomerRequest> for api::CustomerRequest { | ||||
| } | ||||
|  | ||||
| #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))] | ||||
| impl From<CustomerUpdateRequest> for api::CustomerRequest { | ||||
| impl From<CustomerUpdateRequest> for api::CustomerUpdateRequest { | ||||
|     fn from(req: CustomerUpdateRequest) -> Self { | ||||
|         Self { | ||||
|             name: req.name, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Sahkal Poddar
					Sahkal Poddar