Skip to content

Commit

Permalink
Merge branch 'feat/profile_specific_fallback_routing' of https://gith…
Browse files Browse the repository at this point in the history
…ub.com/juspay/hyperswitch into feat/profile_specific_fallback_routing
  • Loading branch information
Aprabhat19 committed Nov 10, 2023
2 parents b854930 + 475a54e commit 45c509e
Show file tree
Hide file tree
Showing 59 changed files with 616 additions and 1,005 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 1.75.0 (2023-11-09)

### Features

- **events:** Add extracted fields based on req/res types ([#2795](https://github.com/juspay/hyperswitch/pull/2795)) ([`8985794`](https://github.com/juspay/hyperswitch/commit/89857941b09c5fbe0f3e7d5b4f908bb144ae162d))
- **router:**
- Added merchant custom name support for payment link ([#2685](https://github.com/juspay/hyperswitch/pull/2685)) ([`8b15189`](https://github.com/juspay/hyperswitch/commit/8b151898dc0d8eefe5ed2bbdafe59e8f58b4698c))
- Add `gateway_status_map` CRUD APIs ([#2809](https://github.com/juspay/hyperswitch/pull/2809)) ([`5c9e235`](https://github.com/juspay/hyperswitch/commit/5c9e235bd30dd3e03d086a83613edfcc62b2ead2))

### Bug Fixes

- **analytics:** Added hs latency to api event for paymentconfirm call ([#2787](https://github.com/juspay/hyperswitch/pull/2787)) ([`aab8f60`](https://github.com/juspay/hyperswitch/commit/aab8f6035c16ca19009f8f1e0db688c17bc0b2b6))
- [mollie] locale validation irrespective of auth type ([#2814](https://github.com/juspay/hyperswitch/pull/2814)) ([`25a73c2`](https://github.com/juspay/hyperswitch/commit/25a73c29a4c4715a54862dd6a28c875fd3752f63))

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

- - -


## 1.74.0 (2023-11-08)

### Features
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,16 @@ The fastest and easiest way to try hyperswitch is via our CDK scripts
1. Click on the following button for a quick standalone deployment on AWS, suitable for prototyping.
No code or setup is required in your system and the deployment is covered within the AWS free-tier setup.

<a href="https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=Hyperswitch&templateURL=https://hyperswitch-synth.s3.eu-central-1.amazonaws.com/deployment.yaml"><img src="./docs/imgs/aws_button.png" height="35"></a>
&emsp;&emsp; <a title="Bootstrap" href="https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=cdk-hs&templateURL=https://hyperswitch-synth.s3.eu-central-1.amazonaws.com/bootstrap-template.yml"> Click here if you have not bootstrapped your region before deploying</a>

&emsp;&emsp; <a href="https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=Hyperswitch&templateURL=https://hyperswitch-synth.s3.eu-central-1.amazonaws.com/deployment.yaml"><img src="./docs/imgs/aws_button.png" height="35"></a>


2. Sign-in to your AWS console.

3. Follow the instructions provided on the console to successfully deploy Hyperswitch

For an early access to the production-ready setup fill this <a href="https://forms.gle/v6ru55XDZFufVPnu9">Early Access Form</a>
For an early access to the production-ready setup fill this <a href="https://forms.gle/v6ru55XDZFufVPnu9">Early Access Form</a>

<a href="#Fast-Integration-for-Stripe-Users">
<h2 id="Fast Integration for Stripe Users">🔌 Fast Integration for Stripe Users</h2>
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,4 +1,5 @@
pub mod customer;
pub mod gsm;
pub mod payment;
#[cfg(feature = "payouts")]
pub mod payouts;
Expand Down
33 changes: 33 additions & 0 deletions crates/api_models/src/events/gsm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};

use crate::gsm;

impl ApiEventMetric for gsm::GsmCreateRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Gsm)
}
}

impl ApiEventMetric for gsm::GsmUpdateRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Gsm)
}
}

impl ApiEventMetric for gsm::GsmRetrieveRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Gsm)
}
}

impl ApiEventMetric for gsm::GsmDeleteRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Gsm)
}
}

impl ApiEventMetric for gsm::GsmDeleteResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Gsm)
}
}
75 changes: 75 additions & 0 deletions crates/api_models/src/gsm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
use crate::enums;

#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct GsmCreateRequest {
pub connector: enums::Connector,
pub flow: String,
pub sub_flow: String,
pub code: String,
pub message: String,
pub status: String,
pub router_error: Option<String>,
pub decision: GsmDecision,
pub step_up_possible: bool,
}

#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct GsmRetrieveRequest {
pub connector: enums::Connector,
pub flow: String,
pub sub_flow: String,
pub code: String,
pub message: String,
}

#[derive(
Default,
Clone,
Copy,
Debug,
strum::Display,
PartialEq,
Eq,
serde::Serialize,
serde::Deserialize,
strum::EnumString,
)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum GsmDecision {
Retry,
Requeue,
#[default]
DoDefault,
}

