Skip to content

Commit 52a55f8

Browse files
committed
Merge branch 'main' of https://github.com/juspay/hyperswitch into clone-connector
2 parents 4d1ca18 + 67f38f8 commit 52a55f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3540
-2952
lines changed

Cargo.lock

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api-reference-v2/openapi_spec.json

Lines changed: 76 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3265,6 +3265,64 @@
32653265
]
32663266
}
32673267
},
3268+
"/v2/refunds/{id}/update_metadata": {
3269+
"put": {
3270+
"tags": [
3271+
"Refunds"
3272+
],
3273+
"summary": "Refunds - Metadata Update",
3274+
"description": "Updates the properties of a Refund object. This API can be used to attach a reason for the refund or metadata fields",
3275+
"operationId": "Update Refund Metadata and Reason",
3276+
"parameters": [
3277+
{
3278+
"name": "id",
3279+
"in": "path",
3280+
"description": "The identifier for refund",
3281+
"required": true,
3282+
"schema": {
3283+
"type": "string"
3284+
}
3285+
}
3286+
],
3287+
"requestBody": {
3288+
"content": {
3289+
"application/json": {
3290+
"schema": {
3291+
"$ref": "#/components/schemas/RefundMetadataUpdateRequest"
3292+
},
3293+
"examples": {
3294+
"Update refund reason": {
3295+
"value": {
3296+
"reason": "Paid by mistake"
3297+
}
3298+
}
3299+
}
3300+
}
3301+
},
3302+
"required": true
3303+
},
3304+
"responses": {
3305+
"200": {
3306+
"description": "Refund updated",
3307+
"content": {
3308+
"application/json": {
3309+
"schema": {
3310+
"$ref": "#/components/schemas/RefundResponse"
3311+
}
3312+
}
3313+
}
3314+
},
3315+
"400": {
3316+
"description": "Missing Mandatory fields"
3317+
}
3318+
},
3319+
"security": [
3320+
{
3321+
"api_key": []
3322+
}
3323+
]
3324+
}
3325+
},
32683326
"/v2/refunds/{id}": {
32693327
"get": {
32703328
"tags": [
@@ -20629,6 +20687,24 @@
2062920687
}
2063020688
}
2063120689
},
20690+
"RefundMetadataUpdateRequest": {
20691+
"type": "object",
20692+
"properties": {
20693+
"reason": {
20694+
"type": "string",
20695+
"description": "An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive",
20696+
"example": "Customer returned the product",
20697+
"nullable": true,
20698+
"maxLength": 255
20699+
},
20700+
"metadata": {
20701+
"type": "object",
20702+
"description": "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.",
20703+
"nullable": true
20704+
}
20705+
},
20706+
"additionalProperties": false
20707+
},
2063220708
"RefundResponse": {
2063320709
"type": "object",
2063420710
"required": [
@@ -20737,24 +20813,6 @@
2073720813
"instant"
2073820814
]
2073920815
},
20740-
"RefundUpdateRequest": {
20741-
"type": "object",
20742-
"properties": {
20743-
"reason": {
20744-
"type": "string",
20745-
"description": "An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive",
20746-
"example": "Customer returned the product",
20747-
"nullable": true,
20748-
"maxLength": 255
20749-
},
20750-
"metadata": {
20751-
"type": "object",
20752-
"description": "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.",
20753-
"nullable": true
20754-
}
20755-
},
20756-
"additionalProperties": false
20757-
},
2075820816
"RefundsCreateRequest": {
2075920817
"type": "object",
2076020818
"required": [

config/config.example.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,13 @@ encryption_manager = "aws_kms" # Encryption manager client to be used
970970
key_id = "kms_key_id" # The AWS key ID used by the KMS SDK for decrypting data.
971971
region = "kms_region" # The AWS region used by the KMS SDK for decrypting data.
972972

973+
[crm]
974+
crm_manager = "hubspot_proxy" # Crm manager client to be used
975+
976+
[crm.hubspot_proxy]
977+
form_id="hubspot_proxy_form_id" # Form ID for Hubspot integration
978+
request_url="hubspot_proxy_request_url" # Request URL for Hubspot API
979+
973980
[opensearch]
974981
host = "https://localhost:9200"
975982
enabled = false

config/deployments/env_specific.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,14 @@ encryption_manager = "aws_kms" # Encryption manager client to be used
303303
key_id = "kms_key_id" # The AWS key ID used by the KMS SDK for decrypting data.
304304
region = "kms_region" # The AWS region used by the KMS SDK for decrypting data.
305305

306+
[crm]
307+
crm_manager = "hubspot_proxy" # Crm manager client to be used
308+
309+
[crm.hubspot_proxy]
310+
form_id="" # Form ID for Hubspot integration
311+
request_url="" # Request URL for Hubspot API
312+
313+
306314
[multitenancy]
307315
enabled = false
308316
global_tenant = { tenant_id = "global", schema = "public", redis_key_prefix = "", clickhouse_database = "default"}

crates/api_models/src/refunds.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,19 @@ pub struct RefundUpdateRequest {
166166
pub metadata: Option<pii::SecretSerdeValue>,
167167
}
168168

169+
#[cfg(all(feature = "v2", feature = "refunds_v2"))]
170+
#[derive(Default, Debug, ToSchema, Clone, Deserialize, Serialize)]
171+
#[serde(deny_unknown_fields)]
172+
pub struct RefundMetadataUpdateRequest {
173+
/// An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive
174+
#[schema(max_length = 255, example = "Customer returned the product")]
175+
pub reason: Option<String>,
176+
177+
/// 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.
178+
#[schema(value_type = Option<Object>, example = r#"{ "city": "NY", "unit": "245" }"#)]
179+
pub metadata: Option<pii::SecretSerdeValue>,
180+
}
181+
169182
#[derive(Default, Debug, ToSchema, Clone, Deserialize, Serialize)]
170183
#[serde(deny_unknown_fields)]
171184
pub struct RefundManualUpdateRequest {

crates/api_models/src/user/dashboard_metadata.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,13 @@ pub struct ProdIntent {
9999
pub business_type: Option<String>,
100100
pub business_identifier: Option<String>,
101101
pub business_website: Option<String>,
102-
pub poc_name: Option<String>,
103-
pub poc_contact: Option<String>,
102+
pub poc_name: Option<Secret<String>>,
103+
pub poc_contact: Option<Secret<String>>,
104104
pub comments: Option<String>,
105105
pub is_completed: bool,
106106
#[serde(default)]
107107
pub product_type: MerchantProductType,
108+
pub business_country_name: Option<String>,
108109
}
109110

110111
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]

crates/common_utils/src/consts.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,9 @@ pub const DEFAULT_CARD_TESTING_GUARD_EXPIRY_IN_SECS: i32 = 3600;
178178

179179
/// SOAP 1.1 Envelope Namespace
180180
pub const SOAP_ENV_NAMESPACE: &str = "http://schemas.xmlsoap.org/soap/envelope/";
181+
182+
/// The tag name used for identifying the host in metrics.
183+
pub const METRICS_HOST_TAG_NAME: &str = "host";
184+
185+
/// API client request timeout (in seconds)
186+
pub const REQUEST_TIME_OUT: u64 = 30;

crates/external_services/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ tonic-reflection = { version = "0.12.2", optional = true }
4141
tonic-types = { version = "0.12.2", optional = true }
4242
hyper-util = { version = "0.1.9", optional = true }
4343
http-body-util = { version = "0.1.2", optional = true }
44+
reqwest = { version = "0.11.27", features = ["rustls-tls"] }
45+
http = "0.2.12"
46+
url = { version = "2.5.0", features = ["serde"] }
47+
quick-xml = { version = "0.31.0", features = ["serialize"] }
4448

4549

4650
# First party crates

0 commit comments

Comments
 (0)