Skip to content

Commit 3cf499e

Browse files
committed
Merge branch 'add_encryption_service' of github.com:juspay/hyperswitch into add_encryption_service
2 parents 9066dc2 + 49b7774 commit 3cf499e

32 files changed

+828
-339
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ crates/router/src/connector/ @juspay/hyperswitch-connector
4040
crates/router/tests/connectors/ @juspay/hyperswitch-connector
4141
crates/test_utils/tests/connectors/ @juspay/hyperswitch-connector
4242
crates/test_utils/tests/sample_auth.toml @juspay/hyperswitch-connector
43+
crates/connector_configs/ @juspay/hyperswitch-connector
4344

4445
crates/router/src/compatibility/ @juspay/hyperswitch-compatibility
4546

crates/router/src/connector/razorpay.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use common_utils::{
77
use error_stack::{Report, ResultExt};
88
use masking::ExposeInterface;
99
use transformers as razorpay;
10+
use types::domain;
1011

1112
use super::utils::{self as connector_utils};
1213
use crate::{
@@ -640,6 +641,16 @@ impl api::IncomingWebhook for Razorpay {
640641
}
641642
}
642643

644+
async fn verify_webhook_source(
645+
&self,
646+
_request: &api::IncomingWebhookRequestDetails<'_>,
647+
_merchant_account: &domain::MerchantAccount,
648+
_merchant_connector_account: domain::MerchantConnectorAccount,
649+
_connector_label: &str,
650+
) -> CustomResult<bool, errors::ConnectorError> {
651+
Ok(false)
652+
}
653+
643654
fn get_webhook_event_type(
644655
&self,
645656
request: &api::IncomingWebhookRequestDetails<'_>,

cypress-tests/cypress/e2e/PaymentTest/00000-AccountCreate.cy.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import apiKeyCreateBody from "../../fixtures/create-api-key-body.json";
2-
import merchantCreateBody from "../../fixtures/merchant-create-body.json";
31
import State from "../../utils/State";
2+
import * as fixtures from "../../fixtures/imports";
43

54
let globalState;
65
describe("Account Create flow test", () => {
@@ -15,10 +14,10 @@ describe("Account Create flow test", () => {
1514
});
1615

1716
it("merchant-create-call-test", () => {
18-
cy.merchantCreateCallTest(merchantCreateBody, globalState);
17+
cy.merchantCreateCallTest(fixtures.merchantCreateBody, globalState);
1918
});
2019

2120
it("api-key-create-call-test", () => {
22-
cy.apiKeyCreateTest(apiKeyCreateBody, globalState);
21+
cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState);
2322
});
2423
});

cypress-tests/cypress/e2e/PaymentTest/00001-CustomerCreate.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import customerCreateBody from "../../fixtures/create-customer-body.json";
1+
import * as fixtures from "../../fixtures/imports";
22
import State from "../../utils/State";
33

44
let globalState;
@@ -15,6 +15,6 @@ describe("Customer Create flow test", () => {
1515
});
1616

1717
it("customer-create-call-test", () => {
18-
cy.createCustomerCallTest(customerCreateBody, globalState);
18+
cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
1919
});
2020
});

cypress-tests/cypress/e2e/PaymentTest/00002-ConnectorCreate.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import createConnectorBody from "../../fixtures/create-connector-body.json";
1+
import * as fixtures from "../../fixtures/imports";
22
import State from "../../utils/State";
33
import { payment_methods_enabled } from "../PaymentUtils/Commons";
44

