mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	fix(connector): [coinbase] remove non-mandatory fields (#1252)
Co-authored-by: arvindpatel24 <arvind.patel@juspay.in>
This commit is contained in:
		| @ -24,8 +24,8 @@ pub struct Metadata { | |||||||
|  |  | ||||||
| #[derive(Default, Debug, Serialize, Eq, PartialEq)] | #[derive(Default, Debug, Serialize, Eq, PartialEq)] | ||||||
| pub struct CoinbasePaymentsRequest { | pub struct CoinbasePaymentsRequest { | ||||||
|     pub name: Secret<String>, |     pub name: Option<Secret<String>>, | ||||||
|     pub description: String, |     pub description: Option<String>, | ||||||
|     pub pricing_type: String, |     pub pricing_type: String, | ||||||
|     pub local_price: LocalPrice, |     pub local_price: LocalPrice, | ||||||
|     pub redirect_url: String, |     pub redirect_url: String, | ||||||
| @ -245,12 +245,12 @@ fn get_crypto_specific_payment_data( | |||||||
|     item: &types::PaymentsAuthorizeRouterData, |     item: &types::PaymentsAuthorizeRouterData, | ||||||
| ) -> Result<CoinbasePaymentsRequest, error_stack::Report<errors::ConnectorError>> { | ) -> Result<CoinbasePaymentsRequest, error_stack::Report<errors::ConnectorError>> { | ||||||
|     let billing_address = item |     let billing_address = item | ||||||
|         .get_billing()? |         .get_billing() | ||||||
|         .address |         .ok() | ||||||
|         .as_ref() |         .and_then(|billing_address| billing_address.address.as_ref()); | ||||||
|         .ok_or_else(utils::missing_field_err("billing.address"))?; |     let name = | ||||||
|     let name = billing_address.get_first_name()?.to_owned(); |         billing_address.and_then(|add| add.get_first_name().ok().map(|name| name.to_owned())); | ||||||
|     let description = item.get_description()?; |     let description = item.get_description().ok(); | ||||||
|     let connector_meta: CoinbaseConnectorMeta = |     let connector_meta: CoinbaseConnectorMeta = | ||||||
|         utils::to_connector_meta_from_secret(item.connector_meta_data.clone())?; |         utils::to_connector_meta_from_secret(item.connector_meta_data.clone())?; | ||||||
|     let pricing_type = connector_meta.pricing_type; |     let pricing_type = connector_meta.pricing_type; | ||||||
| @ -312,7 +312,7 @@ pub enum WebhookEventType { | |||||||
| pub struct CoinbasePaymentResponseData { | pub struct CoinbasePaymentResponseData { | ||||||
|     pub id: String, |     pub id: String, | ||||||
|     pub code: String, |     pub code: String, | ||||||
|     pub name: String, |     pub name: Option<String>, | ||||||
|     pub utxo: bool, |     pub utxo: bool, | ||||||
|     pub pricing: HashMap<String, OverpaymentAbsoluteThreshold>, |     pub pricing: HashMap<String, OverpaymentAbsoluteThreshold>, | ||||||
|     pub fee_rate: f64, |     pub fee_rate: f64, | ||||||
| @ -327,7 +327,7 @@ pub struct CoinbasePaymentResponseData { | |||||||
|     pub expires_at: String, |     pub expires_at: String, | ||||||
|     pub hosted_url: String, |     pub hosted_url: String, | ||||||
|     pub brand_color: String, |     pub brand_color: String, | ||||||
|     pub description: String, |     pub description: Option<String>, | ||||||
|     pub confirmed_at: Option<String>, |     pub confirmed_at: Option<String>, | ||||||
|     pub fees_settled: bool, |     pub fees_settled: bool, | ||||||
|     pub pricing_type: String, |     pub pricing_type: String, | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Arvind Patel
					Arvind Patel