Skip to content

Commit 5ba99f7

Browse files
committed
Merge branch 'main' of github.com:juspay/hyperswitch into pref/pool
2 parents 9ca0651 + aab8f60 commit 5ba99f7

File tree

162 files changed

+2880
-997
lines changed

Some content is hidden

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

162 files changed

+2880
-997
lines changed

.github/workflows/pr-title-check.yml renamed to .github/workflows/conventional-commit-check.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PR Title Checks
1+
name: Conventional Commit Message Check
22

33
on:
44
# This is a dangerous event trigger as it causes the workflow to run in the
@@ -35,21 +35,6 @@ env:
3535
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
3636

3737
jobs:
38-
typos:
39-
name: Spell check PR title
40-
runs-on: ubuntu-latest
41-
steps:
42-
- name: Store PR title in a file
43-
shell: bash
44-
env:
45-
TITLE: ${{ github.event.pull_request.title }}
46-
run: echo $TITLE > pr_title.txt
47-
48-
- name: Spell check
49-
uses: crate-ci/typos@master
50-
with:
51-
files: ./pr_title.txt
52-
5338
pr_title_check:
5439
name: Verify PR title follows conventional commit standards
5540
runs-on: ubuntu-latest
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: PR Title Spell Check
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
typos:
12+
name: Spell check PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Store PR title in a file
19+
shell: bash
20+
env:
21+
TITLE: ${{ github.event.pull_request.title }}
22+
run: echo $TITLE > pr_title.txt
23+
24+
- name: Spell check
25+
uses: crate-ci/typos@master
26+
with:
27+
files: ./pr_title.txt

CHANGELOG.md

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

55
- - -
66

