mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(billing): add support to configure billing processor in profile (#9438)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -3485,6 +3485,7 @@ impl ProfileCreateBridge for api::ProfileCreate {
|
||||
))
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.attach_printable("error while generating external vault details")?,
|
||||
billing_processor_id: self.billing_processor_id,
|
||||
}))
|
||||
}
|
||||
|
||||
@ -3636,6 +3637,7 @@ impl ProfileCreateBridge for api::ProfileCreate {
|
||||
merchant_category_code: self.merchant_category_code,
|
||||
merchant_country_code: self.merchant_country_code,
|
||||
split_txns_enabled: self.split_txns_enabled.unwrap_or_default(),
|
||||
billing_processor_id: self.billing_processor_id,
|
||||
}))
|
||||
}
|
||||
}
|
||||
@ -3987,6 +3989,7 @@ impl ProfileUpdateBridge for api::ProfileUpdate {
|
||||
external_vault_connector_details: self
|
||||
.external_vault_connector_details
|
||||
.map(ForeignInto::foreign_into),
|
||||
billing_processor_id: self.billing_processor_id,
|
||||
},
|
||||
)))
|
||||
}
|
||||
@ -4132,6 +4135,7 @@ impl ProfileUpdateBridge for api::ProfileUpdate {
|
||||
merchant_country_code: self.merchant_country_code,
|
||||
revenue_recovery_retry_algorithm_type,
|
||||
split_txns_enabled: self.split_txns_enabled,
|
||||
billing_processor_id: self.billing_processor_id,
|
||||
},
|
||||
)))
|
||||
}
|
||||
|
||||
@ -1292,6 +1292,7 @@ mod tests {
|
||||
is_manual_retry_enabled: None,
|
||||
always_enable_overcapture: None,
|
||||
external_vault_details: domain::ExternalVaultDetails::Skip,
|
||||
billing_processor_id: None,
|
||||
});
|
||||
|
||||
let business_profile = state
|
||||
|
||||
@ -240,6 +240,7 @@ impl ForeignTryFrom<domain::Profile> for ProfileResponse {
|
||||
is_external_vault_enabled,
|
||||
external_vault_connector_details: external_vault_connector_details
|
||||
.map(ForeignFrom::foreign_from),
|
||||
billing_processor_id: item.billing_processor_id,
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -328,6 +329,7 @@ impl ForeignTryFrom<domain::Profile> for ProfileResponse {
|
||||
merchant_country_code: item.merchant_country_code,
|
||||
split_txns_enabled: item.split_txns_enabled,
|
||||
revenue_recovery_retry_algorithm_type: item.revenue_recovery_retry_algorithm_type,
|
||||
billing_processor_id: item.billing_processor_id,
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -508,5 +510,6 @@ pub async fn create_profile_from_merchant_account(
|
||||
))
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.attach_printable("error while generating external_vault_details")?,
|
||||
billing_processor_id: request.billing_processor_id,
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user