#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct GsmUpdateRequest {
pub connector: String,
pub flow: String,
pub sub_flow: String,
pub code: String,
pub message: String,
pub status: Option<String>,
pub router_error: Option<String>,
pub decision: Option<GsmDecision>,
pub step_up_possible: Option<bool>,
}

#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct GsmDeleteRequest {
pub connector: String,
pub flow: String,
pub sub_flow: String,
pub code: String,
pub message: String,
}

#[derive(Debug, serde::Serialize)]
pub struct GsmDeleteResponse {
pub gsm_rule_delete: bool,
pub connector: String,
pub flow: String,
pub sub_flow: String,
pub code: String,
}
1 change: 1 addition & 0 deletions crates/api_models/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub mod ephemeral_key;
pub mod errors;
pub mod events;
pub mod files;
pub mod gsm;
pub mod mandates;
pub mod organization;
pub mod payment_methods;
Expand Down
8 changes: 5 additions & 3 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3100,6 +3100,8 @@ pub struct PaymentLinkObject {
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub link_expiry: Option<PrimitiveDateTime>,
pub merchant_custom_domain_name: Option<String>,
/// Custom merchant name for payment link
pub custom_merchant_name: Option<String>,
}

#[derive(Default, Debug, serde::Deserialize, Clone, ToSchema, serde::Serialize)]
Expand Down Expand Up @@ -3143,11 +3145,11 @@ pub struct PaymentLinkDetails {
pub pub_key: String,
pub client_secret: String,
pub payment_id: String,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub expiry: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601::option")]
pub expiry: Option<PrimitiveDateTime>,
pub merchant_logo: String,
pub return_url: String,
pub merchant_name: crypto::OptionalEncryptableName,
pub merchant_name: String,
pub order_details: Vec<pii::SecretSerdeValue>,
pub max_items_visible_after_collapse: i8,
}
1 change: 1 addition & 0 deletions crates/common_utils/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub enum ApiEventsType {
Routing,
ResourceListAPI,
PaymentRedirectionResponse,
Gsm,
// TODO: This has to be removed once the corresponding apiEventTypes are created
Miscellaneous,
}
Expand Down
2 changes: 2 additions & 0 deletions crates/data_models/src/payments/payment_attempt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ pub enum PaymentAttemptUpdate {
connector_response_reference_id: Option<String>,
amount_capturable: Option<i64>,
updated_by: String,
authentication_data: Option<serde_json::Value>,
encoded_data: Option<String>,
},
UnresolvedResponseUpdate {
status: storage_enums::AttemptStatus,
Expand Down
122 changes: 0 additions & 122 deletions crates/diesel_models/src/connector_response.rs

This file was deleted.

11 changes: 10 additions & 1 deletion crates/diesel_models/src/gsm.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! Gateway status mapping
use common_utils::custom_serde;
use common_utils::{
custom_serde,
events::{ApiEventMetric, ApiEventsType},
};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable};
use time::PrimitiveDateTime;

Expand Down Expand Up @@ -95,3 +98,9 @@ impl From<GatewayStatusMappingUpdate> for GatewayStatusMapperUpdateInternal {
}
}
}

impl ApiEventMetric for GatewayStatusMap {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Gsm)
}
}
9 changes: 0 additions & 9 deletions crates/diesel_models/src/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use serde::{Deserialize, Serialize};

use crate::{
address::{Address, AddressNew, AddressUpdateInternal},
connector_response::{ConnectorResponse, ConnectorResponseNew, ConnectorResponseUpdate},
errors,
payment_attempt::{PaymentAttempt, PaymentAttemptNew, PaymentAttemptUpdate},
payment_intent::{PaymentIntentNew, PaymentIntentUpdate},
Expand Down Expand Up @@ -51,7 +50,6 @@ pub enum Insertable {
PaymentIntent(PaymentIntentNew),
PaymentAttempt(PaymentAttemptNew),
Refund(RefundNew),
ConnectorResponse(ConnectorResponseNew),
Address(Box<AddressNew>),
ReverseLookUp(ReverseLookupNew),
}
Expand All @@ -62,16 +60,9 @@ pub enum Updateable {
PaymentIntentUpdate(PaymentIntentUpdateMems),
PaymentAttemptUpdate(PaymentAttemptUpdateMems),
RefundUpdate(RefundUpdateMems),
ConnectorResponseUpdate(ConnectorResponseUpdateMems),
AddressUpdate(Box<AddressUpdateMems>),
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ConnectorResponseUpdateMems {
pub orig: ConnectorResponse,
pub update_data: ConnectorResponseUpdate,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct AddressUpdateMems {
pub orig: Address,
Expand Down
Loading

0 comments on commit 45c509e

Please sign in to comment.