mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
feat(core): accept gateway credentials in the request body in payments and refunds (#766)
This commit is contained in:
@ -413,3 +413,31 @@ pub struct ToggleKVRequest {
|
||||
#[schema(example = true)]
|
||||
pub kv_enabled: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
pub struct MerchantConnectorDetailsWrap {
|
||||
/// Creds Identifier is to uniquely identify the credentials. Do not send any sensitive info in this field. And do not send the string "null".
|
||||
pub creds_identifier: String,
|
||||
/// Merchant connector details type type. Base64 Encode the credentials and send it in this type and send as a string.
|
||||
#[schema(value_type = Option<MerchantConnectorDetails>, example = r#"{
|
||||
"connector_account_details": {
|
||||
"auth_type": "HeaderKey",
|
||||
"api_key":"sk_test_xxxxxexamplexxxxxx12345"
|
||||
},
|
||||
"metadata": {
|
||||
"user_defined_field_1": "sample_1",
|
||||
"user_defined_field_2": "sample_2",
|
||||
},
|
||||
}"#)]
|
||||
pub encoded_data: Option<Secret<String>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)]
|
||||
pub struct MerchantConnectorDetails {
|
||||
/// Account details of the Connector. You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Useful for storing additional, structured information on an object.
|
||||
#[schema(value_type = Option<Object>,example = json!({ "auth_type": "HeaderKey","api_key": "Basic MyVerySecretApiKey" }))]
|
||||
pub connector_account_details: pii::SecretSerdeValue,
|
||||
/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.
|
||||
#[schema(value_type = Option<Object>,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))]
|
||||
pub metadata: Option<pii::SecretSerdeValue>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user