Skip to content

Commit 640d055

Browse files
AkshayaFoigerhyperswitch-bot[bot]jagan-jaya
authored
feat(router): [worldpayvantiv] add dispute list sync and implement dispute (#8830)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Jagan <[email protected]>
1 parent 57e92c9 commit 640d055

Some content is hidden

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

69 files changed

+3579
-215
lines changed

api-reference/v1/openapi_spec_v1.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4140,6 +4140,16 @@
41404140
"schema": {
41414141
"type": "string"
41424142
}
4143+
},
4144+
{
4145+
"name": "force_sync",
4146+
"in": "query",
4147+
"description": "Decider to enable or disable the connector call for dispute retrieve request",
4148+
"required": false,
4149+
"schema": {
4150+
"type": "boolean",
4151+
"nullable": true
4152+
}
41434153
}
41444154
],
41454155
"responses": {
@@ -14348,7 +14358,9 @@
1434814358
"enum": [
1434914359
"pre_dispute",
1435014360
"dispute",
14351-
"pre_arbitration"
14361+
"pre_arbitration",
14362+
"arbitration",
14363+
"dispute_reversal"
1435214364
]
1435314365
},
1435414366
"DisputeStatus": {
@@ -28116,6 +28128,13 @@
2811628128
}
2811728129
],
2811828130
"nullable": true
28131+
},
28132+
"dispute_polling_interval": {
28133+
"type": "integer",
28134+
"format": "int32",
28135+
"description": "Time interval (in hours) for polling the connector to check dispute statuses",
28136+
"example": 2,
28137+
"nullable": true
2811928138
}
2812028139
},
2812128140
"additionalProperties": false
@@ -28434,6 +28453,13 @@
2843428453
}
2843528454
],
2843628455
"nullable": true
28456+
},
28457+
"dispute_polling_interval": {
28458+
"type": "integer",
28459+
"format": "int32",
28460+
"example": 2,
28461+
"nullable": true,
28462+
"minimum": 0
2843728463
}
2843828464
}
2843928465
},

