Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch into add_updated…
Browse files Browse the repository at this point in the history
…_by_to_trackers
  • Loading branch information
dracarys18 committed Oct 16, 2023
2 parents 2060b8b + b3b7ca3 commit 2285604
Show file tree
Hide file tree
Showing 587 changed files with 30,477 additions and 4,247 deletions.
53 changes: 49 additions & 4 deletions .github/workflows/CI-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,43 @@ jobs:
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- name: Checkout repository with token
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
uses: actions/checkout@v3

with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.AUTO_FILE_UPDATE_PAT }}

- name: Checkout repository for fork
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt

- name: Check formatting
- name: Check formatting for forked pull requests
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
shell: bash
run: cargo +nightly fmt --all --check

- name: Run formatter
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
shell: bash
run: |
cargo +nightly fmt --all
if ! git diff --exit-code --quiet -- crates; then
echo "::notice::Formatting check failed"
git config --local user.name 'github-actions[bot]'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add crates
git commit --message 'chore: run formatter'
git push
fi
check-msrv:
name: Check compilation on MSRV toolchain
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -275,8 +299,17 @@ jobs:
# - windows-latest

steps:
- name: Checkout repository
- name: Checkout repository for fork
if: ${{ (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) }}
uses: actions/checkout@v3

- name: Checkout repository with token
if: ${{ (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) }}
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.AUTO_FILE_UPDATE_PAT }}

- name: "Fetch base branch"
shell: bash
Expand Down Expand Up @@ -322,6 +355,18 @@ jobs:
shell: bash
run: cargo clippy --all-features --all-targets

- name: Check Cargo.lock changed
if: ${{ (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) }}
shell: bash
run: |
if ! git diff --quiet --exit-code -- Cargo.lock ; then
git config --local user.name 'github-actions[bot]'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add Cargo.lock
git commit --message 'chore: update Cargo.lock'
git push
fi
- name: Check files changed
shell: bash
run: |
Expand Down
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,54 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 1.59.0 (2023-10-16)

### Features

