Skip to content

Commit

Permalink
Merge branch 'main' into bsilah/feature-Braintree-sync-with-hyperswit…
Browse files Browse the repository at this point in the history
…ch-reference
  • Loading branch information
prasunna09 authored Dec 5, 2023
2 parents abf2c7b + cfafd5c commit 74adf42
Show file tree
Hide file tree
Showing 146 changed files with 9,659 additions and 853 deletions.
54 changes: 54 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,60 @@ crates/router/src/core/routing.rs @juspay/hyperswitch-routing
crates/router/src/core/payments/routing @juspay/hyperswitch-routing
crates/router/src/core/payments/routing.rs @juspay/hyperswitch-routing

crates/api_models/src/connector_onboarding.rs @juspay/hyperswitch-dashboard
crates/api_models/src/user @juspay/hyperswitch-dashboard
crates/api_models/src/user.rs @juspay/hyperswitch-dashboard
crates/api_models/src/user_role.rs @juspay/hyperswitch-dashboard
crates/api_models/src/verify_connector.rs @juspay/hyperswitch-dashboard
crates/api_models/src/connector_onboarding.rs @juspay/hyperswitch-dashboard
crates/diesel_models/src/query/dashboard_metadata.rs @juspay/hyperswitch-dashboard
crates/diesel_models/src/query/user @juspay/hyperswitch-dashboard
crates/diesel_models/src/query/user_role.rs @juspay/hyperswitch-dashboard
crates/diesel_models/src/query/user.rs @juspay/hyperswitch-dashboard
crates/diesel_models/src/user @juspay/hyperswitch-dashboard
crates/diesel_models/src/user.rs @juspay/hyperswitch-dashboard
crates/diesel_models/src/user_role.rs @juspay/hyperswitch-dashboard
crates/router/src/consts/user.rs @juspay/hyperswitch-dashboard
crates/router/src/consts/user_role.rs @juspay/hyperswitch-dashboard
crates/router/src/core/connector_onboarding @juspay/hyperswitch-dashboard
crates/router/src/core/connector_onboarding.rs @juspay/hyperswitch-dashboard
crates/router/src/core/errors/user.rs @juspay/hyperswitch-dashboard
crates/router/src/core/errors/user @juspay/hyperswitch-dashboard
crates/router/src/core/user @juspay/hyperswitch-dashboard
crates/router/src/core/user.rs @juspay/hyperswitch-dashboard
crates/router/src/core/user_role.rs @juspay/hyperswitch-dashboard
crates/router/src/core/verify_connector.rs @juspay/hyperswitch-dashboard
crates/router/src/db/dashboard_metadata.rs @juspay/hyperswitch-dashboard
crates/router/src/db/user @juspay/hyperswitch-dashboard
crates/router/src/db/user.rs @juspay/hyperswitch-dashboard
crates/router/src/db/user_role.rs @juspay/hyperswitch-dashboard
crates/router/src/routes/connector_onboarding.rs @juspay/hyperswitch-dashboard
crates/router/src/routes/dummy_connector @juspay/hyperswitch-dashboard
crates/router/src/routes/dummy_connector.rs @juspay/hyperswitch-dashboard
crates/router/src/routes/user.rs @juspay/hyperswitch-dashboard
crates/router/src/routes/user_role.rs @juspay/hyperswitch-dashboard
crates/router/src/routes/verify_connector.rs @juspay/hyperswitch-dashboard
crates/router/src/services/authentication.rs @juspay/hyperswitch-dashboard
crates/router/src/services/authorization @juspay/hyperswitch-dashboard
crates/router/src/services/authorization.rs @juspay/hyperswitch-dashboard
crates/router/src/services/jwt.rs @juspay/hyperswitch-dashboard
crates/router/src/services/email/types.rs @juspay/hyperswitch-dashboard
crates/router/src/types/api/connector_onboarding @juspay/hyperswitch-dashboard
crates/router/src/types/api/connector_onboarding.rs @juspay/hyperswitch-dashboard
crates/router/src/types/api/verify_connector @juspay/hyperswitch-dashboard
crates/router/src/types/api/verify_connector.rs @juspay/hyperswitch-dashboard
crates/router/src/types/domain/user @juspay/hyperswitch-dashboard
crates/router/src/types/domain/user.rs @juspay/hyperswitch-dashboard
crates/router/src/types/storage/user.rs @juspay/hyperswitch-dashboard
crates/router/src/types/storage/user_role.rs @juspay/hyperswitch-dashboard
crates/router/src/types/storage/dashboard_metadata.rs @juspay/hyperswitch-dashboard
crates/router/src/utils/connector_onboarding @juspay/hyperswitch-dashboard
crates/router/src/utils/connector_onboarding.rs @juspay/hyperswitch-dashboard
crates/router/src/utils/user @juspay/hyperswitch-dashboard
crates/router/src/utils/user.rs @juspay/hyperswitch-dashboard
crates/router/src/utils/user_role.rs @juspay/hyperswitch-dashboard
crates/router/src/utils/verify_connector.rs @juspay/hyperswitch-dashboard