@@ -16,7 +16,7 @@ describe("Connector Account Create flow test", () => {
1616

1717
it("connector-create-call-test", () => {
1818
cy.createConnectorCallTest(
19-
createConnectorBody,
19+
fixtures.createConnectorBody,
2020
payment_methods_enabled,
2121
globalState
2222
);

cypress-tests/cypress/e2e/PaymentTest/00003-NoThreeDSAutoCapture.cy.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import confirmBody from "../../fixtures/confirm-body.json";
2-
import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
3-
import createPaymentBody from "../../fixtures/create-payment-body.json";
1+
import * as fixtures from "../../fixtures/imports";
42
import State from "../../utils/State";
5-
import getConnectorDetails from "../PaymentUtils/utils";
6-
import * as utils from "../PaymentUtils/utils";
3+
import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
74

85
let globalState;
96

@@ -34,7 +31,7 @@ describe("Card - NoThreeDS payment flow test", () => {
3431
let req_data = data["Request"];
3532
let res_data = data["Response"];
3633
cy.createPaymentIntentTest(
37-
createPaymentBody,
34+
fixtures.createPaymentBody,
3835
req_data,
3936
res_data,
4037
"no_three_ds",
@@ -55,7 +52,13 @@ describe("Card - NoThreeDS payment flow test", () => {
5552
];
5653
let req_data = data["Request"];
5754
let res_data = data["Response"];
58-
cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
55+
cy.confirmCallTest(
56+
fixtures.confirmBody,
57+
req_data,
58+
res_data,
59+
true,
60+
globalState
61+
);
5962
if (should_continue)
6063
should_continue = utils.should_continue_further(res_data);
6164
});
@@ -82,7 +85,7 @@ describe("Card - NoThreeDS payment flow test", () => {
8285
let req_data = data["Request"];
8386
let res_data = data["Response"];
8487
cy.createConfirmPaymentTest(
85-
createConfirmPaymentBody,
88+
fixtures.createConfirmPaymentBody,
8689
req_data,
8790
res_data,
8891
"no_three_ds",

cypress-tests/cypress/e2e/PaymentTest/00004-ThreeDSAutoCapture.cy.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import confirmBody from "../../fixtures/confirm-body.json";
2-
import createPaymentBody from "../../fixtures/create-payment-body.json";
1+
import * as fixtures from "../../fixtures/imports";
32
import State from "../../utils/State";
4-
import getConnectorDetails from "../PaymentUtils/utils";
5-
import * as utils from "../PaymentUtils/utils";
3+
import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
64

75
let globalState;
86

@@ -32,7 +30,7 @@ describe("Card - ThreeDS payment flow test", () => {
3230
let req_data = data["Request"];
3331
let res_data = data["Response"];
3432
cy.createPaymentIntentTest(
35-
createPaymentBody,
33+
fixtures.createPaymentBody,
3634
req_data,
3735
res_data,
3836
"three_ds",
@@ -53,13 +51,19 @@ describe("Card - ThreeDS payment flow test", () => {
5351
];
5452
let req_data = data["Request"];
5553
let res_data = data["Response"];
56-
cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
54+
cy.confirmCallTest(
55+
fixtures.confirmBody,
56+
req_data,
57+
res_data,
58+
true,
59+
globalState
60+
);
5761
if (should_continue)
5862
should_continue = utils.should_continue_further(res_data);
5963
});
6064

6165
it("Handle redirection", () => {
62-
let expected_redirection = confirmBody["return_url"];
66+
let expected_redirection = fixtures.confirmBody["return_url"];
6367
cy.handleRedirection(globalState, expected_redirection);
6468
});
6569
});

cypress-tests/cypress/e2e/PaymentTest/00005-NoThreeDSManualCapture.cy.js

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import captureBody from "../../fixtures/capture-flow-body.json";
2-
import confirmBody from "../../fixtures/confirm-body.json";
3-
import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
4-
import createPaymentBody from "../../fixtures/create-payment-body.json";
1+
import * as fixtures from "../../fixtures/imports";
52
import State from "../../utils/State";
6-
import getConnectorDetails from "../PaymentUtils/utils";
7-
import * as utils from "../PaymentUtils/utils";
3+
import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
84

95
let globalState;
106

@@ -36,7 +32,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
3632
let req_data = data["Request"];
3733
let res_data = data["Response"];
3834
cy.createPaymentIntentTest(
39-
createPaymentBody,
35+
fixtures.createPaymentBody,
4036
req_data,
4137
res_data,
4238
"no_three_ds",
@@ -59,7 +55,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
5955
let req_data = data["Request"];
6056
let res_data = data["Response"];
6157
console.log("det -> " + data.card);
62-
cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
58+
cy.confirmCallTest(
59+
fixtures.confirmBody,
60+
req_data,
61+
res_data,
62+
true,
63+
globalState
64+
);
6365
if (should_continue)
6466
should_continue = utils.should_continue_further(res_data);
6567
});
@@ -75,7 +77,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
7577
let req_data = data["Request"];
7678
let res_data = data["Response"];
7779
console.log("det -> " + data.card);
78-
cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
80+
cy.captureCallTest(
81+
fixtures.captureBody,
82+
req_data,
83+
res_data,
84+
6500,
85+
globalState
86+
);
7987
if (should_continue)
8088
should_continue = utils.should_continue_further(res_data);
8189
});
@@ -103,7 +111,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
103111
let res_data = data["Response"];
104112
console.log("det -> " + data.card);
105113
cy.createConfirmPaymentTest(
106-
createConfirmPaymentBody,
114+
fixtures.createConfirmPaymentBody,
107115
req_data,
108116
res_data,
109117
"no_three_ds",
@@ -125,7 +133,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
125133
let req_data = data["Request"];
126134
let res_data = data["Response"];
127135
console.log("det -> " + data.card);
128-
cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
136+
cy.captureCallTest(
137+
fixtures.captureBody,
138+
req_data,
139+
res_data,
140+
6500,
141+
globalState
142+
);
129143
if (should_continue)
130144
should_continue = utils.should_continue_further(res_data);
131145
});
@@ -155,7 +169,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
155169
let req_data = data["Request"];
156170
let res_data = data["Response"];
157171
cy.createPaymentIntentTest(
158-
createPaymentBody,
172+
fixtures.createPaymentBody,
159173
req_data,
160174
res_data,
161175
"no_three_ds",
@@ -179,7 +193,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
179193
let res_data = data["Response"];
180194
console.log("det -> " + data.card);
181195
cy.confirmCallTest(
182-
confirmBody,
196+
fixtures.confirmBody,
183197
req_data,
184198
res_data,
185199
true,
@@ -199,7 +213,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
199213
]["PartialCapture"];
200214
let req_data = data["Request"];
201215
let res_data = data["Response"];
202-
cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
216+
cy.captureCallTest(
217+
fixtures.captureBody,
218+
req_data,
219+
res_data,
220+
100,
221+
globalState
222+
);
203223
if (should_continue)
204224
should_continue = utils.should_continue_further(res_data);
205225
});
@@ -227,7 +247,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
227247
let res_data = data["Response"];
228248
console.log("det -> " + data.card);
229249
cy.createConfirmPaymentTest(
230-
createConfirmPaymentBody,
250+
fixtures.createConfirmPaymentBody,
231251
req_data,
232252
res_data,
233253
"no_three_ds",
@@ -249,7 +269,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
249269
let req_data = data["Request"];
250270
let res_data = data["Response"];
251271
console.log("det -> " + data.card);
252-
cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
272+
cy.captureCallTest(
273+
fixtures.captureBody,
274+
req_data,
275+
res_data,
276+
100,
277+
globalState
278+
);
253279
if (should_continue)
254280
should_continue = utils.should_continue_further(res_data);
255281
});

cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import confirmBody from "../../fixtures/confirm-body.json";
2-
import createPaymentBody from "../../fixtures/create-payment-body.json";
3-
import voidBody from "../../fixtures/void-payment-body.json";
1+
import * as fixtures from "../../fixtures/imports";
42
import State from "../../utils/State";
5-
import getConnectorDetails, * as utils from "../PaymentUtils/utils";
3+
import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
64

75
let globalState;
86

@@ -33,7 +31,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
3331
let req_data = data["Request"];
3432
let res_data = data["Response"];
3533
cy.createPaymentIntentTest(
36-
createPaymentBody,
34+
fixtures.createPaymentBody,
3735
req_data,
3836
res_data,
3937
"no_three_ds",
@@ -56,7 +54,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
5654
let req_data = data["Request"];
5755
let res_data = data["Response"];
5856
console.log("det -> " + data.card);
59-
cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
57+
cy.confirmCallTest(
58+
fixtures.confirmBody,
59+
req_data,
60+
res_data,
61+
true,
62+
globalState
63+
);
6064
if (should_continue)
6165
should_continue = utils.should_continue_further(res_data);
6266
});
@@ -67,7 +71,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
6771
];
6872
let req_data = data["Request"];
6973
let res_data = data["Response"];
70-
cy.voidCallTest(voidBody, req_data, res_data, globalState);
74+
cy.voidCallTest(fixtures.voidBody, req_data, res_data, globalState);
7175
if (should_continue)
7276
should_continue = utils.should_continue_further(res_data);
7377
});
@@ -91,7 +95,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
9195
let req_data = data["Request"];
9296
let res_data = data["Response"];
9397
cy.createPaymentIntentTest(
94-
createPaymentBody,
98+
fixtures.createPaymentBody,
9599
req_data,
96100
res_data,
97101
"no_three_ds",
@@ -112,7 +116,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
112116
]["Void"];
113117
let req_data = data["Request"];
114118
let res_data = data["Response"];
115-
cy.voidCallTest(voidBody, req_data, res_data, globalState);
119+
cy.voidCallTest(fixtures.voidBody, req_data, res_data, globalState);
116120
if (should_continue)
117121
should_continue = utils.should_continue_further(res_data);
118122
});
@@ -137,7 +141,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
137141
let req_data = data["Request"];
138142
let res_data = data["Response"];
139143
cy.createPaymentIntentTest(
140-
createPaymentBody,
144+
fixtures.createPaymentBody,
141145
req_data,
142146
res_data,
143147
"no_three_ds",
@@ -160,7 +164,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
160164
let req_data = data["Request"];
161165
let res_data = data["Response"];
162166
console.log("det -> " + data.card);
163-
cy.confirmCallTest(confirmBody, req_data, res_data, false, globalState);
167+
cy.confirmCallTest(
168+
fixtures.confirmBody,
169+
req_data,
170+
res_data,
171+
false,
172+
globalState
173+
);
164174
if (should_continue)
165175
should_continue = utils.should_continue_further(res_data);
166176
});
@@ -171,7 +181,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
171181
]["Void"];
172182
let req_data = data["Request"];
173183
let res_data = data["Response"];
174-
cy.voidCallTest(voidBody, req_data, res_data, globalState);
184+
cy.voidCallTest(fixtures.voidBody, req_data, res_data, globalState);
175185
if (should_continue)
176186
should_continue = utils.should_continue_further(res_data);
177187
});

0 commit comments

Comments
 (0)