Skip to content

Commit

Permalink
Merge branch 'main' into feat/currency_conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
prajjwalkumar17 authored Nov 28, 2023
2 parents 0c63df4 + 54d6b10 commit b94eb7f
Show file tree
Hide file tree
Showing 57 changed files with 1,645 additions and 379 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/release-new-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate a token
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.HYPERSWITCH_BOT_APP_ID }}
private-key: ${{ secrets.HYPERSWITCH_BOT_APP_PRIVATE_KEY }}

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}
token: ${{ secrets.AUTO_RELEASE_PAT }}

- name: Install Rust
uses: dtolnay/rust-toolchain@master
Expand All @@ -51,8 +43,8 @@ jobs:
- name: Set Git Configuration
shell: bash
run: |
git config --local user.name 'hyperswitch-bot[bot]'
git config --local user.email '148525504+hyperswitch-bot[bot]@users.noreply.github.com'
git config --local user.name 'github-actions'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Update Postman collection files from Postman directories
shell: bash
Expand Down
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,63 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 1.90.0 (2023-11-27)

### Features

- **auth:** Add Authorization for JWT Authentication types ([#2973](https://github.com/juspay/hyperswitch/pull/2973)) ([`03c0a77`](https://github.com/juspay/hyperswitch/commit/03c0a772a99000acf4676db8ca2ce916036281d1))
- **user:** Implement change password for user ([#2959](https://github.com/juspay/hyperswitch/pull/2959)) ([`bfa1645`](https://github.com/juspay/hyperswitch/commit/bfa1645b847fb881eb2370d5dbfef6fd0b53725d))

### Bug Fixes

- **router:** Added validation to check total orderDetails amount equal to amount in request ([#2965](https://github.com/juspay/hyperswitch/pull/2965)) ([`37532d4`](https://github.com/juspay/hyperswitch/commit/37532d46f599a99e0e021b0455a6f02381005dd7))
- Add prefix to connector_transaction_id ([#2981](https://github.com/juspay/hyperswitch/pull/2981)) ([`107c3b9`](https://github.com/juspay/hyperswitch/commit/107c3b99417dd7bca7b62741ad601485700f37be))

### Refactors

- **connector:** [Nuvei] update error message ([#2867](https://github.com/juspay/hyperswitch/pull/2867)) ([`04b7c03`](https://github.com/juspay/hyperswitch/commit/04b7c0384dc9290bd60f49033fd35732527720f1))

### Testing

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

### Documentation

- **try_local_system:** Add instructions to run using Docker Compose by pulling standalone images ([#2984](https://github.com/juspay/hyperswitch/pull/2984)) ([`0fa8ad1`](https://github.com/juspay/hyperswitch/commit/0fa8ad1b7c27010bf83e4035de9881d29e192e8a))

### Miscellaneous Tasks

- **connector:** Update connector addition script ([#2801](https://github.com/juspay/hyperswitch/pull/2801)) ([`34953a0`](https://github.com/juspay/hyperswitch/commit/34953a046429fe0341e8469bd9b036e176bda205))

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

- - -


## 1.89.0 (2023-11-24)

### Features

- **router:** Add `connector_transaction_id` in error_response from connector flows ([#2972](https://github.com/juspay/hyperswitch/pull/2972)) ([`3322103`](https://github.com/juspay/hyperswitch/commit/3322103f5c9b7c2a5b663980246c6ca36b8dc63e))

### Bug Fixes

- **connector:** [BANKOFAMERICA] Add status VOIDED in enum Bankofameri… ([#2969](https://github.com/juspay/hyperswitch/pull/2969)) ([`203bbd7`](https://github.com/juspay/hyperswitch/commit/203bbd73751e1513206e81d7cf920ec263f83c58))
- **core:** Error propagation for not supporting partial refund ([#2976](https://github.com/juspay/hyperswitch/pull/2976)) ([`97a38a7`](https://github.com/juspay/hyperswitch/commit/97a38a78e514e4fa3b5db46b6de985be6312dcc3))
- **router:** Mark refund status as failure for not_implemented error from connector flows ([#2978](https://github.com/juspay/hyperswitch/pull/2978)) ([`d56d805`](https://github.com/juspay/hyperswitch/commit/d56d80557050336d5ed37282f1aa34b6c17389d1))
- Return none instead of err when payment method data is not found for bank debit during listing ([#2967](https://github.com/juspay/hyperswitch/pull/2967)) ([`5cc829a`](https://github.com/juspay/hyperswitch/commit/5cc829a11f515a413fe19f657a90aa05cebb99b5))
- Surcharge related status and rules fix ([#2974](https://github.com/juspay/hyperswitch/pull/2974)) ([`3db7213`](https://github.com/juspay/hyperswitch/commit/3db721388a7f0e291d7eb186661fc69a57068ea6))

### Documentation

- **README:** Updated Community Platform Mentions ([#2960](https://github.com/juspay/hyperswitch/pull/2960)) ([`e0bde43`](https://github.com/juspay/hyperswitch/commit/e0bde433282a34eb9eb28a2d9c43c2b17b5e65e5))
- Add Rust locker information in architecture doc ([#2964](https://github.com/juspay/hyperswitch/pull/2964)) ([`b2f7dd1`](https://github.com/juspay/hyperswitch/commit/b2f7dd13925a1429e316cd9eaf0e2d31d46b6d4a))

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

- - -


## 1.88.0 (2023-11-23)

### Features
Expand Down
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<img src="./docs/imgs/hyperswitch-logo-light.svg#gh-light-mode-only" alt="Hyperswitch-Logo" width="40%" />
</p>


<h1 align="center">The open-source payments switch</h1>

<div align="center" >
Expand Down Expand Up @@ -35,7 +34,6 @@ The single API to access payment ecosystems across 130+ countries</div>
</a>
</p>


<hr>
<img src="./docs/imgs/switch.png" />

Expand All @@ -57,27 +55,42 @@ Using Hyperswitch, you can:
<h2 id="Quick Start Guide">⚡️ Quick Start Guide</h2>
</a>

<h3> One-click deployment on AWS cloud </h3>
### One-click deployment on AWS cloud

The fastest and easiest way to try hyperswitch is via our CDK scripts
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.

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

### Run it on your system

You can run Hyperswitch on your system using Docker Compose after cloning this repository:

```shell
docker compose up -d
```

This will start the payments router, the primary component within Hyperswitch.

Check out the [local setup guide][local-setup-guide] for a more comprehensive
setup, which includes the [scheduler and monitoring services][docker-compose-scheduler-monitoring].

[local-setup-guide]: /docs/try_local_system.md
[docker-compose-scheduler-monitoring]: /docs/try_local_system.md#run-the-scheduler-and-monitoring-services

<a href="#Fast-Integration-for-Stripe-Users">
<h2 id="Fast Integration for Stripe Users">🔌 Fast Integration for Stripe Users</h2>
</a>

If you are already using Stripe, integrating with Hyperswitch is fun, fast &
easy.
If you are already using Stripe, integrating with Hyperswitch is fun, fast & easy.
Try the steps below to get a feel for how quick the setup is:

1. Get API keys from our [dashboard].
Expand All @@ -96,9 +109,7 @@ Try the steps below to get a feel for how quick the setup is:
As of Sept 2023, we support 50+ payment processors and multiple global payment methods.
In addition, we are continuously integrating new processors based on their reach and community requests.
Our target is to support 100+ processors by H2 2023.
You can find the latest list of payment processors, supported methods, and
features
[here][supported-connectors-and-features].
You can find the latest list of payment processors, supported methods, and features [here][supported-connectors-and-features].

[supported-connectors-and-features]: https://hyperswitch.io/pm-list

Expand Down Expand Up @@ -252,12 +263,11 @@ We welcome contributions from the community. Please read through our
Included are directions for opening issues, coding standards, and notes on
development.

- We appreciate all types of contributions: code, documentation, demo creation, or something new way you want to contribute to us. We will reward every contribution with a Hyperswitch branded t-shirt.
- 🦀 **Important note for Rust developers**: We aim for contributions from the community
across a broad range of tracks. Hence, we have prioritised simplicity and code
readability over purely idiomatic code. For example, some of the code in core
functions (e.g., `payments_core`) is written to be more readable than
pure-idiomatic.
- We appreciate all types of contributions: code, documentation, demo creation, or some new way you want to contribute to us.
We will reward every contribution with a Hyperswitch branded t-shirt.
- 🦀 **Important note for Rust developers**: We aim for contributions from the community across a broad range of tracks.
Hence, we have prioritised simplicity and code readability over purely idiomatic code.
For example, some of the code in core functions (e.g., `payments_core`) is written to be more readable than pure-idiomatic.

<a href="#Community">
<h2 id="Community">👥 Community</h2>
Expand All @@ -269,7 +279,6 @@ Get updates on Hyperswitch development and chat with the community:
- [Slack workspace][slack] for questions related to integrating hyperswitch, integrating a connector in hyperswitch, etc.
- [GitHub Discussions][github-discussions] to drop feature requests or suggest anything payments-related you need for your stack.

[blog]: https://hyperswitch.io/blog
[discord]: https://discord.gg/wJZ7DVW8mm
[slack]: https://join.slack.com/t/hyperswitch-io/shared_invite/zt-1k6cz4lee-SAJzhz6bjmpp4jZCDOtOIg
[github-discussions]: https://github.com/juspay/hyperswitch/discussions
Expand Down Expand Up @@ -314,7 +323,6 @@ Check the [CHANGELOG.md](./CHANGELOG.md) file for details.

This product is licensed under the [Apache 2.0 License](LICENSE).


<a href="#Thanks to all contributors">
<h2 id="Thanks to all contributors">✨ Thanks to all contributors</h2>
</a>
Expand Down
1 change: 1 addition & 0 deletions connector-template/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ impl utils::Connector for {{project-name | downcase | pascal_case}}Test {
connector: Box::new(&{{project-name | downcase | pascal_case}}),
connector_name: types::Connector::{{project-name | downcase | pascal_case}},
get_token: types::api::GetToken::Connector,
merchant_connector_id: None,
}
}

Expand Down
4 changes: 3 additions & 1 deletion crates/api_models/src/events/user.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};

use crate::user::{ConnectAccountRequest, ConnectAccountResponse};
use crate::user::{ChangePasswordRequest, ConnectAccountRequest, ConnectAccountResponse};

impl ApiEventMetric for ConnectAccountResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Expand All @@ -12,3 +12,5 @@ impl ApiEventMetric for ConnectAccountResponse {
}

impl ApiEventMetric for ConnectAccountRequest {}

common_utils::impl_misc_api_event_type!(ChangePasswordRequest);
3 changes: 3 additions & 0 deletions crates/api_models/src/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ impl SurchargeDetailsResponse {
request_surcharge_details.surcharge_amount == self.surcharge_amount
&& request_surcharge_details.tax_amount.unwrap_or(0) == self.tax_on_surcharge_amount
}
pub fn get_total_surcharge_amount(&self) -> i64 {
self.surcharge_amount + self.tax_on_surcharge_amount
}
}

#[derive(Clone, Debug)]
Expand Down
3 changes: 3 additions & 0 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ impl RequestSurchargeDetails {
final_amount: original_amount + surcharge_amount + tax_on_surcharge_amount,
}
}
pub fn get_total_surcharge_amount(&self) -> i64 {
self.surcharge_amount + self.tax_amount.unwrap_or(0)
}
}

#[derive(Default, Debug, Clone, Copy)]
Expand Down
6 changes: 6 additions & 0 deletions crates/api_models/src/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ pub struct ConnectAccountResponse {
#[serde(skip_serializing)]
pub user_id: String,
}

#[derive(serde::Deserialize, Debug, serde::Serialize)]
pub struct ChangePasswordRequest {
pub new_password: Secret<String>,
pub old_password: Secret<String>,
}
6 changes: 2 additions & 4 deletions crates/data_models/src/payments/payment_attempt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ pub enum PaymentAttemptUpdate {
error_message: Option<Option<String>>,
amount_capturable: Option<i64>,
updated_by: String,
surcharge_amount: Option<i64>,
tax_amount: Option<i64>,
merchant_connector_id: Option<String>,
},
RejectUpdate {
Expand Down Expand Up @@ -291,8 +293,6 @@ pub enum PaymentAttemptUpdate {
error_reason: Option<Option<String>>,
connector_response_reference_id: Option<String>,
amount_capturable: Option<i64>,
surcharge_amount: Option<i64>,
tax_amount: Option<i64>,
updated_by: String,
authentication_data: Option<serde_json::Value>,
encoded_data: Option<String>,
Expand Down Expand Up @@ -321,8 +321,6 @@ pub enum PaymentAttemptUpdate {
error_message: Option<Option<String>>,
error_reason: Option<Option<String>>,
amount_capturable: Option<i64>,
surcharge_amount: Option<i64>,
tax_amount: Option<i64>,
updated_by: String,
unified_code: Option<Option<String>>,
unified_message: Option<Option<String>>,
Expand Down
18 changes: 6 additions & 12 deletions crates/diesel_models/src/payment_attempt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ pub enum PaymentAttemptUpdate {
error_code: Option<Option<String>>,
error_message: Option<Option<String>>,
amount_capturable: Option<i64>,
surcharge_amount: Option<i64>,
tax_amount: Option<i64>,
updated_by: String,
merchant_connector_id: Option<String>,
},
Expand Down Expand Up @@ -208,8 +210,6 @@ pub enum PaymentAttemptUpdate {
error_reason: Option<Option<String>>,
connector_response_reference_id: Option<String>,
amount_capturable: Option<i64>,
surcharge_amount: Option<i64>,
tax_amount: Option<i64>,
updated_by: String,
authentication_data: Option<serde_json::Value>,
encoded_data: Option<String>,
Expand Down Expand Up @@ -238,8 +238,6 @@ pub enum PaymentAttemptUpdate {
error_message: Option<Option<String>>,
error_reason: Option<Option<String>>,
amount_capturable: Option<i64>,
surcharge_amount: Option<i64>,
tax_amount: Option<i64>,
updated_by: String,
unified_code: Option<Option<String>>,
unified_message: Option<Option<String>>,
Expand Down Expand Up @@ -443,6 +441,8 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
amount_capturable,
updated_by,
merchant_connector_id,
surcharge_amount,
tax_amount,
} => Self {
amount: Some(amount),
currency: Some(currency),
Expand All @@ -463,6 +463,8 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
amount_capturable,
updated_by,
merchant_connector_id,
surcharge_amount,
tax_amount,
..Default::default()
},
PaymentAttemptUpdate::VoidUpdate {
Expand Down Expand Up @@ -501,8 +503,6 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
error_reason,
connector_response_reference_id,
amount_capturable,
surcharge_amount,
tax_amount,
updated_by,
authentication_data,
encoded_data,
Expand All @@ -524,8 +524,6 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
connector_response_reference_id,
amount_capturable,
updated_by,
surcharge_amount,
tax_amount,
authentication_data,
encoded_data,
unified_code,
Expand All @@ -539,8 +537,6 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
error_message,
error_reason,
amount_capturable,
surcharge_amount,
tax_amount,
updated_by,
unified_code,
unified_message,
Expand All @@ -554,8 +550,6 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
error_reason,
amount_capturable,
updated_by,
surcharge_amount,
tax_amount,
unified_code,
unified_message,
connector_transaction_id,
Expand Down
4 changes: 4 additions & 0 deletions crates/euclid/src/backend/vir_interpreter/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ impl Context {
}
}

if let Some(card_network) = payment_method.card_network {
enum_values.insert(EuclidValue::CardNetwork(card_network));
}

if let Some(at) = payment.authentication_type {
enum_values.insert(EuclidValue::AuthenticationType(at));
}
Expand Down
Loading

0 comments on commit b94eb7f

Please sign in to comment.