crates/router/src/scheduler/ @juspay/hyperswitch-process-tracker

Dockerfile @juspay/hyperswitch-infra
Expand Down
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,67 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 1.96.0 (2023-12-05)

### Features

- **connector_onboarding:** Add Connector onboarding APIs ([#3050](https://github.com/juspay/hyperswitch/pull/3050)) ([`7bd6e05`](https://github.com/juspay/hyperswitch/commit/7bd6e05c0c05ebae9b82a6f410e61ca4409d088b))
- **pm_list:** Add required fields for bancontact_card for Mollie, Adyen and Stripe ([#3035](https://github.com/juspay/hyperswitch/pull/3035)) ([`792e642`](https://github.com/juspay/hyperswitch/commit/792e642ad58f90bae3ddcea5e6cbc70e948d8e28))
- **user:** Add email apis and new enums for metadata ([#3053](https://github.com/juspay/hyperswitch/pull/3053)) ([`1c3d260`](https://github.com/juspay/hyperswitch/commit/1c3d260dc3e18fbf6cbd5122122a6c73dceb39a3))
- Implement FRM flows ([#2968](https://github.com/juspay/hyperswitch/pull/2968)) ([`055d838`](https://github.com/juspay/hyperswitch/commit/055d8383671f6b466297c177bcc770618c7da96a))

### Bug Fixes

- Remove redundant call to populate_payment_data function ([#3054](https://github.com/juspay/hyperswitch/pull/3054)) ([`53df543`](https://github.com/juspay/hyperswitch/commit/53df543b7f1407a758232025b7de0fb527be8e86))

### Documentation

- **test_utils:** Update postman docs ([#3055](https://github.com/juspay/hyperswitch/pull/3055)) ([`8b7a7aa`](https://github.com/juspay/hyperswitch/commit/8b7a7aa6494ff669e1f8bcc92a5160e422d6b26e))

**Full Changelog:** [`v1.95.0...v1.96.0`](https://github.com/juspay/hyperswitch/compare/v1.95.0...v1.96.0)

- - -


## 1.95.0 (2023-12-05)

### Features

- **connector:** [BOA/CYBERSOURCE] Fix Status Mapping for Terminal St… ([#3031](https://github.com/juspay/hyperswitch/pull/3031)) ([`95876b0`](https://github.com/juspay/hyperswitch/commit/95876b0ce03e024edf77909502c53eb4e63a9855))
- **pm_list:** Add required field for open_banking_uk for Adyen and Volt Connector ([#3032](https://github.com/juspay/hyperswitch/pull/3032)) ([`9d93533`](https://github.com/juspay/hyperswitch/commit/9d935332193dcc9f191a0a5a9e7405316794a418))
- **router:**
- Add key_value to locker metrics ([#2995](https://github.com/juspay/hyperswitch/pull/2995)) ([`83fcd1a`](https://github.com/juspay/hyperswitch/commit/83fcd1a9deb106a44c8262923c7f1660b0c46bf2))
- Add payments incremental authorization api ([#3038](https://github.com/juspay/hyperswitch/pull/3038)) ([`a0cfdd3`](https://github.com/juspay/hyperswitch/commit/a0cfdd3fb12f04b603f65551eac985c31e08da85))
- **types:** Add email types for sending emails ([#3020](https://github.com/juspay/hyperswitch/pull/3020)) ([`c4bd47e`](https://github.com/juspay/hyperswitch/commit/c4bd47eca93a158c9daeeeb18afb1e735eea8c94))
- **user:**
- Generate and delete sample data ([#2987](https://github.com/juspay/hyperswitch/pull/2987)) ([`092ec73`](https://github.com/juspay/hyperswitch/commit/092ec73b3c65ce6048d379383b078d643f0f35fc))
- Add user_list and switch_list apis ([#3033](https://github.com/juspay/hyperswitch/pull/3033)) ([`ec15ddd`](https://github.com/juspay/hyperswitch/commit/ec15ddd0d0ed942fedec525406df3005d494b8d4))
- Calculate surcharge for customer saved card list ([#3039](https://github.com/juspay/hyperswitch/pull/3039)) ([`daf0f09`](https://github.com/juspay/hyperswitch/commit/daf0f09f8e3293ee6a3599a25362d9171fc5b2e7))

### Bug Fixes

- **connector:** [Paypal] Parse response for Cards with no 3DS check ([#3021](https://github.com/juspay/hyperswitch/pull/3021)) ([`d883cd1`](https://github.com/juspay/hyperswitch/commit/d883cd18972c5f9e8350e9a3f4e5cd56ec2c0787))
- **pm_list:** [Trustpay]Update dynamic fields for trustpay blik ([#3042](https://github.com/juspay/hyperswitch/pull/3042)) ([`9274cef`](https://github.com/juspay/hyperswitch/commit/9274cefbdd29d2ac64baeea2fe504dff2472cb47))
- **wasm:** Fix wasm function to return the categories for keys with their description respectively ([#3023](https://github.com/juspay/hyperswitch/pull/3023)) ([`2ac5b2c`](https://github.com/juspay/hyperswitch/commit/2ac5b2cd764c0aad53ac7c672dfcc9132fa5668f))
- Use card bin to get additional card details ([#3036](https://github.com/juspay/hyperswitch/pull/3036)) ([`6c7d3a2`](https://github.com/juspay/hyperswitch/commit/6c7d3a2e8a047ff23b52b76792fe8f28d3b952a4))
- Transform connector name to lowercase in connector integration script ([#3048](https://github.com/juspay/hyperswitch/pull/3048)) ([`298e362`](https://github.com/juspay/hyperswitch/commit/298e3627c379de5acfcafb074036754661801f1e))
- Add fallback to reverselookup error ([#3025](https://github.com/juspay/hyperswitch/pull/3025)) ([`ba392f5`](https://github.com/juspay/hyperswitch/commit/ba392f58b2956d67e93a08853bcf2270a869be27))

### Refactors

- **payment_methods:** Add support for passing card_cvc in payment_method_data object along with token ([#3024](https://github.com/juspay/hyperswitch/pull/3024)) ([`3ce04ab`](https://github.com/juspay/hyperswitch/commit/3ce04abae4eddfa27025368f5ef28987cccea43d))
- **users:** Separate signup and signin ([#2921](https://github.com/juspay/hyperswitch/pull/2921)) ([`80efeb7`](https://github.com/juspay/hyperswitch/commit/80efeb76b1801529766978af1c06e2d2c7de66c0))
- Create separate struct for surcharge details response ([#3027](https://github.com/juspay/hyperswitch/pull/3027)) ([`57591f8`](https://github.com/juspay/hyperswitch/commit/57591f819c7994099e76cff1affc7bcf3e45a031))

### Testing

- **postman:** Update postman collection files ([`6e09bc9`](https://github.com/juspay/hyperswitch/commit/6e09bc9e2c4bbe14dcb70da4a438850b03b3254c))

**Full Changelog:** [`v1.94.0...v1.95.0`](https://github.com/juspay/hyperswitch/compare/v1.94.0...v1.95.0)

- - -


## 1.94.0 (2023-12-01)

### Features
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
shift4.base_url = "https://api.shift4.com/"
signifyd.base_url = "https://api.signifyd.com/"
square.base_url = "https://connect.squareupsandbox.com/"
square.secondary_base_url = "https://pci-connect.squareupsandbox.com/"
stax.base_url = "https://apiprod.fattlabs.com/"
Expand Down Expand Up @@ -477,3 +478,12 @@ connection_timeout = 10 # Timeout for database connection in seconds
[kv_config]
# TTL for KV in seconds
ttl = 900

[frm]
enabled = true

[paypal_onboarding]
client_id = "paypal_client_id" # Client ID for PayPal onboarding
client_secret = "paypal_secret_key" # Secret key for PayPal onboarding
partner_id = "paypal_partner_id" # Partner ID for PayPal onboarding
enabled = true # Switch to enable or disable PayPal onboarding
12 changes: 11 additions & 1 deletion config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
shift4.base_url = "https://api.shift4.com/"
signifyd.base_url = "https://api.signifyd.com/"
square.base_url = "https://connect.squareupsandbox.com/"
square.secondary_base_url = "https://pci-connect.squareupsandbox.com/"
stax.base_url = "https://apiprod.fattlabs.com/"
Expand Down Expand Up @@ -476,6 +477,9 @@ delay_between_retries_in_milliseconds = 500
[kv_config]
ttl = 900 # 15 * 60 seconds

[frm]
enabled = true

[events]
source = "logs"

Expand Down Expand Up @@ -504,4 +508,10 @@ port = 5432
dbname = "hyperswitch_db"
pool_size = 5
connection_timeout = 10
queue_strategy = "Fifo"
queue_strategy = "Fifo"

[connector_onboarding.paypal]
client_id = ""
client_secret = ""
partner_id = ""
enabled = true
9 changes: 9 additions & 0 deletions config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
shift4.base_url = "https://api.shift4.com/"
signifyd.base_url = "https://api.signifyd.com/"
square.base_url = "https://connect.squareupsandbox.com/"
square.secondary_base_url = "https://pci-connect.squareupsandbox.com/"
stax.base_url = "https://apiprod.fattlabs.com/"
Expand Down Expand Up @@ -362,3 +363,11 @@ queue_strategy = "Fifo"

[kv_config]
ttl = 900 # 15 * 60 seconds

[frm]
enabled = true

[connector_onboarding.paypal]
client_id = ""
client_secret = ""
partner_id = ""
3 changes: 2 additions & 1 deletion crates/api_models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"
license.workspace = true

[features]
default = ["payouts"]
default = ["payouts", "frm"]
business_profile_routing = []
connector_choice_bcompat = []
errors = ["dep:actix-web", "dep:reqwest"]
Expand All @@ -17,6 +17,7 @@ connector_choice_mca_id = ["euclid/connector_choice_mca_id"]
dummy_connector = ["euclid/dummy_connector", "common_enums/dummy_connector"]
detailed_errors = []
payouts = []
frm = []

[dependencies]
actix-web = { version = "4.3.1", optional = true }
Expand Down
54 changes: 54 additions & 0 deletions crates/api_models/src/connector_onboarding.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
use super::{admin, enums};

#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
pub struct ActionUrlRequest {
pub connector: enums::Connector,
pub connector_id: String,
pub return_url: String,
}

#[derive(serde::Serialize, Debug, Clone)]
#[serde(rename_all = "lowercase")]
pub enum ActionUrlResponse {
PayPal(PayPalActionUrlResponse),
}

#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
pub struct OnboardingSyncRequest {
pub profile_id: String,
pub connector_id: String,
pub connector: enums::Connector,
}

#[derive(serde::Serialize, Debug, Clone)]
pub struct PayPalActionUrlResponse {
pub action_url: String,
}

#[derive(serde::Serialize, Debug, Clone)]
#[serde(rename_all = "lowercase")]
pub enum OnboardingStatus {
PayPal(PayPalOnboardingStatus),
}

#[derive(serde::Serialize, Debug, Clone)]
#[serde(rename_all = "snake_case")]
pub enum PayPalOnboardingStatus {
AccountNotFound,
PaymentsNotReceivable,
PpcpCustomDenied,
MorePermissionsNeeded,
EmailNotVerified,
Success(PayPalOnboardingDone),
ConnectorIntegrated(admin::MerchantConnectorResponse),
}

#[derive(serde::Serialize, Debug, Clone)]
pub struct PayPalOnboardingDone {
pub payer_id: String,
}

#[derive(serde::Serialize, Debug, Clone)]
pub struct PayPalIntegrationDone {
pub connector_id: String,
}
30 changes: 30 additions & 0 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,36 @@ impl From<PayoutConnectors> for RoutableConnectors {
}
}

#[cfg(feature = "frm")]
#[derive(
Clone,
Copy,
Debug,
Eq,
Hash,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::Display,
strum::EnumString,
ToSchema,
)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum FrmConnectors {
/// Signifyd Risk Manager. Official docs: https://docs.signifyd.com/
Signifyd,
}

#[cfg(feature = "frm")]
impl From<FrmConnectors> for RoutableConnectors {
fn from(value: FrmConnectors) -> Self {
match value {
FrmConnectors::Signifyd => Self::Signifyd,
}
}
}

#[derive(
Clone,
Copy,
Expand Down
1 change: 1 addition & 0 deletions crates/api_models/src/events.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod connector_onboarding;
pub mod customer;
pub mod gsm;
mod locker_migration;
Expand Down
12 changes: 12 additions & 0 deletions crates/api_models/src/events/connector_onboarding.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};

use crate::connector_onboarding::{
ActionUrlRequest, ActionUrlResponse, OnboardingStatus, OnboardingSyncRequest,
};

common_utils::impl_misc_api_event_type!(
ActionUrlRequest,
ActionUrlResponse,
OnboardingSyncRequest,
OnboardingStatus
);
13 changes: 11 additions & 2 deletions crates/api_models/src/events/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ use crate::{
payments::{
PaymentIdType, PaymentListConstraints, PaymentListFilterConstraints, PaymentListFilters,
PaymentListResponse, PaymentListResponseV2, PaymentsApproveRequest, PaymentsCancelRequest,
PaymentsCaptureRequest, PaymentsRejectRequest, PaymentsRequest, PaymentsResponse,
PaymentsRetrieveRequest, PaymentsStartRequest, RedirectionResponse,
PaymentsCaptureRequest, PaymentsIncrementalAuthorizationRequest, PaymentsRejectRequest,
PaymentsRequest, PaymentsResponse, PaymentsRetrieveRequest, PaymentsStartRequest,
RedirectionResponse,
},
};
impl ApiEventMetric for PaymentsRetrieveRequest {
Expand Down Expand Up @@ -149,3 +150,11 @@ impl ApiEventMetric for PaymentListResponseV2 {
}

impl ApiEventMetric for RedirectionResponse {}

impl ApiEventMetric for PaymentsIncrementalAuthorizationRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Payment {
payment_id: self.payment_id.clone(),
})
}
}
9 changes: 7 additions & 2 deletions crates/api_models/src/events/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use crate::user::{
GetMetaDataRequest, GetMetaDataResponse, GetMultipleMetaDataPayload, SetMetaDataRequest,
},
AuthorizeResponse, ChangePasswordRequest, ConnectAccountRequest, CreateInternalUserRequest,
DashboardEntryResponse, GetUsersResponse, SignUpRequest, SignUpWithMerchantIdRequest,
DashboardEntryResponse, ForgotPasswordRequest, GetUsersResponse, InviteUserRequest,
InviteUserResponse, ResetPasswordRequest, SignUpRequest, SignUpWithMerchantIdRequest,
SwitchMerchantIdRequest, UserMerchantCreate,
};

Expand All @@ -33,7 +34,11 @@ common_utils::impl_misc_api_event_type!(
UserMerchantCreate,
GetUsersResponse,
AuthorizeResponse,
ConnectAccountRequest
ConnectAccountRequest,
ForgotPasswordRequest,
ResetPasswordRequest,
InviteUserRequest,
InviteUserResponse
);

#[cfg(feature = "dummy_connector")]
Expand Down
1 change: 1 addition & 0 deletions crates/api_models/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub mod api_keys;
pub mod bank_accounts;
pub mod cards_info;
pub mod conditional_configs;
pub mod connector_onboarding;
pub mod currency;
pub mod customers;
pub mod disputes;
Expand Down
Loading

0 comments on commit 74adf42

Please sign in to comment.