mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
fix: store and retrieve merchant secret from MCA table for webhooks source verification (#1331)
Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
This commit is contained in:
@ -475,6 +475,21 @@ pub struct MerchantConnectorCreate {
|
||||
/// Business Sub label of the merchant
|
||||
#[schema(example = "chase")]
|
||||
pub business_sub_label: Option<String>,
|
||||
|
||||
/// Webhook details of this merchant connector
|
||||
#[schema(example = json!({
|
||||
"connector_webhook_details": {
|
||||
"merchant_secret": "1234567890987654321"
|
||||
}
|
||||
}))]
|
||||
pub connector_webhook_details: Option<MerchantConnectorWebhookDetails>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct MerchantConnectorWebhookDetails {
|
||||
#[schema(value_type = String, example = "12345678900987654321")]
|
||||
pub merchant_secret: Secret<String>,
|
||||
}
|
||||
|
||||
/// Response of creating a new Merchant Connector for the merchant account."
|
||||
@ -562,6 +577,14 @@ pub struct MerchantConnectorResponse {
|
||||
}
|
||||
]))]
|
||||
pub frm_configs: Option<FrmConfigs>,
|
||||
|
||||
/// Webhook details of this merchant connector
|
||||
#[schema(example = json!({
|
||||
"connector_webhook_details": {
|
||||
"merchant_secret": "1234567890987654321"
|
||||
}
|
||||
}))]
|
||||
pub connector_webhook_details: Option<MerchantConnectorWebhookDetails>,
|
||||
}
|
||||
|
||||
/// Create a new Merchant Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc."
|
||||
@ -631,6 +654,14 @@ pub struct MerchantConnectorUpdate {
|
||||
}
|
||||
]))]
|
||||
pub frm_configs: Option<FrmConfigs>,
|
||||
|
||||
/// Webhook details of this merchant connector
|
||||
#[schema(example = json!({
|
||||
"connector_webhook_details": {
|
||||
"merchant_secret": "1234567890987654321"
|
||||
}
|
||||
}))]
|
||||
pub connector_webhook_details: Option<MerchantConnectorWebhookDetails>,
|
||||
}
|
||||
|
||||
///Details of FrmConfigs are mentioned here... it should be passed in payment connector create api call, and stored in merchant_connector_table
|
||||
|
||||
Reference in New Issue
Block a user