mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	fix: populate payment_token in response (#287)
This commit is contained in:
		| @ -140,7 +140,6 @@ where | |||||||
|             payment_data.address, |             payment_data.address, | ||||||
|             server, |             server, | ||||||
|             payment_data.connector_response.authentication_data, |             payment_data.connector_response.authentication_data, | ||||||
|             payment_data.token, |  | ||||||
|             operation, |             operation, | ||||||
|         ) |         ) | ||||||
|     } |     } | ||||||
| @ -230,7 +229,6 @@ pub fn payments_to_payments_response<R, Op>( | |||||||
|     address: PaymentAddress, |     address: PaymentAddress, | ||||||
|     server: &Server, |     server: &Server, | ||||||
|     redirection_data: Option<serde_json::Value>, |     redirection_data: Option<serde_json::Value>, | ||||||
|     payment_token: Option<String>, |  | ||||||
|     operation: Op, |     operation: Op, | ||||||
| ) -> RouterResponse<api::PaymentsResponse> | ) -> RouterResponse<api::PaymentsResponse> | ||||||
| where | where | ||||||
| @ -311,7 +309,7 @@ where | |||||||
|                             payment_method_data.map(api::PaymentMethodDataResponse::from), |                             payment_method_data.map(api::PaymentMethodDataResponse::from), | ||||||
|                             auth_flow == services::AuthFlow::Merchant, |                             auth_flow == services::AuthFlow::Merchant, | ||||||
|                         ) |                         ) | ||||||
|                         .set_payment_token(payment_token) |                         .set_payment_token(payment_attempt.payment_token) | ||||||
|                         .set_error_message(payment_attempt.error_message) |                         .set_error_message(payment_attempt.error_message) | ||||||
|                         .set_shipping(address.shipping) |                         .set_shipping(address.shipping) | ||||||
|                         .set_billing(address.billing) |                         .set_billing(address.billing) | ||||||
| @ -374,6 +372,7 @@ where | |||||||
|             shipping: address.shipping, |             shipping: address.shipping, | ||||||
|             billing: address.billing, |             billing: address.billing, | ||||||
|             cancellation_reason: payment_attempt.cancellation_reason, |             cancellation_reason: payment_attempt.cancellation_reason, | ||||||
|  |             payment_token: payment_attempt.payment_token, | ||||||
|             ..Default::default() |             ..Default::default() | ||||||
|         }), |         }), | ||||||
|     }) |     }) | ||||||
|  | |||||||
| @ -36,8 +36,8 @@ pub struct PaymentAttempt { | |||||||
|     pub amount_to_capture: Option<i64>, |     pub amount_to_capture: Option<i64>, | ||||||
|     pub mandate_id: Option<String>, |     pub mandate_id: Option<String>, | ||||||
|     pub browser_info: Option<serde_json::Value>, |     pub browser_info: Option<serde_json::Value>, | ||||||
|     pub payment_token: Option<String>, |  | ||||||
|     pub error_code: Option<String>, |     pub error_code: Option<String>, | ||||||
|  |     pub payment_token: Option<String>, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive( | #[derive( | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Nishant Joshi
					Nishant Joshi