- **connector:**
- Add support for surcharge in trustpay ([#2581](https://github.com/juspay/hyperswitch/pull/2581)) ([`2d5d3b8`](https://github.com/juspay/hyperswitch/commit/2d5d3b8efbf782bf03e5f5ef1aa557d3dd3f5860))
- Add surcharge support in paypal connector ([#2568](https://github.com/juspay/hyperswitch/pull/2568)) ([`92ee1db`](https://github.com/juspay/hyperswitch/commit/92ee1db107ac41326ecfb31b4565664a29a4b80a))
- **events:** Add basic event handler to collect application events ([#2602](https://github.com/juspay/hyperswitch/pull/2602)) ([`5d88dbc`](https://github.com/juspay/hyperswitch/commit/5d88dbc92ce470c951717debe246e182b3fe5656))

### Refactors

- **connector:** [multisafepay] Remove Default Case Handling ([#2586](https://github.com/juspay/hyperswitch/pull/2586)) ([`7adc6a0`](https://github.com/juspay/hyperswitch/commit/7adc6a05b60fa9143260b2a7f623907647557621))

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

- - -


## 1.58.0 (2023-10-15)

### Features

- **connector:**
- [HELCIM] Implement Cards for Helcim ([#2210](https://github.com/juspay/hyperswitch/pull/2210)) ([`b5feab6`](https://github.com/juspay/hyperswitch/commit/b5feab61d950921c75267ad88e944e7e2c4af3ca))
- [Paypal] use connector request reference id as reference for paypal ([#2577](https://github.com/juspay/hyperswitch/pull/2577)) ([`500405d`](https://github.com/juspay/hyperswitch/commit/500405d78938772e0e9f8e3ce4f930d782c670fa))
- [Airwallex] Currency Unit Conversion ([#2571](https://github.com/juspay/hyperswitch/pull/2571)) ([`8971b17`](https://github.com/juspay/hyperswitch/commit/8971b17b073315f869e3c843b0aee7644dcf6479))
- [Klarna] Use connector_request_reference_id as reference to connector ([#2494](https://github.com/juspay/hyperswitch/pull/2494)) ([`2609ef6`](https://github.com/juspay/hyperswitch/commit/2609ef6aeb17e1e89d8f98ff84a2c33b9704e6b2))
- [Dlocal] Use connector_response_reference_id as reference to merchant ([#2446](https://github.com/juspay/hyperswitch/pull/2446)) ([`f6677b8`](https://github.com/juspay/hyperswitch/commit/f6677b8e9300a75810a39de5b60243e34cf1d76c))
- **nexinets:** Use connector_request_reference_id as reference to the connector - Work In Progress ([#2515](https://github.com/juspay/hyperswitch/pull/2515)) ([`088dce0`](https://github.com/juspay/hyperswitch/commit/088dce076d8d8ff86769717368150e09d7d92593))
- **router:** Add Cancel Event in Webhooks and Mapping it in Stripe ([#2573](https://github.com/juspay/hyperswitch/pull/2573)) ([`92f7918`](https://github.com/juspay/hyperswitch/commit/92f7918e6f98460fb739d50b908ae33fda2f80b8))

### Refactors

- **connector:**
- [Worldline] Currency Unit Conversion ([#2569](https://github.com/juspay/hyperswitch/pull/2569)) ([`9f03a41`](https://github.com/juspay/hyperswitch/commit/9f03a4118ccdd6036d27074c9126a79d6e9b0495))
- [Authorizedotnet] Enhance currency Mapping with ConnectorCurrencyCommon Trait ([#2570](https://github.com/juspay/hyperswitch/pull/2570)) ([`d401975`](https://github.com/juspay/hyperswitch/commit/d4019751ff4acbd26abb2c32a600e8e6c55893f6))
- [noon] enhance response status mapping ([#2575](https://github.com/juspay/hyperswitch/pull/2575)) ([`053c79d`](https://github.com/juspay/hyperswitch/commit/053c79d248df0ff6ec702c3c301acc5654a1735a))
- **storage:** Update paymentintent object to provide a relation with attempts ([#2502](https://github.com/juspay/hyperswitch/pull/2502)) ([`fbf3c03`](https://github.com/juspay/hyperswitch/commit/fbf3c03d418242b1f5f1a15c69029023d0b25b4e))

### Testing

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

**Full Changelog:** [`v1.57.1+hotfix.1...v1.58.0`](https://github.com/juspay/hyperswitch/compare/v1.57.1+hotfix.1...v1.58.0)

- - -


## 1.57.1 (2023-10-12)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion connector-template/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ where
) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
types::PaymentsAuthorizeType::get_content_type(self).to_string().into(),
self.get_content_type().to_string().into(),
)];
let mut api_key = self.get_auth_header(&req.connector_auth_type)?;
header.append(&mut api_key);
Expand Down
4 changes: 2 additions & 2 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub enum Connector {
Globalpay,
Globepay,
Gocardless,
//Helcim, added as template code for future usage,
Helcim,
Iatapay,
Klarna,
Mollie,
Expand Down Expand Up @@ -209,7 +209,7 @@ pub enum RoutableConnectors {
Globalpay,
Globepay,
Gocardless,
//Helcim, added as template code for future usage,
Helcim,
Iatapay,
Klarna,
Mollie,
Expand Down
10 changes: 10 additions & 0 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,21 @@ pub struct PaymentsRequest {
/// associated with the merchant account will be used.
pub profile_id: Option<String>,

/// surcharge_details for this payment
#[schema(value_type = Option<RequestSurchargeDetails>)]
pub surcharge_details: Option<RequestSurchargeDetails>,

/// The type of the payment that differentiates between normal and various types of mandate payments
#[schema(value_type = Option<PaymentType>)]
pub payment_type: Option<api_enums::PaymentType>,
}

#[derive(Default, Debug, Clone, serde::Serialize, serde::Deserialize, Copy, ToSchema)]
pub struct RequestSurchargeDetails {
pub surcharge_amount: i64,
pub tax_amount: Option<i64>,
}

#[derive(Default, Debug, Clone, Copy)]
pub struct HeaderPayload {
pub payment_confirm_source: Option<api_enums::PaymentSource>,
Expand Down
4 changes: 3 additions & 1 deletion crates/api_models/src/webhooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub enum IncomingWebhookEvent {
PaymentIntentSuccess,
PaymentIntentProcessing,
PaymentIntentPartiallyFunded,
PaymentIntentCancelled,
PaymentActionRequired,
EventNotSupported,
SourceChargeable,
Expand Down Expand Up @@ -84,7 +85,8 @@ impl From<IncomingWebhookEvent> for WebhookFlow {
| IncomingWebhookEvent::PaymentIntentSuccess
| IncomingWebhookEvent::PaymentIntentProcessing
| IncomingWebhookEvent::PaymentActionRequired
| IncomingWebhookEvent::PaymentIntentPartiallyFunded => Self::Payment,
| IncomingWebhookEvent::PaymentIntentPartiallyFunded
| IncomingWebhookEvent::PaymentIntentCancelled => Self::Payment,
IncomingWebhookEvent::EventNotSupported => Self::ReturnResponse,
IncomingWebhookEvent::RefundSuccess | IncomingWebhookEvent::RefundFailure => {
Self::Refund
Expand Down
1 change: 1 addition & 0 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ pub enum EventType {
PaymentSucceeded,
PaymentFailed,
PaymentProcessing,
PaymentCancelled,
ActionRequired,
RefundSucceeded,
RefundFailed,
Expand Down
Loading

0 comments on commit 2285604

Please sign in to comment.