Skip to content

Commit a58ebf7

Browse files
committed
Merge branch 'main' of github.com:juspay/hyperswitch into ci/add-more-connectors
* 'main' of github.com:juspay/hyperswitch: ci: disable stripe in cypress (#7183) fix(router): [Cybersource] add flag to indicate final capture (#7085) fix: invalidate surcharge cache during update (#6907) chore(version): 2025.02.04.0 fix(samsung_pay): populate `payment_method_data` in the payment response (#7095) feat(router): add core changes for external authentication flow through unified_authentication_service (#7063) fix(connector): [NETCETERA] add `sdk-type` and `default-sdk-type` in netcetera authentication request (#7156)
2 parents c0d947f + ed8ef24 commit a58ebf7

File tree

36 files changed

+1380
-288
lines changed

36 files changed

+1380
-288
lines changed

.github/workflows/cypress-tests-runner.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ concurrency:
1313
env:
1414
CARGO_INCREMENTAL: 0
1515
CARGO_NET_RETRY: 10
16+
<<<<<<< HEAD
1617
PAYMENTS_CONNECTORS: "bluesnap cybersource nmi paypal stripe"
18+
=======
19+
PAYMENTS_CONNECTORS: "cybersource"
20+
>>>>>>> ed8ef2466b7f059ed0f534aa1f3fca9b5ecbeefd
1721
PAYOUTS_CONNECTORS: "wise"
1822
RUST_BACKTRACE: short
1923
RUSTUP_MAX_RETRIES: 10
@@ -190,7 +194,6 @@ jobs:
190194
uses: actions/setup-node@v4
191195
with:
192196
node-version: "20"
193-
cache: "npm"
194197

195198
- name: Install Cypress and dependencies
196199
if: ${{ env.RUN_TESTS == 'true' }}
@@ -378,7 +381,6 @@ jobs:
378381
uses: actions/setup-node@v4
379382
with:
380383
node-version: "20"
381-
cache: "npm"
382384

383385
- name: Install Cypress and dependencies
384386
if: ${{ env.RUN_TESTS == 'true' }}

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ All notable changes to HyperSwitch will be documented here.
44

55
- - -
66

7+
## 2025.02.04.0
8+
9+
### Features
10+
11+
- **router:** Add core changes for external authentication flow through unified_authentication_service ([#7063](https://github.com/juspay/hyperswitch/pull/7063)) ([`ae39374`](https://github.com/juspay/hyperswitch/commit/ae39374c6b41635e6c474b429fd1df59d30aa6dd))
12+
13+
### Bug Fixes
14+
15+
- **connector:** [NETCETERA] add `sdk-type` and `default-sdk-type` in netcetera authentication request ([#7156](https://github.com/juspay/hyperswitch/pull/7156)) ([`64a7afa`](https://github.com/juspay/hyperswitch/commit/64a7afa6d42270d96788119e666b97176cd753dd))
16+
- **samsung_pay:** Populate `payment_method_data` in the payment response ([#7095](https://github.com/juspay/hyperswitch/pull/7095)) ([`04a5e38`](https://github.com/juspay/hyperswitch/commit/04a5e3823671d389bb6370570d7424a9e1d30759))
17+
18+
### Miscellaneous Tasks
19+
20+
- Bump cypress to `v14.0.0` ([#7102](https://github.com/juspay/hyperswitch/pull/7102)) ([`0e9966a`](https://github.com/juspay/hyperswitch/commit/0e9966a54d87f55b0f5c54e4dccb80742674fe26))
21+
22+
**Full Changelog:** [`2025.01.31.0...2025.02.04.0`](https://github.com/juspay/hyperswitch/compare/2025.01.31.0...2025.02.04.0)
23+
24+
- - -
25+
726
## 2025.01.31.0
827

928
### Miscellaneous Tasks

api-reference-v2/openapi_spec.json

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19982,6 +19982,14 @@
1998219982
"format": "int32",
1998319983
"description": "Indicates maximum amount of time in minutes",
1998419984
"minimum": 0
19985+
},
19986+
"sdk_type": {
19987+
"allOf": [
19988+
{
19989+
"$ref": "#/components/schemas/SdkType"
19990+
}
19991+
],
19992+
"nullable": true
1998519993
}
1998619994
}
1998719995
},
@@ -20011,6 +20019,17 @@
2001120019
}
2001220020
}
2001320021
},
20022+
"SdkType": {
20023+
"type": "string",
20024+
"description": "Enum representing the type of 3DS SDK.",
20025+
"enum": [
20026+
"01",
20027+
"02",
20028+
"03",
20029+
"04",
20030+
"05"
20031+
]
20032+
},
2001420033
"SecretInfoToInitiateSdk": {
2001520034
"type": "object",
2001620035
"required": [
@@ -21474,8 +21493,7 @@
2147421493
"type": "object",
2147521494
"required": [
2147621495
"last4",
21477-
"card_network",
21478-
"type"
21496+
"card_network"
2147921497
],
2148021498
"properties": {
2148121499
"last4": {
@@ -21488,7 +21506,8 @@
2148821506
},
2148921507
"type": {
2149021508
"type": "string",
21491-
"description": "The type of payment method"
21509+
"description": "The type of payment method",
21510+
"nullable": true
2149221511
}
2149321512
}
2149421513
},
@@ -21845,6 +21864,17 @@
2184521864
"$ref": "#/components/schemas/WalletAdditionalDataForCard"
2184621865
}
2184721866
}
21867+
},
21868+
{
21869+
"type": "object",
21870+
"required": [
21871+
"samsung_pay"
21872+
],
21873+
"properties": {
21874+
"samsung_pay": {
21875+
"$ref": "#/components/schemas/WalletAdditionalDataForCard"
21876+
}
21877+
}
2184821878
}
2184921879
],
2185021880
"description": "Hyperswitch supports SDK integration with Apple Pay and Google Pay wallets. For other wallets, we integrate with their respective connectors, redirecting the customer to the connector for wallet payments. As a result, we don’t receive any payment method data in the confirm call for payments made through other wallets."

api-reference/openapi_spec.json

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24523,6 +24523,14 @@
2452324523
"format": "int32",
2452424524
"description": "Indicates maximum amount of time in minutes",
2452524525
"minimum": 0
24526+
},
24527+
"sdk_type": {
24528+
"allOf": [
24529+
{
24530+
"$ref": "#/components/schemas/SdkType"
24531+
}
24532+
],
24533+
"nullable": true
2452624534
}
2452724535
}
2452824536
},
@@ -24552,6 +24560,17 @@
2455224560
}
2455324561
}
2455424562
},
24563+
"SdkType": {
24564+
"type": "string",
24565+
"description": "Enum representing the type of 3DS SDK.",
24566+
"enum": [
24567+
"01",
24568+
"02",
24569+
"03",
24570+
"04",
24571+
"05"
24572+
]
24573+
},
2455524574
"SecretInfoToInitiateSdk": {
2455624575
"type": "object",
2455724576
"required": [
@@ -26083,8 +26102,7 @@
2608326102
"type": "object",
2608426103
"required": [
2608526104
"last4",
26086-
"card_network",
26087-
"type"
26105+
"card_network"
2608826106
],
2608926107
"properties": {
2609026108
"last4": {
@@ -26097,7 +26115,8 @@
2609726115
},
2609826116
"type": {
2609926117
"type": "string",
26100-
"description": "The type of payment method"
26118+
"description": "The type of payment method",
26119+
"nullable": true
2610126120
}
2610226121
}
2610326122
},
@@ -26454,6 +26473,17 @@
2645426473
"$ref": "#/components/schemas/WalletAdditionalDataForCard"
2645526474
}
2645626475
}
26476+
},
26477+
{
26478+
"type": "object",
26479+
"required": [
26480+
"samsung_pay"
26481+
],
26482+
"properties": {
26483+
"samsung_pay": {
26484+
"$ref": "#/components/schemas/WalletAdditionalDataForCard"
26485+
}
26486+
}
2645726487
}
2645826488
],
2645926489
"description": "Hyperswitch supports SDK integration with Apple Pay and Google Pay wallets. For other wallets, we integrate with their respective connectors, redirecting the customer to the connector for wallet payments. As a result, we don’t receive any payment method data in the confirm call for payments made through other wallets."

