mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	feat(refunds_v2): Add refund update core flow in v2 apis (#7724)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -148,6 +148,7 @@ Never share your secret api keys. Keep them guarded and secure. | ||||
|  | ||||
|         //Routes for refunds | ||||
|         routes::refunds::refunds_create, | ||||
|         routes::refunds::refunds_metadata_update, | ||||
|         routes::refunds::refunds_retrieve, | ||||
|         routes::refunds::refunds_list, | ||||
|  | ||||
| @ -193,7 +194,7 @@ Never share your secret api keys. Keep them guarded and secure. | ||||
|         api_models::refunds::RefundType, | ||||
|         api_models::refunds::RefundResponse, | ||||
|         api_models::refunds::RefundStatus, | ||||
|         api_models::refunds::RefundUpdateRequest, | ||||
|         api_models::refunds::RefundMetadataUpdateRequest, | ||||
|         api_models::organization::OrganizationCreateRequest, | ||||
|         api_models::organization::OrganizationUpdateRequest, | ||||
|         api_models::organization::OrganizationResponse, | ||||
|  | ||||
| @ -112,6 +112,7 @@ pub async fn refunds_retrieve_with_body() {} | ||||
|     operation_id = "Update a Refund", | ||||
|     security(("api_key" = [])) | ||||
| )] | ||||
| #[cfg(feature = "v1")] | ||||
| pub async fn refunds_update() {} | ||||
|  | ||||
| /// Refunds - List | ||||
| @ -215,6 +216,38 @@ pub async fn refunds_filter_list() {} | ||||
| #[cfg(feature = "v2")] | ||||
| pub async fn refunds_create() {} | ||||
|  | ||||
| /// Refunds - Metadata Update | ||||
| /// | ||||
| /// Updates the properties of a Refund object. This API can be used to attach a reason for the refund or metadata fields | ||||
| #[utoipa::path( | ||||
|     put, | ||||
|     path = "/v2/refunds/{id}/update_metadata", | ||||
|     params( | ||||
|         ("id" = String, Path, description = "The identifier for refund") | ||||
|     ), | ||||
|     request_body( | ||||
|         content = RefundMetadataUpdateRequest, | ||||
|         examples( | ||||
|             ( | ||||
|                 "Update refund reason" = ( | ||||
|                     value = json!({ | ||||
|                         "reason": "Paid by mistake" | ||||
|                       }) | ||||
|                 ) | ||||
|             ) | ||||
|         ) | ||||
|     ), | ||||
|     responses( | ||||
|         (status = 200, description = "Refund updated", body = RefundResponse), | ||||
|         (status = 400, description = "Missing Mandatory fields") | ||||
|     ), | ||||
|     tag = "Refunds", | ||||
|     operation_id = "Update Refund Metadata and Reason", | ||||
|     security(("api_key" = [])) | ||||
| )] | ||||
| #[cfg(feature = "v2")] | ||||
| pub async fn refunds_metadata_update() {} | ||||
|  | ||||
| /// Refunds - Retrieve | ||||
| /// | ||||
| /// Retrieves a Refund. This may be used to get the status of a previously initiated refund | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Amey Wale
					Amey Wale