api-reference/v2/openapi_spec_v2.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10404,7 +10404,9 @@
1040410404
"enum": [
1040510405
"pre_dispute",
1040610406
"dispute",
10407-
"pre_arbitration"
10407+
"pre_arbitration",
10408+
"arbitration",
10409+
"dispute_reversal"
1040810410
]
1040910411
},
1041010412
"DisputeStatus": {

config/config.example.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ worldline.base_url = "https://eu.sandbox.api-ingenico.com/"
316316
worldpay.base_url = "https://try.access.worldpay.com/"
317317
worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"
318318
worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"
319+
worldpayvantiv.third_base_url = "https://services.vantivprelive.com"
319320
worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"
320321
xendit.base_url = "https://api.xendit.co"
321322
zsl.base_url = "https://api.sitoffalb.net/"
@@ -1177,4 +1178,6 @@ enabled = false # Enable or disable chat features
11771178
hyperswitch_ai_host = "http://0.0.0.0:8000" # Hyperswitch ai workflow host
11781179

11791180
[proxy_status_mapping]
1180-
proxy_connector_http_status_code = false # If enabled, the http status code of the connector will be proxied in the response
1181+
proxy_connector_http_status_code = false # If enabled, the http status code of the connector will be proxied in the response
1182+
[list_dispute_supported_connectors]
1183+
connector_list = "worldpayvantiv"

config/deployments/integration_test.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ worldline.base_url = "https://eu.sandbox.api-ingenico.com/"
151151
worldpay.base_url = "https://try.access.worldpay.com/"
152152
worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"
153153
worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"
154+
worldpayvantiv.third_base_url = "https://services.vantivprelive.com"
154155
worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"
155156
xendit.base_url = "https://api.xendit.co"
156157
zen.base_url = "https://api.zen-test.com/"
@@ -824,3 +825,6 @@ retry_algorithm_type = "cascading"
824825

825826
[authentication_providers]
826827
click_to_pay = {connector_list = "adyen, cybersource, trustpay"}
828+
829+
[list_dispute_supported_connectors]
830+
connector_list = "worldpayvantiv"

config/deployments/production.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ worldline.base_url = "https://eu.api-ingenico.com/"
155155
worldpay.base_url = "https://access.worldpay.com/"
156156
worldpayvantiv.base_url = "https://transact.vantivcnp.com/vap/communicator/online"
157157
worldpayvantiv.secondary_base_url = "https://onlinessr.vantivcnp.com"
158+
worldpayvantiv.third_base_url = "https://services.vantivprelive.com" # pre-live environment
158159
worldpayxml.base_url = "https://secure.worldpay.com/jsp/merchant/xml/paymentService.jsp"
159160
xendit.base_url = "https://api.xendit.co"
160161
zen.base_url = "https://api.zen.com/"
@@ -837,3 +838,6 @@ click_to_pay = {connector_list = "adyen, cybersource, trustpay"}
837838
[revenue_recovery]
838839
monitoring_threshold_in_seconds = 2592000
839840
retry_algorithm_type = "cascading"
841+
842+
[list_dispute_supported_connectors]
843+
connector_list = "worldpayvantiv"

config/deployments/sandbox.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ worldline.base_url = "https://eu.sandbox.api-ingenico.com/"
155155
worldpay.base_url = "https://try.access.worldpay.com/"
156156
worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"
157157
worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"
158+
worldpayvantiv.third_base_url = "https://services.vantivprelive.com"
158159
worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"
159160
xendit.base_url = "https://api.xendit.co"
160161
zen.base_url = "https://api.zen-test.com/"
@@ -842,3 +843,6 @@ click_to_pay = {connector_list = "adyen, cybersource, trustpay"}
842843
[revenue_recovery]
843844
monitoring_threshold_in_seconds = 2592000
844845
retry_algorithm_type = "cascading"
846+
847+
[list_dispute_supported_connectors]
848+
connector_list = "worldpayvantiv"

config/development.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ worldline.base_url = "https://eu.sandbox.api-ingenico.com/"
346346
worldpay.base_url = "https://try.access.worldpay.com/"
347347
worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"
348348
worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"
349+
worldpayvantiv.third_base_url = "https://services.vantivprelive.com"
349350
worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"
350351
xendit.base_url = "https://api.xendit.co"
351352
trustpay.base_url = "https://test-tpgw.trustpay.eu/"
@@ -1279,4 +1280,6 @@ enabled = false
12791280
hyperswitch_ai_host = "http://0.0.0.0:8000"
12801281

12811282
[proxy_status_mapping]
1282-
proxy_connector_http_status_code = false # If enabled, the http status code of the connector will be proxied in the response
1283+
proxy_connector_http_status_code = false # If enabled, the http status code of the connector will be proxied in the response
1284+
[list_dispute_supported_connectors]
1285+
connector_list = "worldpayvantiv"

config/docker_compose.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ worldline.base_url = "https://eu.sandbox.api-ingenico.com/"
242242
worldpay.base_url = "https://try.access.worldpay.com/"
243243
worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"
244244
worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"
245+
worldpayvantiv.third_base_url = "https://services.vantivprelive.com"
245246
worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"
246247
xendit.base_url = "https://api.xendit.co"
247248
zen.base_url = "https://api.zen-test.com/"
@@ -1167,4 +1168,6 @@ cluster = "CLUSTER" # value of CLUSTER from deployment
11671168
version = "HOSTNAME" # value of HOSTNAME from deployment which tells its version
11681169

11691170
[proxy_status_mapping]
1170-
proxy_connector_http_status_code = false # If enabled, the http status code of the connector will be proxied in the response
1171+
proxy_connector_http_status_code = false # If enabled, the http status code of the connector will be proxied in the response
1172+
[list_dispute_supported_connectors]
1173+
connector_list = "worldpayvantiv"

crates/api_models/src/admin.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,6 +2183,10 @@ pub struct ProfileCreate {
21832183
/// It is used in payment processing, fraud detection, and regulatory compliance to determine regional rules and routing behavior.
21842184
#[schema(value_type = Option<MerchantCountryCode>, example = "840")]
21852185
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
2186+
2187+
/// Time interval (in hours) for polling the connector to check dispute statuses
2188+
#[schema(value_type = Option<i32>, example = 2)]
2189+
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
21862190
}
21872191

21882192
#[nutype::nutype(
@@ -2518,6 +2522,9 @@ pub struct ProfileResponse {
25182522
/// It is used in payment processing, fraud detection, and regulatory compliance to determine regional rules and routing behavior.
25192523
#[schema(value_type = Option<MerchantCountryCode>, example = "840")]
25202524
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
2525+
2526+
#[schema(value_type = Option<u32>, example = 2)]
2527+
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
25212528
}
25222529

25232530
#[cfg(feature = "v2")]
@@ -2846,6 +2853,9 @@ pub struct ProfileUpdate {
28462853
/// It is used in payment processing, fraud detection, and regulatory compliance to determine regional rules and routing behavior.
28472854
#[schema(value_type = Option<MerchantCountryCode>, example = "840")]
28482855
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
2856+
2857+
#[schema(value_type = Option<u32>, example = 2)]
2858+
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
28492859
}
28502860

28512861
#[cfg(feature = "v2")]

crates/api_models/src/disputes.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,26 @@ pub struct DeleteEvidenceRequest {
224224
pub evidence_type: EvidenceType,
225225
}
226226

227+
#[derive(Debug, Deserialize, Serialize)]
228+
pub struct DisputeRetrieveRequest {
229+
/// The identifier for dispute
230+
pub dispute_id: String,
231+
/// Decider to enable or disable the connector call for dispute retrieve request
232+
pub force_sync: Option<bool>,
233+
}
234+
227235
#[derive(Clone, Debug, serde::Serialize)]
228236
pub struct DisputesAggregateResponse {
229237
/// Different status of disputes with their count
230238
pub status_with_count: HashMap<DisputeStatus, i64>,
231239
}
232240

241+
#[derive(Debug, Deserialize, Serialize)]
242+
pub struct DisputeRetrieveBody {
243+
/// Decider to enable or disable the connector call for dispute retrieve request
244+
pub force_sync: Option<bool>,
245+
}
246+
233247
fn parse_comma_separated<'de, D, T>(v: D) -> Result<Option<Vec<T>>, D::Error>
234248
where
235249
D: serde::Deserializer<'de>,

0 commit comments

Comments
 (0)