crates/api_models/src/payment_methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ pub struct PaymentMethodDataWalletInfo {
829829
pub card_network: String,
830830
/// The type of payment method
831831
#[serde(rename = "type")]
832-
pub card_type: String,
832+
pub card_type: Option<String>,
833833
}
834834

835835
impl From<payments::additional_info::WalletAdditionalDataForCard> for PaymentMethodDataWalletInfo {

crates/api_models/src/payments.rs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2601,6 +2601,7 @@ pub enum AdditionalPaymentData {
26012601
Wallet {
26022602
apple_pay: Option<ApplepayPaymentMethod>,
26032603
google_pay: Option<additional_info::WalletAdditionalDataForCard>,
2604+
samsung_pay: Option<additional_info::WalletAdditionalDataForCard>,
26042605
},
26052606
PayLater {
26062607
klarna_sdk: Option<KlarnaSdkPaymentMethod>,
@@ -3874,6 +3875,8 @@ pub enum WalletResponseData {
38743875
ApplePay(Box<additional_info::WalletAdditionalDataForCard>),
38753876
#[schema(value_type = WalletAdditionalDataForCard)]
38763877
GooglePay(Box<additional_info::WalletAdditionalDataForCard>),
3878+
#[schema(value_type = WalletAdditionalDataForCard)]
3879+
SamsungPay(Box<additional_info::WalletAdditionalDataForCard>),
38773880
}
38783881

38793882
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
@@ -5410,8 +5413,9 @@ impl From<AdditionalPaymentData> for PaymentMethodDataResponse {
54105413
AdditionalPaymentData::Wallet {
54115414
apple_pay,
54125415
google_pay,
5413-
} => match (apple_pay, google_pay) {
5414-
(Some(apple_pay_pm), _) => Self::Wallet(Box::new(WalletResponse {
5416+
samsung_pay,
5417+
} => match (apple_pay, google_pay, samsung_pay) {
5418+
(Some(apple_pay_pm), _, _) => Self::Wallet(Box::new(WalletResponse {
54155419
details: Some(WalletResponseData::ApplePay(Box::new(
54165420
additional_info::WalletAdditionalDataForCard {
54175421
last4: apple_pay_pm
@@ -5425,13 +5429,16 @@ impl From<AdditionalPaymentData> for PaymentMethodDataResponse {
54255429
.rev()
54265430
.collect::<String>(),
54275431
card_network: apple_pay_pm.network.clone(),
5428-
card_type: apple_pay_pm.pm_type.clone(),
5432+
card_type: Some(apple_pay_pm.pm_type.clone()),
54295433
},
54305434
))),
54315435
})),
5432-
(_, Some(google_pay_pm)) => Self::Wallet(Box::new(WalletResponse {
5436+
(_, Some(google_pay_pm), _) => Self::Wallet(Box::new(WalletResponse {
54335437
details: Some(WalletResponseData::GooglePay(Box::new(google_pay_pm))),
54345438
})),
5439+
(_, _, Some(samsung_pay_pm)) => Self::Wallet(Box::new(WalletResponse {
5440+
details: Some(WalletResponseData::SamsungPay(Box::new(samsung_pay_pm))),
5441+
})),
54355442
_ => Self::Wallet(Box::new(WalletResponse { details: None })),
54365443
},
54375444
AdditionalPaymentData::BankRedirect { bank_name, details } => {
@@ -6548,6 +6555,23 @@ pub struct SdkInformation {
65486555
pub sdk_reference_number: String,
65496556
/// Indicates maximum amount of time in minutes
65506557
pub sdk_max_timeout: u8,
6558+
/// Indicates the type of 3DS SDK
6559+
pub sdk_type: Option<SdkType>,
6560+
}
6561+
6562+
/// Enum representing the type of 3DS SDK.
6563+
#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)]
6564+
pub enum SdkType {
6565+
#[serde(rename = "01")]
6566+
DefaultSdk,
6567+
#[serde(rename = "02")]
6568+
SplitSdk,
6569+
#[serde(rename = "03")]
6570+
LimitedSdk,
6571+
#[serde(rename = "04")]
6572+
BrowserSdk,
6573+
#[serde(rename = "05")]
6574+
ShellSdk,
65516575
}
65526576

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

crates/api_models/src/payments/additional_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,5 +219,5 @@ pub struct WalletAdditionalDataForCard {
219219
pub card_network: String,
220220
/// The type of payment method
221221
#[serde(rename = "type")]
222-
pub card_type: String,
222+
pub card_type: Option<String>,
223223
}

crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ pub enum CybersourcePaymentInitiatorTypes {
417417
pub struct CaptureOptions {
418418
capture_sequence_number: u32,
419419
total_capture_count: u32,
420+
is_final: Option<bool>,
420421
}
421422

422423
#[derive(Debug, Serialize)]
@@ -2142,11 +2143,18 @@ impl TryFrom<&CybersourceRouterData<&PaymentsCaptureRouterData>>
21422143
.clone()
21432144
.map(convert_metadata_to_merchant_defined_info);
21442145

2146+
let is_final = matches!(
2147+
item.router_data.request.capture_method,
2148+
Some(enums::CaptureMethod::Manual)
2149+
)
2150+
.then_some(true);
2151+
21452152
Ok(Self {
21462153
processing_information: ProcessingInformation {
21472154
capture_options: Some(CaptureOptions {
21482155
capture_sequence_number: 1,
21492156
total_capture_count: 1,
2157+
is_final,
21502158
}),
21512159
action_list: None,
21522160
action_token_types: None,

crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ use hyperswitch_domain_models::{
1313
access_token_auth::AccessTokenAuth,
1414
payments::{Authorize, Capture, PSync, PaymentMethodToken, Session, SetupMandate, Void},
1515
refunds::{Execute, RSync},
16-
PostAuthenticate, PreAuthenticate,
16+
Authenticate, PostAuthenticate, PreAuthenticate,
1717
},
1818
router_request_types::{
1919
unified_authentication_service::{
20-
UasAuthenticationResponseData, UasPostAuthenticationRequestData,
21-
UasPreAuthenticationRequestData,
20+
UasAuthenticationRequestData, UasAuthenticationResponseData,
21+
UasPostAuthenticationRequestData, UasPreAuthenticationRequestData,
2222
},
2323
AccessTokenRequestData, PaymentMethodTokenizationData, PaymentsAuthorizeData,
2424
PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
@@ -71,6 +71,7 @@ impl api::PaymentToken for UnifiedAuthenticationService {}
7171
impl api::UnifiedAuthenticationService for UnifiedAuthenticationService {}
7272
impl api::UasPreAuthentication for UnifiedAuthenticationService {}
7373
impl api::UasPostAuthentication for UnifiedAuthenticationService {}
74+
impl api::UasAuthentication for UnifiedAuthenticationService {}
7475

7576
impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
7677
for UnifiedAuthenticationService
@@ -209,8 +210,16 @@ impl
209210
)?;
210211
let amount = utils::convert_amount(
211212
self.amount_converter,
212-
transaction_details.amount,
213-
transaction_details.currency,
213+
transaction_details
214+
.amount
215+
.ok_or(errors::ConnectorError::MissingRequiredField {
216+
field_name: "amount",
217+
})?,
218+
transaction_details
219+
.currency
220+
.ok_or(errors::ConnectorError::MissingRequiredField {
221+
field_name: "currency",
222+
})?,
214223
)?;
215224

216225
let connector_router_data =
@@ -366,6 +375,11 @@ impl
366375
}
367376
}
368377

378+
impl ConnectorIntegration<Authenticate, UasAuthenticationRequestData, UasAuthenticationResponseData>
379+
for UnifiedAuthenticationService
380+
{
381+
}
382+
369383
impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData>
370384
for UnifiedAuthenticationService
371385
{

0 commit comments

Comments
 (0)