7+
## 1.74.0 (2023-11-08)
8+
9+
### Features
10+
11+
- **core:** Use redis as temp locker instead of basilisk ([#2789](https://github.com/juspay/hyperswitch/pull/2789)) ([`6678689`](https://github.com/juspay/hyperswitch/commit/6678689265ae9a4fbb7a43c1938237d349c5a68e))
12+
- **events:** Add request details to api events ([#2769](https://github.com/juspay/hyperswitch/pull/2769)) ([`164d1c6`](https://github.com/juspay/hyperswitch/commit/164d1c66fbcb84104db07412496114db2f8c5c0c))
13+
- **router:** Add `gateway_status_map` interface ([#2804](https://github.com/juspay/hyperswitch/pull/2804)) ([`a429b23`](https://github.com/juspay/hyperswitch/commit/a429b23c7f21c9d08a79895c0b770b35aab725f7))
14+
- **test_utils:** Add custom-headers and custom delay support to rustman ([#2636](https://github.com/juspay/hyperswitch/pull/2636)) ([`1effddd`](https://github.com/juspay/hyperswitch/commit/1effddd0a0d3985d6df03c4ae9be28712befc05e))
15+
16+
### Bug Fixes
17+
18+
- **connector:** Add attempt_status in field in error_response ([#2794](https://github.com/juspay/hyperswitch/pull/2794)) ([`5642fef`](https://github.com/juspay/hyperswitch/commit/5642fef52a6d591d12c5745ed381f41a1593f183))
19+
20+
### Refactors
21+
22+
- **config:** Update payment method filter of Klarna in Stripe ([#2807](https://github.com/juspay/hyperswitch/pull/2807)) ([`21ce807`](https://github.com/juspay/hyperswitch/commit/21ce8079f4cb11d70c5eaae78f83773141c67d0c))
23+
- **router:** Add parameter connectors to get_request_body function ([#2708](https://github.com/juspay/hyperswitch/pull/2708)) ([`7623ea9`](https://github.com/juspay/hyperswitch/commit/7623ea93bee61b0bb22b68e86f44de17f04f876b))
24+
25+
### Documentation
26+
27+
- **README:** Update README ([#2800](https://github.com/juspay/hyperswitch/pull/2800)) ([`bef0a04`](https://github.com/juspay/hyperswitch/commit/bef0a04edc6323b3b7a2e0dd7eeb7954915ba7cf))
28+
29+
**Full Changelog:** [`v1.73.0...v1.74.0`](https://github.com/juspay/hyperswitch/compare/v1.73.0...v1.74.0)
30+
31+
- - -
32+
33+
734
## 1.73.0 (2023-11-07)
835

936
### Features

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/development.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ ideal = { country = "NL", currency = "EUR" }
248248
[pm_filters.stripe]
249249
google_pay = { country = "AL,DZ,AS,AO,AG,AR,AU,AT,AZ,BH,BY,BE,BR,BG,CA,CL,CO,HR,CZ,DK,DO,EG,EE,FI,FR,DE,GR,HK,HU,IN,ID,IE,IL,IT,JP,JO,KZ,KE,KW,LV,LB,LT,LU,MY,MX,NL,NZ,NO,OM,PK,PA,PE,PH,PL,PT,QA,RO,RU,SA,SG,SK,ZA,ES,LK,SE,CH,TW,TH,TR,UA,AE,GB,US,UY,VN" }
250250
apple_pay = { country = "AU,CN,HK,JP,MO,MY,NZ,SG,TW,AM,AT,AZ,BY,BE,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,GL,GG,HU,IS,IE,IM,IT,KZ,JE,LV,LI,LT,LU,MT,MD,MC,ME,NL,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,UA,GB,AR,CO,CR,BR,MX,PE,BH,IL,JO,KW,PS,QA,SA,AE,CA,UM,US,KR,VN,MA,ZA,VA,CL,SV,GT,HN,PA" }
251-
klarna = { country = "US", currency = "USD" }
251+
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,CAD,CHF,CZK,DKK,EUR,GBP,NOK,NZD,PLN,SEK,USD" }
252252
affirm = { country = "US", currency = "USD" }
253253
afterpay_clearpay = { country = "US,CA,GB,AU,NZ,FR,ES", currency = "USD,CAD,GBP,AUD,NZD" }
254254
giropay = { country = "DE", currency = "EUR" }

connector-template/mod.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ impl ConnectorCommon for {{project-name | downcase | pascal_case}} {
105105
code: response.code,
106106
message: response.message,
107107
reason: response.reason,
108+
attempt_status: None,
108109
})
109110
}
110111
}
@@ -156,7 +157,7 @@ impl
156157
Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
157158
}
158159

159-
fn get_request_body(&self, req: &types::PaymentsAuthorizeRouterData) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> {
160+
fn get_request_body(&self, req: &types::PaymentsAuthorizeRouterData, _connectors: &settings::Connectors,) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> {
160161
let connector_router_data =
161162
{{project-name | downcase}}::{{project-name | downcase | pascal_case}}RouterData::try_from((
162163
&self.get_currency_unit(),
@@ -185,7 +186,7 @@ impl
185186
.headers(types::PaymentsAuthorizeType::get_headers(
186187
self, req, connectors,
187188
)?)
188-
.body(types::PaymentsAuthorizeType::get_request_body(self, req)?)
189+
.body(types::PaymentsAuthorizeType::get_request_body(self, req, connectors)?)
189190
.build(),
190191
))
191192
}
@@ -301,6 +302,7 @@ impl
301302
fn get_request_body(
302303
&self,
303304
_req: &types::PaymentsCaptureRouterData,
305+
_connectors: &settings::Connectors,
304306
) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> {
305307
Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into())
306308
}
@@ -318,7 +320,7 @@ impl
318320
.headers(types::PaymentsCaptureType::get_headers(
319321
self, req, connectors,
320322
)?)
321-
.body(types::PaymentsCaptureType::get_request_body(self, req)?)
323+
.body(types::PaymentsCaptureType::get_request_body(self, req, connectors)?)
322324
.build(),
323325
))
324326
}
@@ -373,7 +375,7 @@ impl
373375
Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
374376
}
375377

376-
fn get_request_body(&self, req: &types::RefundsRouterData<api::Execute>) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> {
378+
fn get_request_body(&self, req: &types::RefundsRouterData<api::Execute>, _connectors: &settings::Connectors,) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> {
377379
let connector_router_data =
378380
{{project-name | downcase}}::{{project-name | downcase | pascal_case}}RouterData::try_from((
379381
&self.get_currency_unit(),
@@ -393,7 +395,7 @@ impl
393395
.url(&types::RefundExecuteType::get_url(self, req, connectors)?)
394396
.attach_default_headers()
395397
.headers(types::RefundExecuteType::get_headers(self, req, connectors)?)
396-
.body(types::RefundExecuteType::get_request_body(self, req)?)
398+
.body(types::RefundExecuteType::get_request_body(self, req, connectors)?)
397399
.build();
398400
Ok(Some(request))
399401
}
@@ -441,7 +443,7 @@ impl
441443
.url(&types::RefundSyncType::get_url(self, req, connectors)?)
442444
.attach_default_headers()
443445
.headers(types::RefundSyncType::get_headers(self, req, connectors)?)
444-
.body(types::RefundSyncType::get_request_body(self, req)?)
446+
.body(types::RefundSyncType::get_request_body(self, req, connectors)?)
445447
.build(),
446448
))
447449
}

crates/api_models/src/admin.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,8 @@ pub struct ToggleKVResponse {
893893

894894
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
895895
pub struct ToggleKVRequest {
896+
#[serde(skip_deserializing)]
897+
pub merchant_id: String,
896898
/// Status of KV for the specific merchant
897899
#[schema(example = true)]
898900
pub kv_enabled: bool,

crates/api_models/src/api_keys.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ pub struct UpdateApiKeyRequest {
129129
/// rotating your keys once every 6 months.
130130
#[schema(example = "2022-09-10T10:11:12Z")]
131131
pub expiration: Option<ApiKeyExpiration>,
132+
133+
#[serde(skip_deserializing)]
134+
pub key_id: String,
135+
136+
#[serde(skip_deserializing)]
137+
pub merchant_id: String,
132138
}
133139

134140
/// The response body for revoking an API Key.

crates/api_models/src/events.rs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
pub mod customer;
2+
pub mod payment;
3+
#[cfg(feature = "payouts")]
4+
pub mod payouts;
5+
pub mod refund;
6+
pub mod routing;
7+
8+
use common_utils::{
9+
events::{ApiEventMetric, ApiEventsType},
10+
impl_misc_api_event_type,
11+
};
12+
13+
use crate::{
14+
admin::*, api_keys::*, cards_info::*, disputes::*, files::*, mandates::*, payment_methods::*,
15+
payments::*, verifications::*,
16+
};
17+
18+
impl ApiEventMetric for TimeRange {}
19+
20+
impl_misc_api_event_type!(
21+
PaymentMethodId,
22+
PaymentsSessionResponse,
23+
PaymentMethodListResponse,
24+
PaymentMethodCreate,
25+
PaymentLinkInitiateRequest,
26+
RetrievePaymentLinkResponse,
27+
MandateListConstraints,
28+
CreateFileResponse,
29+
DisputeResponse,
30+
SubmitEvidenceRequest,
31+
MerchantConnectorResponse,
32+
MerchantConnectorId,
33+
MandateResponse,
34+
MandateRevokedResponse,
35+
RetrievePaymentLinkRequest,
36+
MandateId,
37+
DisputeListConstraints,
38+
RetrieveApiKeyResponse,
39+
BusinessProfileResponse,
40+
BusinessProfileUpdate,
41+
BusinessProfileCreate,
42+
RevokeApiKeyResponse,
43+
ToggleKVResponse,
44+
ToggleKVRequest,
45+
MerchantAccountDeleteResponse,
46+
MerchantAccountUpdate,
47+
CardInfoResponse,
48+
CreateApiKeyResponse,
49+
CreateApiKeyRequest,
50+
MerchantConnectorDeleteResponse,
51+
MerchantConnectorUpdate,
52+
MerchantConnectorCreate,
53+
MerchantId,
54+
CardsInfoRequest,
55+
MerchantAccountResponse,
56+
MerchantAccountListRequest,
57+
MerchantAccountCreate,
58+
PaymentsSessionRequest,
59+
ApplepayMerchantVerificationRequest,
60+
ApplepayMerchantResponse,
61+
ApplepayVerifiedDomainsResponse,
62+
UpdateApiKeyRequest
63+
);
64+
65+
#[cfg(feature = "stripe")]
66+
impl_misc_api_event_type!(
67+
StripeSetupIntentResponse,
68+
StripeRefundResponse,
69+
StripePaymentIntentListResponse,
70+
StripePaymentIntentResponse,
71+
CustomerDeleteResponse,
72+
CustomerPaymentMethodListResponse,
73+
CreateCustomerResponse
74+
);
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
use common_utils::events::{ApiEventMetric, ApiEventsType};
2+
3+
use crate::customers::{CustomerDeleteResponse, CustomerId, CustomerRequest, CustomerResponse};
4+
5+
impl ApiEventMetric for CustomerDeleteResponse {
6+
fn get_api_event_type(&self) -> Option<ApiEventsType> {
7+
Some(ApiEventsType::Customer {
8+
customer_id: self.customer_id.clone(),
9+
})
10+
}
11+
}
12+
13+
impl ApiEventMetric for CustomerRequest {
14+
fn get_api_event_type(&self) -> Option<ApiEventsType> {
15+
Some(ApiEventsType::Customer {
16+
customer_id: self.customer_id.clone(),
17+
})
18+
}
19+
}
20+
21+
impl ApiEventMetric for CustomerResponse {
22+
fn get_api_event_type(&self) -> Option<ApiEventsType> {
23+
Some(ApiEventsType::Customer {
24+
customer_id: self.customer_id.clone(),
25+
})
26+
}
27+
}
28+
29+
impl ApiEventMetric for CustomerId {
30+
fn get_api_event_type(&self) -> Option<ApiEventsType> {
31+
Some(ApiEventsType::Customer {
32+
customer_id: self.customer_id.clone(),
33+
})
34+
}
35+
}

0 commit comments

Comments
 (0)