prompt
stringlengths
24
63.1k
response
stringlengths
180
101k
metadata
stringlengths
143
152
[REFACTOR] Simplify the method signatures of some methods in the `Encode` extension trait ### Description The definition of the [`common_utils::ext_traits::Encode`](https://github.com/juspay/hyperswitch/blob/fb254b8924808e6a2b2a9a31dbed78749836e8d3/crates/common_utils/src/ext_traits.rs#L21) trait has a generic type parameter `P`, which is used in only a subset of the trait methods. This causes the type having to be specified when calling methods which don't use that generic type parameter, such as the [`encode_to_value()`](https://github.com/juspay/hyperswitch/blob/fb254b8924808e6a2b2a9a31dbed78749836e8d3/crates/common_utils/src/ext_traits.rs#L78) method, used to convert a type which implements `serde::Serialize` to a `serde_json::Value`. One such usage is: https://github.com/juspay/hyperswitch/blob/fb254b8924808e6a2b2a9a31dbed78749836e8d3/crates/router/src/routes/payments/helpers.rs#L76-L80 Ignoring the error handling and propagation bolierplate code, it looks like so: ```rust use common_utils::ext_traits::Encode; // Include trait in scope let encoded = Encode::<types::BrowserInformation>::encode_to_value(&browser_info)?; ``` This can be simplified to something like this (since the compiler is able to infer types in most cases): ```rust use common_utils::ext_traits::Encode; // Include trait in scope let encoded = browser_info.encode_to_value()?; ``` ### Possible Implementation Remove the generic type parameter `P` on the trait, and add it in the trait methods which use that type parameter.
<think> PR Context: - Title: refactor(ext_traits): simplify the signatures of some methods in `Encode` extension trait - Merged: 2024-02-19T10:08:24Z - Files changed: 30 files - Commits: 3 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR simplifies the definition of the `common_utils::ext_traits::Encode` trait to simplify the invocation of the trait methods. In addition, this PR addresses a clippy lint introduced in Rust 1.76. ## Motivation and Context <!-- Why </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(ext_traits): simplify the signatures of some methods in `Encode` extension trait (#3687) Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/common_utils/src/ext_traits.rs** Modify existing code **crates/redis_interface/src/commands.rs** Modify existing code **crates/router/src/compatibility/stripe/webhooks.rs** Modify existing code **crates/router/src/connector/adyen/transformers.rs** Modify existing code **crates/router/src/connector/authorizedotnet/transformers.rs** Modify existing code **crates/router/src/connector/bluesnap/transformers.rs** Modify existing code **crates/router/src/connector/checkout.rs** Modify existing code **crates/router/src/connector/globepay/transformers.rs** Modify existing code **crates/router/src/connector/noon/transformers.rs** Modify existing code **crates/router/src/connector/nuvei/transformers.rs** Modify existing code **crates/router/src/connector/payeezy/transformers.rs** Modify existing code **crates/router/src/connector/rapyd.rs** Modify existing code **crates/router/src/connector/stripe/transformers.rs** Modify existing code **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/core/conditional_config.rs** Modify existing code **crates/router/src/core/connector_onboarding/paypal.rs** Modify existing code **crates/router/src/core/disputes.rs** Modify existing code **crates/router/src/core/fraud_check/operation/fraud_check_post.rs** Modify existing code **crates/router/src/core/fraud_check/operation/fraud_check_pre.rs** Modify existing code **crates/router/src/core/mandate.rs** Modify existing code **crates/router/src/core/payment_methods/cards.rs** Modify existing code **crates/router/src/core/payment_methods/transformers.rs** Modify existing code **crates/router/src/core/payment_methods/vault.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/operations/payment_complete_authorize.rs** Modify existing code **crates/router/src/core/payments/operations/payment_confirm.rs** Modify existing code **crates/router/src/core/payments/operations/payment_create.rs** Modify existing code **crates/router/src/core/payments/operations/payment_response.rs** Modify existing code **crates/router/src/core/payments/operations/payment_update.rs** Modify existing code **crates/router/src/core/payments/retry.rs** Modify existing code **crates/router/src/core/payments/types.rs** Modify existing code **crates/router/src/core/routing.rs** Modify existing code **crates/router/src/core/routing/helpers.rs** Modify existing code **crates/router/src/core/surcharge_decision_config.rs** Modify existing code **crates/router/src/core/webhooks/types.rs** Modify existing code **crates/router/src/db/merchant_connector_account.rs** Modify existing code **crates/router/src/db/refund.rs** Modify existing code **crates/router/src/routes/payment_methods.rs** Modify existing code **crates/router/src/routes/payments/helpers.rs** Modify existing code **crates/router/src/services/api.rs** Modify existing code **crates/router/src/types/api/admin.rs** Modify existing code **crates/storage_impl/src/payments/payment_intent.rs** Modify existing code
{"issue_number": 3685, "pr_number": 3687, "commits_count": 1, "files_changed": 30, "response_length": 4178, "file_count": 45, "needs_breakdown": true}
Updating Errors in the API-ref Docs Updating Errors in the API-ref Docs
<think> PR Context: - Title: docs: Added desc. for wallets other than AP, GP - Merged: 2024-10-29T07:56:09Z - Files changed: 3 files - Commits: 5 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Closes #5305 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with cor </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** docs: Added desc. for wallets other than AP, GP (#6452) Co-authored-by: hyperswitch-bot[bot] <148525 Files to modify: **crates/api_models/src/payments.rs** Modify existing code
{"issue_number": 5305, "pr_number": 6452, "commits_count": 1, "files_changed": 3, "response_length": 960, "file_count": 3, "needs_breakdown": false}
[FEATURE] Implement `MerchantKeyStoreInterface` for `MockDb` ### Feature Description Currently the MerchantKeyStoreInterface is not implemented for MockDb. It is required for merchant account functions. And without this implementation, we cannot write tests for them. ### Possible Implementation Checkout #172 for more details. ### Have you spent some time to check if this feature request has been raised before? - [X] I checked and didn't find similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? None
<think> PR Context: - Title: feat(db): implement `MerchantKeyStoreInterface` for `MockDb` - Merged: 2023-07-25T07:52:19Z - Files changed: 5 files - Commits: 3 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR adds the `MockDb` implementation of `MerchantKeyStoreInterface`. In addition, this PR includes a fix for the `test_connector_label_cache` test in the `merchant_connector_account` module. ## Motivation and Context <!-- Why is this </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(db): implement `MerchantKeyStoreInterface` for `MockDb` (#1772) Files to modify: **crates/router/src/db.rs** Modify existing code **crates/router/src/db/merchant_connector_account.rs** Modify existing code **crates/router/src/db/merchant_key_store.rs** Modify existing code **crates/router/src/types/storage.rs** Remove: - mod: pub::reverse_lookup - mod: pub::kv Add: - mod: pub::kv - mod: pub::merchant_key_store - mod: pub::reverse_lookup **crates/router/src/types/storage/merchant_key_store.rs** Modify existing code
{"issue_number": 1697, "pr_number": 1772, "commits_count": 1, "files_changed": 5, "response_length": 1355, "file_count": 7, "needs_breakdown": false}
feat(single_use): add extra fields in `Mandate` table and `MandateData` [Blocked on #61] ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates ## Description This PR adds single use mandate support and a 2 new fields to the mandate table (i.e. singe_use_amount, single_use_currency) <!-- Describe your changes in detail --> ### Additional Changes - [x] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> The change includes the following files. - migrations/2022-12-05-090521_single_use_mandate_fields/up.sql - migrations/2022-12-05-090521_single_use_mandate_fields/down.sql ## Motivation and Context Here, the intension is adding a new Validation feature in PaymentsCore, for that reason following are the steps that the change is broken down to. 1. Create new types for the change #45 2. Introduce the Flow and Connector Integration #47 3. Add Stripe POC #50 4. Introduce the new operation and all the related components in the payments core #53 + #61 5. Changing the `MandateData` type 6. Move the mandate related behaviour to domain <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: fix(core): language consumption from locale in payment and payout links - Merged: 2025-05-12T15:38:24Z - Files changed: 4 files - Commits: 3 commits Implementation approach: ## Description Fix the locale handling in the payment and payout links translation functionality to properly support language-location combinations like `es-ES`. Currently, the system is using the full locale value from the `Accept-Language` header without parsing it, causing translations for such loc </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(core): language consumption from locale in payment and payout links (#7993) Co-authored-by: hype Files to modify: **crates/router/src/services/api/generic_link_response/context.rs** Add: - function: private::get_language
{"issue_number": 66, "pr_number": 7993, "commits_count": 1, "files_changed": 4, "response_length": 1036, "file_count": 3, "needs_breakdown": false}
[FEATURE] Flowbird Archipel connector ### Feature Description Initial contribution from Flowbird. ### Possible Implementation Implementation of the Archipel connector. ### Have you spent some time checking if this feature request has been raised before? - [x] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes, I am willing to submit a PR!
<think> PR Context: - Title: feat(connector): Archipel connector - Merged: 2025-05-16T09:54:08Z - Files changed: 30 files - Commits: 27 commits Implementation approach: [Flowbird Archipel connector implementation](https://www.flowbird.group/smartcity/us/wp-content/uploads/2019/11/Brochure-PAYMENT-ACCEPTANCE-EN-4-pages.pdf) Closes #7899 Co-authored-by: Guillaume Bague <guillaume.bague@flowbird.group> </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): Archipel connector (#7851) Co-authored-by: Michal Czernecki <michal.czerencki@flowb Files to modify: **crates/common_enums/src/connector_enums.rs** Modify existing code **crates/connector_configs/src/common_config.rs** Modify existing code **crates/connector_configs/src/connector.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors.rs** Add: - mod: pub::archipel **crates/hyperswitch_connectors/src/connectors/archipel.rs** Add: - function: pub::new - function: private::build_env_specific_endpoint - function: private::build_headers - function: private::id - function: private::get_currency_unit - function: private::get_auth_header - function: private::common_get_content_type - function: private::base_url - function: private::build_error_response - function: private::validate_connector_against_payment_request - function: private::validate_mandate_payment - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_5xx_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_5xx_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_5xx_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_5xx_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_5xx_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_5xx_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_5xx_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_5xx_error_response - function: private::get_webhook_object_reference_id - function: private::get_webhook_event_type - function: private::get_webhook_resource_object - struct: pub::Archipel - impl: impl Archipel - impl: impl api::PaymentAuthorize for Archipel - impl: impl api::PaymentSync for Archipel - impl: impl api::PaymentVoid for Archipel - impl: impl api::PaymentCapture for Archipel - impl: impl api::MandateSetup for Archipel - impl: impl api::ConnectorAccessToken for Archipel - impl: impl api::PaymentToken for Archipel - impl: impl api::PaymentSession for Archipel - impl: impl api::Refund for Archipel - impl: impl api::RefundExecute for Archipel - impl: impl api::RefundSync for Archipel - impl: impl api::Payment for Archipel - impl: impl api::PaymentIncrementalAuthorization for Archipel - impl: impl api::ConnectorSpecifications for Archipel - impl: impl ConnectorCommonExt<Flow, Request, Response> for Archipel - impl: impl ConnectorCommon for Archipel - impl: impl ConnectorValidation for Archipel - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Archipel - impl: impl ConnectorIntegration< IncrementalAuthorization, PaymentsIncrementalAuthorizationData, PaymentsResponseData, > for Archipel - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Archipel - impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Archipel - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Archipel - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Archipel - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Archipel - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Archipel - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Archipel - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Archipel - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Archipel - impl: impl IncomingWebhook for Archipel - mod: pub::transformers **crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs** Add: - function: private::from - function: private::from - function: private::try_from - function: private::try_from - function: private::from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::from - function: private::from - function: private::try_from - function: private::new - function: private::from - function: private::default - function: private::new - function: private::from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::from - function: private::try_from - function: private::from - function: private::from - function: private::try_from - function: private::from - function: private::from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::from - struct: pub::ArchipelTenantId - struct: pub::ArchipelRouterData - struct: pub::ArchipelAuthType - struct: pub::ArchipelConfigData - struct: pub::ArchipelOrderRequest - struct: pub::CardExpiryDate - struct: pub::Archipel3DS - struct: pub::ArchipelCardHolder - struct: pub::ArchipelBillingAddress - struct: pub::ArchipelCredentialIndicator - struct: pub::TokenizedCardData - struct: pub::ArchipelTokenizedCard - struct: pub::ArchipelCard - struct: pub::ArchipelWalletInformation - struct: pub::ArchipelPaymentInformation - struct: pub::ArchipelWalletAuthorizationRequest - struct: pub::ArchipelCardAuthorizationRequest - struct: private::ArchipelFlowStatus - struct: pub::ArchipelOrderResponse - struct: pub::ArchipelErrorMessage - struct: private::ArchipelErrorMessageWithHttpCode - struct: pub::ArchipelTransactionMetadata - struct: pub::ArchipelPaymentsResponse - struct: pub::ArchipelCaptureRequest - struct: pub::ArchipelCaptureOrderRequest - struct: pub::ArchipelPaymentsCancelRequest - struct: pub::ArchipelIncrementalAuthorizationRequest - struct: pub::ArchipelRefundOrder - struct: pub::ArchipelRefundRequest - struct: pub::ArchipelRefundOrderResponse - struct: pub::ArchipelRefundResponse - enum: pub::ArchipelPaymentInitiator - enum: pub::ArchipelWalletProvider - enum: pub::ArchipelPaymentCertainty - enum: pub::ApplicationSelectionIndicator - enum: pub::ArchipelCredentialIndicatorStatus - enum: pub::ArchipelCardScheme - enum: pub::ArchipelPaymentStatus - enum: pub::ArchipelPaymentFlow - enum: pub::ArchipelRefundStatus - impl: impl From<String> for ArchipelTenantId - impl: impl From<(MinorUnit, ArchipelTenantId, T)> for ArchipelRouterData<T> - impl: impl TryFrom<&ConnectorAuthType> for ArchipelAuthType - impl: impl TryFrom<&Option<pii::SecretSerdeValue>> for ArchipelConfigData - impl: impl From<AuthenticationData> for Archipel3DS - impl: impl TryFrom<Option<ArchipelBillingAddress>> for ArchipelCardHolder - impl: impl TryFrom<&AddressDetails> for ArchipelBillingAddress - impl: impl TryFrom<(&WalletData, &Option<PaymentMethodToken>)> for TokenizedCardData - impl: impl TryFrom<(Option<Secret<String>>, &Card)> for ArchipelCard - impl: impl TryFrom<( Option<Secret<String>>, &hyperswitch_domain_models::payment_method_data::CardDetailsForNetworkTransactionId, )> for ArchipelCard - impl: impl From<&str> for ArchipelCardScheme - impl: impl From<Option<CardIssuer>> for ArchipelCardScheme - impl: impl TryFrom<(AttemptStatus, CaptureMethod)> for ArchipelPaymentFlow - impl: impl ArchipelFlowStatus - impl: impl From<ArchipelFlowStatus> for AttemptStatus - impl: impl Default for ArchipelErrorMessage - impl: impl ArchipelErrorMessageWithHttpCode - impl: impl From<&ArchipelPaymentsResponse> for ArchipelTransactionMetadata - impl: impl TryFrom<(MinorUnit, &PaymentsAuthorizeRouterData)> for ArchipelPaymentInformation - impl: impl TryFrom<ArchipelRouterData<&PaymentsAuthorizeRouterData>> for ArchipelCardAuthorizationRequest - impl: impl TryFrom<ArchipelRouterData<&PaymentsAuthorizeRouterData>> for ArchipelWalletAuthorizationRequest - impl: impl TryFrom< ResponseRouterData< F, ArchipelPaymentsResponse, PaymentsAuthorizeData, PaymentsResponseData, >, > for RouterData<F, PaymentsAuthorizeData, PaymentsResponseData> - impl: impl TryFrom<ResponseRouterData<F, ArchipelPaymentsResponse, PaymentsSyncData, PaymentsResponseData>> for RouterData<F, PaymentsSyncData, PaymentsResponseData> - impl: impl From<ArchipelRouterData<&PaymentsCaptureRouterData>> for ArchipelCaptureRequest - impl: impl TryFrom< ResponseRouterData<F, ArchipelPaymentsResponse, PaymentsCaptureData, PaymentsResponseData>, > for RouterData<F, PaymentsCaptureData, PaymentsResponseData> - impl: impl TryFrom<ArchipelRouterData<&SetupMandateRouterData>> for ArchipelCardAuthorizationRequest - impl: impl TryFrom< ResponseRouterData< F, ArchipelPaymentsResponse, SetupMandateRequestData, PaymentsResponseData, >, > for RouterData<F, SetupMandateRequestData, PaymentsResponseData> - impl: impl From<ArchipelRouterData<&PaymentsCancelRouterData>> for ArchipelPaymentsCancelRequest - impl: impl TryFrom< ResponseRouterData<F, ArchipelPaymentsResponse, PaymentsCancelData, PaymentsResponseData>, > for RouterData<F, PaymentsCancelData, PaymentsResponseData> - impl: impl From<ArchipelPaymentStatus> for AuthorizationStatus - impl: impl From<ArchipelRouterData<&PaymentsIncrementalAuthorizationRouterData>> for ArchipelIncrementalAuthorizationRequest - impl: impl TryFrom< ResponseRouterData< F, ArchipelPaymentsResponse, PaymentsIncrementalAuthorizationData, PaymentsResponseData, >, > for RouterData<F, PaymentsIncrementalAuthorizationData, PaymentsResponseData> - impl: impl From<ArchipelRouterData<&RefundsRouterData<F>>> for ArchipelRefundRequest - impl: impl From<ArchipelPaymentStatus> for RefundStatus - impl: impl TryFrom<ArchipelRefundResponse> for RefundsResponseData - impl: impl TryFrom<RefundsResponseRouterData<Execute, ArchipelRefundResponse>> for RefundsRouterData<Execute> - impl: impl TryFrom<RefundsResponseRouterData<RSync, ArchipelRefundResponse>> for RefundsRouterData<RSync> - impl: impl From<ArchipelErrorMessageWithHttpCode> for ErrorResponse **crates/hyperswitch_connectors/src/default_implementations.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Add: - function: private::get_two_digit_expiry_year **crates/hyperswitch_domain_models/src/configs.rs** Modify existing code **crates/router/src/connector.rs** Modify existing code **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/types/api.rs** Modify existing code **crates/router/src/types/transformers.rs** Modify existing code **crates/test_utils/src/connector_auth.rs** Add: - struct: pub::NoKey
{"issue_number": 7899, "pr_number": 7851, "commits_count": 1, "files_changed": 30, "response_length": 13979, "file_count": 16, "needs_breakdown": true}
refactor(reports): Change permissions for report APIs Currently internal users are unable to use report APIs as some of them require Write permission which internal view only users doesn't have. We need to change the permission required to access report APIs.
<think> PR Context: - Title: refactor(analytics): Create new permissions for Generate Report APIs - Merged: 2024-07-11T08:30:00Z - Files changed: 5 files - Commits: 5 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Currently, internal users are unable to access payment generate report as it requires `PaymentWrite`. And other reports are having `Analytics` permission, but in the Front-end, the option is in Operations tab and in Analytics tab. Becaus </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(analytics): Create new permissions for Generate Report APIs (#5178) Files to modify: **crates/api_models/src/user_role.rs** Modify existing code **crates/router/src/analytics.rs** Modify existing code **crates/router/src/services/authorization/permission_groups.rs** Modify existing code **crates/router/src/services/authorization/permissions.rs** Modify existing code **crates/router/src/utils/user_role.rs** Modify existing code
{"issue_number": 5177, "pr_number": 5178, "commits_count": 1, "files_changed": 5, "response_length": 1256, "file_count": 7, "needs_breakdown": false}
refactor(RouterData): reorder fields in `RouterData` ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates ## Description This change targets on changing the orientation of the fields in RouterData the change is as follows ```diff struct RouterData<Flow, Request, Response> { - response: Option<Response>, - error_response: Option<ErrorResponse>, + response: Result<Response, ErrorResponse>, } ``` <!-- Describe your changes in detail --> ### Additional Changes - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context This change was intended in earlier revisions on the project but due to the rapid growth of the codebase in the connector side, this change needed to be retargetes <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? ⚠️ Under testing by @Gnanasundari24 <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: fix(payment_update): fix the fsm after passing pm_data in update - Merged: 2022-11-29T17:56:36Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description The addition of payment_method_data in `PaymentData` affected condition for checking payment method in `update_tracker` where the check for available payment method is done. <!-- Describe your changes in detail --> ### Additional Changes - [ ] This PR modifies the database schema - [ ] This PR modifies appl </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(payment_update): fix the fsm after passing pm_data in update (#38) Files to modify: **crates/router/src/core/payments/operations/payment_update.rs** Modify existing code
{"issue_number": 33, "pr_number": 38, "commits_count": 1, "files_changed": 1, "response_length": 974, "file_count": 3, "needs_breakdown": false}
[BUG] Internal Server Error thrown when updating or deleting non-existent API key ### Bug Description When a user tries to update or delete a non-existent API key, an internal server error is thrown. The expected behavior is that the server returns a 404 status code, informing that the API key does not exist. ### Expected Behavior Server should return 404 status code. ### Actual Behavior Server returns internal server error (500 status code) with the following response: ```json { "error": { "type": "api", "message": "Something went wrong", "code": "HE_00" } } ``` ### Steps To Reproduce The following steps assume that the admin API key for the deployed server is known to the user. 1. Create a merchant account using the create merchant account API and admin API key. 2. Try to use the update API key endpoint or the delete API key endpoint with a non-existent API key ID. For example, the delete API key request could look like so: ```shell curl --location --request DELETE 'http://localhost:8080/api_keys/<merchant_id>/a-non-existent-key-id' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: <ADMIN_API_KEY>' ``` Server returns the aforementioned response. ### Have you spent some time checking if this bug has been raised before? - [X] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes, I am willing to submit a PR!
<think> PR Context: - Title: fix(api_keys): fix internal server error being thrown when trying to update or delete non-existent API key - Merged: 2024-02-22T07:51:09Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR fixes a bug with the update API key and delete API key endpoints throwing an internal server error when a non-existent API key was provided. ## Motivation and Context <!-- Why is this change required? What problem does it solve? </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(api_keys): fix internal server error being thrown when trying to update or delete non-existent A Files to modify: **crates/storage_impl/src/errors.rs** Modify existing code
{"issue_number": 3761, "pr_number": 3762, "commits_count": 1, "files_changed": 1, "response_length": 1019, "file_count": 3, "needs_breakdown": false}
[FEATURE] Implement a masking strategy for UPI VPAs ### Feature Description Unified Payments Interface (UPI) is a popular payment technique in India, used to transfer money among individuals, bill payments and merchant payments. In the case of money transfer among individuals, users are identified with a Virtual Payment Address (VPA). A VPA is typically of the following format: `<identifier>@<bank_name>`. (Feel free to read up more about UPI if you aren't already familiar with it.) Since a VPA can uniquely identify a user, we'd want to mask VPAs in our application. However, we'd want to keep the `<bank_name>` part unmasked, since it could help us build analytics on the banks or payment service providers used, and possibly improve our routing experience. ### Possible Implementation We'd want you to implement `masking::Strategy` for UPI VPAs (which could be called `UpiVpaMaskingStrategy`) which masks the identifier completely, and keeps the bank name part in clear text. You can refer to the email masking strategy to get an idea of how this can be done. Please include unit tests for the same. https://github.com/juspay/hyperswitch/blob/2f9c28938f95a58532604817b1ed370ef8285dd8/crates/common_utils/src/pii.rs#L190-L205 Also, update the type of `vpa_id` field in `api_models::payments::UpiData` to be `Option<Secret<String, UpiVpaMaskingStrategy>>` instead. https://github.com/juspay/hyperswitch/blob/2f9c28938f95a58532604817b1ed370ef8285dd8/crates/api_models/src/payments.rs#L783-L786
<think> PR Context: - Title: feat(pii): implement a masking strategy for UPI VPAs - Merged: 2023-08-01T13:32:55Z - Files changed: 6 files - Commits: 10 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Here, I have implemented masking::Strategy for UPI VPAs which is called UpiVpaMaskingStrategy which masks the identifier completely, and keeps the bank name part in clear text. I have included tests for the same. ### Additional Changes </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(pii): implement a masking strategy for UPI VPAs (#1641) Co-authored-by: Prasunna Soppa <prasunn Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/common_utils/src/pii.rs** Add: - function: private::fmt - function: private::test_valid_upi_vpa_masking - function: private::test_invalid_upi_vpa_masking - struct: pub::UpiVpaMaskingStrategy - impl: impl Strategy<T> for UpiVpaMaskingStrategy **crates/masking/src/abs.rs** Add: - function: private::switch_strategy - trait: pub::SwitchStrategy - impl: impl SwitchStrategy<FromStrategy, ToStrategy> for Secret<S, FromStrategy> **crates/masking/src/lib.rs** Modify existing code **crates/router/src/compatibility/stripe/payment_intents/types.rs** Modify existing code **crates/router/src/connector/iatapay/transformers.rs** Modify existing code
{"issue_number": 1578, "pr_number": 1641, "commits_count": 1, "files_changed": 6, "response_length": 1664, "file_count": 8, "needs_breakdown": false}
refactor: migrate user roles table to support v2 - Make org_id and merchant_id nullable. - Add new nullable columns profile_id, entity_id , entity_type, version
<think> PR Context: - Title: refactor(user_roles): make org and merchant id nullable - Merged: 2024-07-25T10:56:16Z - Files changed: 16 files - Commits: 23 commits Implementation approach: ## Description ### DB changes in user_roles - New Columns - `version` - `entity_id` - `entity_type` - `profile_id` - Changes - `merchant_id` is now nullable - `org_id` is now nullable ### Additional Changes - [ ] This PR modifies the API contract - [x] This PR modifies the </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(user_roles): make org and merchant id nullable (#5353) Co-authored-by: hyperswitch-bot[bot] Files to modify: **crates/diesel_models/src/enums.rs** Add: - enum: pub::UserRoleVersion **crates/diesel_models/src/query/user_role.rs** Modify existing code **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/diesel_models/src/user_role.rs** Modify existing code **crates/router/src/core/user.rs** Modify existing code **crates/router/src/core/user_role.rs** Modify existing code **crates/router/src/db/kafka_store.rs** Modify existing code **crates/router/src/db/user_role.rs** Modify existing code **crates/router/src/routes/recon.rs** Modify existing code **crates/router/src/types/domain/user.rs** Modify existing code **crates/router/src/types/domain/user/decision_manager.rs** Modify existing code **crates/router/src/utils/user.rs** Modify existing code **crates/router/src/utils/user_role.rs** Modify existing code
{"issue_number": 5352, "pr_number": 5353, "commits_count": 1, "files_changed": 16, "response_length": 1841, "file_count": 16, "needs_breakdown": true}
refactor(routers,connectors) : Remove unused functions in `crates/router/src/connector/utils.rs` ## Analyze and Remove Unused Functions from `crates/router/src/connector/utils.rs` ### Description: There are functions in the crates/router/src/connector/utils.rs file that appear to be unused across the router crate. For example: • validate_currency is defined in utils.rs but is not used anywhere in the codebase. This function can be safely removed. ### Task: • Perform a comprehensive analysis of all the functions present in crates/router/src/connector/utils.rs. • Identify any functions that are not referenced anywhere in the router crate which are in utils. • Remove such unused functions to reduce dead code and improve maintainability.
<think> PR Context: - Title: refactor: remove unused functions - Merged: 2025-05-14T10:29:02Z - Files changed: 1 files - Commits: 2 commits Implementation approach: crates/router/src/connector/utils.rs ## Description <!-- Describe your changes in detail --> Removed functions that are not used in other files and removed imports that are only referenced by the unused functions. [crates/router/src/connector/utils.rs](https://github.com/juspay/hyperswitch/blob </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor: remove unused functions (#7994) Files to modify: **crates/router/src/connector/utils.rs** Remove: - function: pub::get_http_header - function: pub::to_boolean - function: pub::get_connector_meta - function: pub::base64_decode - function: pub::to_currency_base_unit_from_optional_amount - function: pub::get_amount_as_string - function: pub::get_amount_as_f64 - function: pub::to_currency_base_unit - function: pub::to_currency_lower_unit - function: pub::construct_not_implemented_error_report - function: pub::to_currency_base_unit_with_zero_decimal_check - function: pub::to_currency_base_unit_asf64 - function: pub::str_to_f32 - function: pub::collect_values_by_removing_signature - function: pub::collect_and_sort_values_by_removing_signature - function: pub::get_webhook_merchant_secret_key - function: pub::construct_captures_response_hashmap - function: pub::is_manual_capture - function: pub::generate_random_bytes - function: pub::validate_currency - function: pub::get_timestamp_in_milliseconds - function: pub::get_mandate_details **Commit 2:** refactor: remove unused functions (#7994) Files to modify: **crates/router/src/connector/utils.rs** Remove: - function: pub::get_http_header - function: pub::to_boolean - function: pub::get_connector_meta - function: pub::base64_decode - function: pub::to_currency_base_unit_from_optional_amount - function: pub::get_amount_as_string - function: pub::get_amount_as_f64 - function: pub::to_currency_base_unit - function: pub::to_currency_lower_unit - function: pub::construct_not_implemented_error_report - function: pub::to_currency_base_unit_with_zero_decimal_check - function: pub::to_currency_base_unit_asf64 - function: pub::str_to_f32 - function: pub::collect_values_by_removing_signature - function: pub::collect_and_sort_values_by_removing_signature - function: pub::get_webhook_merchant_secret_key - function: pub::construct_captures_response_hashmap - function: pub::is_manual_capture - function: pub::generate_random_bytes - function: pub::validate_currency - function: pub::get_timestamp_in_milliseconds - function: pub::get_mandate_details
{"issue_number": 7928, "pr_number": 7994, "commits_count": 2, "files_changed": 1, "response_length": 3068, "file_count": 5, "needs_breakdown": false}
feat(users): add tenant_id in user roles - Use global interface for user roles - Add column tenant_id in user_roles - Handle insertion of tenant_id - Hadle token validation, a token issued in one tenant should not work in other tenancy
<think> PR Context: - Title: feat(users): add global support in user roles - Merged: 2024-11-13T07:24:13Z - Files changed: 18 files - Commits: 9 commits Implementation approach: ## Description This PR includes - Use of global interface for user roles table - Add tenant_id column in user_roles table - Handle user_role insertions with correct value for tenant_id - Auth Changes: Token validation, token issued in one tenancy should not be valid in other ### Additional Ch </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(users): add global support in user roles (#6458) Files to modify: **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/diesel_models/src/user_role.rs** Modify existing code **crates/router/src/analytics.rs** Modify existing code **crates/router/src/core/errors/user.rs** Modify existing code **crates/router/src/core/recon.rs** Modify existing code **crates/router/src/core/user.rs** Modify existing code **crates/router/src/core/user_role.rs** Modify existing code **crates/router/src/db.rs** Modify existing code **crates/router/src/db/user_role.rs** Modify existing code **crates/router/src/services/authentication.rs** Modify existing code **crates/router/src/services/authorization.rs** Add: - function: pub::check_tenant **crates/router/src/types/domain/user.rs** Modify existing code **crates/router/src/types/domain/user/decision_manager.rs** Modify existing code **crates/router/src/utils/user.rs** Modify existing code **crates/router/src/utils/user_role.rs** Modify existing code
{"issue_number": 6457, "pr_number": 6458, "commits_count": 1, "files_changed": 18, "response_length": 1906, "file_count": 18, "needs_breakdown": true}
feat(users): Add profile level invites Currently invites are at merchant level only. Invite, accept invite and accept invite from email should change because of this.
<think> PR Context: - Title: feat(users): Add profile level invites - Merged: 2024-09-04T15:22:10Z - Files changed: 19 files - Commits: 8 commits Implementation approach: ## Description <!-- Describe your changes in detail --> - Removed preferred_merchant_id from update user API. - Invites will work at profile level as well. - Handle internal users in list APIs - Org List for internal users will throw error. - Merchant list will list merchants. - Profile </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(users): Add profile level invites (#5793) Files to modify: **crates/api_models/src/user.rs** Modify existing code **crates/api_models/src/user_role.rs** Add: - struct: pub::Entity **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/diesel_models/src/user.rs** Modify existing code **crates/diesel_models/src/user_role.rs** Modify existing code **crates/router/src/core/user.rs** Modify existing code **crates/router/src/core/user_role.rs** Modify existing code **crates/router/src/db/user.rs** Modify existing code **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/routes/user_role.rs** Add: - function: pub::accept_invitations_v2 - function: pub::accept_invitations_pre_auth **crates/router/src/services/email/types.rs** Remove: - function: pub::get_merchant_id - struct: pub::InviteRegisteredUser Add: - function: pub::get_entity_type - function: pub::get_entity_id - struct: pub::Entity **crates/router/src/types/domain/user.rs** Remove: - function: pub::get_preferred_merchant_id - function: pub::get_preferred_or_active_user_role_from_db **crates/router/src/types/domain/user/decision_manager.rs** Modify existing code **crates/router/src/utils/user_role.rs** Add: - function: pub::get_lineage_for_user_id_and_entity_for_accepting_invite **crates/router_env/src/logger/types.rs** Modify existing code
{"issue_number": 5792, "pr_number": 5793, "commits_count": 1, "files_changed": 19, "response_length": 2351, "file_count": 19, "needs_breakdown": true}
fix: remove force cookie for docker local setup Local setup for users is failing due to cookie bug. We need to disable cookie from backend so local setup works as expected until we raise a proper fix.
<think> PR Context: - Title: fix(users): remove force cookie for docker setup - Merged: 2024-12-24T12:07:34Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description Users not able to login using local setup. This PR removes force cookie option for docker setup. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 6931, "pr_number": 6932, "commits_count": 0, "files_changed": 1, "response_length": 778, "file_count": 0, "needs_breakdown": false}
[FEATURE] Implement `ApiKeyInterface` for `MockDb` Spin out from #172. Please refer to that issue for more information.
<think> PR Context: - Title: feat(router): implement `ApiKeyInterface` for `MockDb` - Merged: 2023-05-16T19:05:37Z - Files changed: 3 files - Commits: 11 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Stores API keys in a vector in `MockDB`. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(router): implement `ApiKeyInterface` for `MockDb` (#1101) Co-authored-by: Derek Leverenz <derel Files to modify: **crates/router/src/db.rs** Modify existing code **crates/router/src/db/api_keys.rs** Modify existing code **crates/storage_models/src/api_keys.rs** Modify existing code
{"issue_number": 996, "pr_number": 1101, "commits_count": 1, "files_changed": 3, "response_length": 1085, "file_count": 5, "needs_breakdown": false}
[FEATURE] move env vars in selenium test to toml config file ### Feature Description Currently all the dynamic variable in crates/router/tests/connectors/selenium.rs are taken as **ENV** vars which can be moved to sample_auth.toml file which will list all the variables. ### Possible Implementation move all the ENV vars in selenium.rs file to crates/router/tests/connectors/sample_auth.toml , and use all the variables in it. Take crates/router/tests/connectors/connector_auth.rs for reference on how to use toml configs in code. ### Have you spent some time to check if this feature request has been raised before? - [X] I checked and didn't find similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? None
<think> PR Context: - Title: test(selenium): read config from `CONNECTOR_AUTH_FILE_PATH` environment variable and fix bugs in UI tests - Merged: 2023-06-05T07:56:00Z - Files changed: 13 files - Commits: 30 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Closes #924 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with cor </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** test(selenium): read config from `CONNECTOR_AUTH_FILE_PATH` environment variable and fix bugs in UI Files to modify: **crates/api_models/src/webhooks.rs** Modify existing code **crates/router/src/connector/nuvei/transformers.rs** Add: - struct: pub::UrlDetails **crates/router/src/connector/stripe.rs** Modify existing code **crates/router/src/connector/stripe/transformers.rs** Modify existing code **crates/router/tests/connectors/connector_auth.rs** Add: - struct: pub::ConnectorAuthentication **crates/router/tests/connectors/main.rs** Remove: - mod: private::adyen_ui Add: - mod: private::adyen_uk_ui - mod: private::payu_ui - mod: private::worldline_ui **crates/router/tests/connectors/nuvei_ui.rs** Remove: - impl: impl SeleniumTest for NuveiSeleniumTest Add: - function: private::get_connector_name - impl: impl SeleniumTest for NuveiSeleniumTest **crates/router/tests/connectors/payu_ui.rs** Add: - function: private::get_connector_name - function: private::should_make_no_3ds_card_payment - function: private::should_make_gpay_payment - function: private::should_make_no_3ds_card_payment_test - function: private::should_make_gpay_payment_test - struct: private::PayUSeleniumTest - impl: impl SeleniumTest for PayUSeleniumTest **crates/router/tests/connectors/selenium.rs** Modify existing code **crates/router/tests/connectors/stripe_ui.rs** Remove: - impl: impl SeleniumTest for StripeSeleniumTest Add: - function: private::get_connector_name - function: private::should_make_stripe_klarna_payment - function: private::should_make_afterpay_payment - function: private::should_make_stripe_alipay_payment - function: private::should_make_stripe_ideal_bank_redirect_payment - function: private::should_make_stripe_giropay_bank_redirect_payment - function: private::should_make_stripe_eps_bank_redirect_payment - function: private::should_make_stripe_bancontact_card_redirect_payment - function: private::should_make_stripe_p24_redirect_payment - function: private::should_make_stripe_sofort_redirect_payment - function: private::should_make_stripe_ach_bank_debit_payment - function: private::should_make_stripe_becs_bank_debit_payment - function: private::should_make_stripe_sepa_bank_debit_payment - function: private::should_make_stripe_klarna_payment_test - function: private::should_make_afterpay_payment_test - function: private::should_make_stripe_alipay_payment_test - function: private::should_make_stripe_ideal_bank_redirect_payment_test - function: private::should_make_stripe_giropay_bank_redirect_payment_test - function: private::should_make_stripe_eps_bank_redirect_payment_test - function: private::should_make_stripe_bancontact_card_redirect_payment_test - function: private::should_make_stripe_p24_redirect_payment_test - function: private::should_make_stripe_sofort_redirect_payment_test - function: private::should_make_stripe_ach_bank_debit_payment_test - function: private::should_make_stripe_becs_bank_debit_payment_test - function: private::should_make_stripe_sepa_bank_debit_payment_test - impl: impl SeleniumTest for StripeSeleniumTest **crates/router/tests/connectors/worldline_ui.rs** Add: - function: private::get_connector_name - function: private::should_make_card_non_3ds_payment - function: private::should_make_worldline_ideal_redirect_payment - function: private::should_make_worldline_giropay_redirect_payment - function: private::should_make_worldline_giropay_redirect_payment_test - function: private::should_make_worldline_ideal_redirect_payment_test - function: private::should_make_card_non_3ds_payment_test - struct: private::WorldlineSeleniumTest - impl: impl SeleniumTest for WorldlineSeleniumTest
{"issue_number": 924, "pr_number": 1225, "commits_count": 1, "files_changed": 13, "response_length": 4738, "file_count": 13, "needs_breakdown": false}
[FEATURE] Automatic connector_payment_id hashing in v2 if length > 128 in v2 ### Feature Description Automatically hash connector_payment_id longer than 128 chars and store the original in connector_payment_data. ### Possible Implementation Implement hashing in PaymentAttemptUpdate conversion by using ConnectorTransactionId::form_id_and_data, setting connector_payment_id to the hash and preserving the original in connector_payment_data. ### Have you spent some time checking if this feature request has been raised before? - [x] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes, I am willing to submit a PR!
<think> PR Context: - Title: fix(payments): automatic connector_payment_id hashing in v2 if length > 128 - Merged: 2025-09-01T14:34:13Z - Files changed: 2 files - Commits: 6 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Implement hashing in PaymentAttemptUpdate conversion by using ConnectorTransactionId::form_id_and_data, setting connector_payment_id to the hash and preserving the original in connector_payment_data.For worldpay connector_payment_id should be </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(payments): automatic connector_payment_id hashing in v2 if length > 128 (#9017) Files to modify: **crates/diesel_models/src/payment_attempt.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code
{"issue_number": 9016, "pr_number": 9017, "commits_count": 1, "files_changed": 2, "response_length": 1074, "file_count": 4, "needs_breakdown": false}
Adding information about decimal and non decimal currencies There is lack of information about decimal and non decimal currencies in the documentation.
<think> PR Context: - Title: docs: Correction for JPY in API Ref - Merged: 2024-09-11T07:51:57Z - Files changed: 3 files - Commits: 3 commits Implementation approach: ## Description <!-- Describe your changes in detail --> ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding ch </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** docs: Correction for JPY in API Ref (#5853) Files to modify: **crates/api_models/src/payments.rs** Modify existing code
{"issue_number": 5852, "pr_number": 5853, "commits_count": 1, "files_changed": 3, "response_length": 891, "file_count": 3, "needs_breakdown": false}
[FEATURE] integrate NTI flow for Worldpay and Novalnet ### Feature Description Processing card payments using Network Transaction ID is required for below payment processors - - Fiuu - Novalnet - Worldpay This helps make card payments agnostic to the acquirer. ### Possible Implementation Fiuu - closed source Novalnet - https://developer.novalnet.com/encryption/directapi (include `transaction.scheme_tid`) Worldpay - https://developer.worldpay.com/products/access/payments/openapi/other/payment#other/payment/request (Unscheduled payments) ### Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes, I am willing to submit a PR!
<think> PR Context: - Title: feat(connectors): fiuu,novalnet,worldpay - extend NTI flows - Merged: 2025-01-21T08:42:05Z - Files changed: 19 files - Commits: 14 commits Implementation approach: ## Description Described in #6941 This PR adds NTI flow integrations for below connectors - Fiuu - store NTI ID in `payment_methods` from connector's PSync response - Novalnet - use NTI ID for card payments - Worldpay - store and use NTI ID for card payments ### Additional Changes - [ </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connectors): fiuu,novalnet,worldpay - extend NTI flows (#6946) Co-authored-by: hyperswitch-bot[ Files to modify: **crates/hyperswitch_connectors/src/connectors/fiuu.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs** Add: - struct: pub::NovalnetRawCardDetails **crates/hyperswitch_connectors/src/connectors/worldpay.rs** Add: - function: private::get_mandate_details - function: private::get_network_txn_id **crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs** Add: - struct: pub::RawCardDetails **crates/hyperswitch_connectors/src/connectors/worldpay/response.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Add: - function: private::get_card_expiry_year_2_digit - function: private::get_card_issuer - function: private::get_card_expiry_month_year_2_digit_with_delimiter - function: private::get_expiry_date_as_yyyymm - function: private::get_expiry_date_as_mmyyyy - function: private::get_expiry_year_4_digit - function: private::get_expiry_date_as_yymm - function: private::get_expiry_date_as_mmyy - function: private::get_expiry_month_as_i8 - function: private::get_expiry_year_as_i32 - function: private::get_expiry_year_as_4_digit_i32 - function: private::get_cardholder_name - impl: impl CardData for CardDetailsForNetworkTransactionId **crates/router/src/configs/defaults/payment_connector_required_fields.rs** Modify existing code
{"issue_number": 6941, "pr_number": 6946, "commits_count": 1, "files_changed": 19, "response_length": 2509, "file_count": 11, "needs_breakdown": false}
feat: add endpoint for terminate auth select Add support to terminate auth select, - the api will take Auth Select SPT and - it will either SSO or TOTP SPT as per requested scenario
<think> PR Context: - Title: feat(users): add endpoint for terminate auth select - Merged: 2024-06-26T16:37:38Z - Files changed: 8 files - Commits: 1 commits Implementation approach: ## Description - Add endpoint `/auth/select` to terminate auth select - The api will take Auth Select SPT and will give SSO SPT or TOTP SPT based on the choice selected - SSO SPT if user selects continue with SSO - TOTP SPT if user selects continue with TOTP ### Additional Changes - [ ] Thi </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(users): add endpoint for terminate auth select (#5135) Files to modify: **crates/api_models/src/events/user.rs** Modify existing code **crates/api_models/src/user.rs** Add: - struct: pub::AuthSelectRequest **crates/router/src/core/user.rs** Add: - function: pub::terminate_auth_select **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/routes/user.rs** Add: - function: pub::terminate_auth_select **crates/router/src/types/domain/user/decision_manager.rs** Add: - function: pub::skip **crates/router_env/src/logger/types.rs** Modify existing code
{"issue_number": 5127, "pr_number": 5135, "commits_count": 1, "files_changed": 8, "response_length": 1466, "file_count": 10, "needs_breakdown": false}
[FEATURE] Schedule webhook for retry ## Description Refactor webhooks core to add retry logic in webhooks core. Currently, we store information about whether we have sent a webhook or not, improving on this we can implement retry logic to make this more reliable
<think> PR Context: - Title: feat(webhooks): implement automatic retries for failed webhook deliveries using scheduler - Merged: 2024-03-04T06:45:46Z - Files changed: 27 files - Commits: 30 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR adds support for automatically retrying outgoing webhook deliveries in case of failed deliveries, with the aid of the scheduler (process tracker). ### Behavior (Initial Delivery) The behavior when an outgoing webhook is being sen </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(webhooks): implement automatic retries for failed webhook deliveries using scheduler (#3842) Files to modify: **crates/api_models/src/webhooks.rs** Modify existing code **crates/diesel_models/src/process_tracker.rs** Modify existing code **crates/diesel_models/src/query/events.rs** Add: - function: pub::find_by_event_id **crates/router/src/bin/scheduler.rs** Modify existing code **crates/router/src/compatibility/wrap.rs** Modify existing code **crates/router/src/core/errors.rs** Modify existing code **crates/router/src/core/payment_link.rs** Modify existing code **crates/router/src/core/payment_methods/vault.rs** Modify existing code **crates/router/src/core/refunds.rs** Remove: - function: pub::retry_refund_sync_task **crates/router/src/core/webhooks.rs** Modify existing code **crates/router/src/core/webhooks/types.rs** Add: - struct: pub::OutgoingWebhookTrackingData - enum: pub::WebhookDeliveryAttempt **crates/router/src/db/events.rs** Add: - function: private::find_event_by_event_id - function: private::find_event_by_event_id **crates/router/src/db/kafka_store.rs** Add: - function: private::find_event_by_event_id **crates/router/src/events/outgoing_webhook_logs.rs** Modify existing code **crates/router/src/routes/disputes.rs** Modify existing code **crates/router/src/routes/metrics.rs** Modify existing code **crates/router/src/routes/metrics/request.rs** Modify existing code **crates/router/src/services/api.rs** Modify existing code **crates/router/src/utils.rs** Modify existing code **crates/router/src/workflows.rs** Add: - mod: pub::outgoing_webhook_retry **crates/router/src/workflows/outgoing_webhook_retry.rs** Add: - function: private::execute_workflow - function: private::error_handler - function: pub::get_webhook_delivery_retry_schedule_time - function: pub::retry_webhook_delivery_task - function: private::get_outgoing_webhook_content_and_event_type - struct: pub::OutgoingWebhookRetryWorkflow - impl: impl ProcessTrackerWorkflow<AppState> for OutgoingWebhookRetryWorkflow **crates/router/src/workflows/payment_sync.rs** Modify existing code **crates/scheduler/src/consumer/types/process_data.rs** Add: - function: private::default - struct: pub::OutgoingWebhookRetryProcessTrackerMapping - impl: impl Default for OutgoingWebhookRetryProcessTrackerMapping **crates/scheduler/src/db/queue.rs** Modify existing code **crates/scheduler/src/errors.rs** Modify existing code **crates/scheduler/src/utils.rs** Add: - function: private::test_get_delay - mod: private::tests
{"issue_number": 217, "pr_number": 3842, "commits_count": 1, "files_changed": 27, "response_length": 3495, "file_count": 28, "needs_breakdown": true}
feat(users): Add email domain based restriction for dashboard entry APIs Currently Zurich uses okta and they use a specific `auth_id` to see the okta login method. If any user doesn't use `auth_id`, then the user will see the default auth methods that Hyperswitch has and they will be use them to login, which we should restrict for zurich users.
<think> PR Context: - Title: feat(users): Add email domain based restriction for dashboard entry APIs - Merged: 2024-12-30T07:37:08Z - Files changed: 14 files - Commits: 8 commits Implementation approach: ## Description <!-- Describe your changes in detail --> There will be a mapping of email domain and auth methods. This PR will restrict users to enter into the dashboard based on the email domain. ### Additional Changes - [x] This PR modifies the API contract - [x] This PR modifies the da </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(users): Add email domain based restriction for dashboard entry APIs (#6940) Files to modify: **crates/api_models/src/user.rs** Remove: - struct: pub::UpdateUserAuthenticationMethodRequest Add: - enum: pub::UpdateUserAuthenticationMethodRequest **crates/diesel_models/src/query/user_authentication_method.rs** Add: - function: pub::list_user_authentication_methods_for_email_domain **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/diesel_models/src/user_authentication_method.rs** Modify existing code **crates/router/src/core/errors/user.rs** Modify existing code **crates/router/src/core/user.rs** Modify existing code **crates/router/src/db/kafka_store.rs** Add: - function: private::list_user_authentication_methods_for_email_domain **crates/router/src/db/user_authentication_method.rs** Add: - function: private::list_user_authentication_methods_for_email_domain - function: private::list_user_authentication_methods_for_email_domain **crates/router/src/types/domain/user.rs** Add: - function: pub::extract_domain **crates/router/src/types/domain/user/user_authentication_method.rs** Modify existing code **crates/router/src/utils/user.rs** Add: - function: pub::validate_email_domain_auth_type_using_db
{"issue_number": 6939, "pr_number": 6940, "commits_count": 1, "files_changed": 14, "response_length": 2172, "file_count": 14, "needs_breakdown": false}
ci(cypress): Fix Failed Test Cases for the below connectors The Failed Test Cases for the following connectors: - [x] [Deutschebank](https://github.com/juspay/hyperswitch/pull/8193) - [x] [Worldpayxml](https://github.com/juspay/hyperswitch/pull/8193) - [x] [Hipay](https://github.com/juspay/hyperswitch/pull/8563) - [ ] Getnet - [ ] Braintree - [ ] [Archipel](https://github.com/juspay/hyperswitch/pull/8189)
<think> PR Context: - Title: ci(cypress): fix `worldpayxml`, and `deutschebank` cypress test cases - Merged: 2025-07-04T14:47:44Z - Files changed: 6 files - Commits: 30 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Addresses Failed Cypress Test Cases for `deutschebank` and `worldpayxml`. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/enviro </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 8399, "pr_number": 8193, "commits_count": 0, "files_changed": 6, "response_length": 800, "file_count": 0, "needs_breakdown": false}
refactor(payment_methods): Fix db insert for payment method create ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Currently, payment method create API does not insert payment method record in the Db. have added the db call to insert the record if not already present. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> <img width="1512" alt="image" src="https://github.com/juspay/hyperswitch/assets/76486416/29b8d829-367f-4a6a-a84b-4a4e3b35fd6b"> <img width="1495" alt="image" src="https://github.com/juspay/hyperswitch/assets/76486416/ff9e8311-eef7-4beb-9813-60534b216b60"> <img width="1507" alt="image" src="https://github.com/juspay/hyperswitch/assets/76486416/70e42034-66b5-4a00-a703-7fafc8653cdf"> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: ci(runner): rewrite `collection_runner.sh` in rust - Merged: 2023-07-10T10:12:14Z - Files changed: 17 files - Commits: 26 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR aims at re-writing the collection_runner shell script to rust. With this, it drastically reduces the developer efforts to handle shell code along side the rust code by completely removing the shell code requirement. **Note:** #1651 needs to be merged to get Stripe and ACI collection working. #### Usage - Make sure you that </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** ci(runner): rewrite `collection_runner.sh` in rust (#1604) Files to modify: **connector-template/test.rs** Modify existing code **crates/router/tests/connectors/connector_auth.rs** Remove: - function: pub::new - function: private::from - function: private::from - function: private::from - function: private::from - struct: pub::ConnectorAuthentication - struct: pub::HeaderKey - struct: pub::BodyKey - struct: pub::SignatureKey - struct: pub::MultiAuthKey - struct: pub::AutomationConfigs - impl: impl ConnectorAuthentication - impl: impl From<HeaderKey> for ConnectorAuthType - impl: impl From<BodyKey> for ConnectorAuthType - impl: impl From<SignatureKey> for ConnectorAuthType - impl: impl From<MultiAuthKey> for ConnectorAuthType **crates/router/tests/connectors/dummyconnector.rs** Modify existing code **crates/router/tests/connectors/main.rs** Remove: - mod: private::connector_auth **crates/router/tests/integration_demo.rs** Remove: - mod: private::auth **crates/test_utils/src/connector_auth.rs** Add: - function: private::default - function: pub::new - function: private::default - function: pub::inner - function: pub::new - function: private::from - function: private::from - function: private::from - function: private::from - struct: pub::ConnectorAuthentication - struct: pub::ConnectorAuthenticationMap - struct: pub::HeaderKey - struct: pub::BodyKey - struct: pub::SignatureKey - struct: pub::MultiAuthKey - struct: pub::AutomationConfigs - impl: impl Default for ConnectorAuthentication - impl: impl ConnectorAuthentication - impl: impl Default for ConnectorAuthenticationMap - impl: impl ConnectorAuthenticationMap - impl: impl From<HeaderKey> for ConnectorAuthType - impl: impl From<BodyKey> for ConnectorAuthType - impl: impl From<SignatureKey> for ConnectorAuthType - impl: impl From<MultiAuthKey> for ConnectorAuthType **crates/test_utils/src/lib.rs** Add: - mod: pub::connector_auth **crates/test_utils/src/main.rs** Add: - function: private::path_generation - function: private::main - struct: private::Args
{"issue_number": 1651, "pr_number": 1604, "commits_count": 1, "files_changed": 17, "response_length": 3028, "file_count": 11, "needs_breakdown": false}
Fails to build with rust 1.77.0 ### Bug Description I have the following error with rust 1.77.0: ``` --- stderr thread 'main' panicked at crates/router_env/src/cargo_workspace.rs:57:5: Unknown workspace members package ID format. Please run `cargo metadata --format-version=1 | jq '.workspace_members'` and update this build script to match the updated package ID format. ``` The format of ids in 'cargo metadata' has changed with cargo 1.77, it's documented here: https://github.com/rust-lang/cargo/issues/13528 ### Expected Behavior It should build. ### Actual Behavior It fails to build. ### Steps To Reproduce exec `cargo build` with rust 1.77.0 ### Context For The Bug ``` --- stderr thread 'main' panicked at crates/router_env/src/cargo_workspace.rs:57:5: Unknown workspace members package ID format. Please run `cargo metadata --format-version=1 | jq '.workspace_members'` and update this build script to match the updated package ID format. ``` ### Environment If not (or if building/running locally), please provide the following details: 1. Operating System: FreeBSD 2. Rust version (output of `rustc --version`): ```rustc 1.77.0 (aedd173a2 2024-03-17) (built from a source tarball) binary: rustc commit-hash: aedd173a2c086e558c2b66d3743b344f977621a7 commit-date: 2024-03-17 host: x86_64-unknown-freebsd release: 1.77.0 LLVM version: 17.0.6``` 3. App version (output of `cargo r --features vergen -- --version`): `` ### Have you spent some time checking if this bug has been raised before? - [X] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes, I am willing to submit a PR!
<think> PR Context: - Title: build(router_env): obtain workspace member package names from `cargo_metadata` more deterministically - Merged: 2024-03-27T10:13:23Z - Files changed: 3 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> ORIGINAL PR: https://github.com/juspay/hyperswitch/pull/4139 This PR updates the build script code to obtain cargo workspace member package names to use a better and more deterministic way to do so. Previously, we used to perform string m </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** build(router_env): obtain workspace member package names from `cargo_metadata` more deterministicall Files to modify: **crates/router_env/src/cargo_workspace.rs** Modify existing code
{"issue_number": 4137, "pr_number": 4227, "commits_count": 1, "files_changed": 3, "response_length": 1021, "file_count": 3, "needs_breakdown": false}
refactor(connector): implement amount converter framework for authorizedotnet, bankofamerica ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> the existing amount conversion framework for certain connector is outdated. we need to migrate those connector to using the latest and greatest amount converter framework. base - float/string major unit minor - minor unit / string minor unit ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> get_currency_unit is outdated. use `convert_amount` instead. closes https://github.com/juspay/hyperswitch/issues/8877 ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Make a payment through the below given connectors: <details> <summary>AuthorizeDotNet</summary> ```curl curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_GPAm65scUWcFztLSboWLXKFGeTVEHb3gnvFU5hBUCDITplwIhCvZTIJtoEJXHm4f' \ --data-raw '{ "amount": 91571, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 91571, "customer_id": "abcd", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "370000000000002", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "900" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "IN", "first_name": "PiX" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "IN", "first_name": "PiX" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` ```json { "payment_id": "pay_6X2FhljlpXZElDX4S6w4", "merchant_id": "postman_merchant_GHAction_1754653643", "status": "succeeded", "amount": 91571, "net_amount": 91571, "shipping_cost": null, "amount_capturable": 0, "amount_received": 91571, "connector": "authorizedotnet", "client_secret": "pay_6X2FhljlpXZElDX4S6w4_secret_wzBJ9hkLmMcvSi0TeOEO", "created": "2025-08-08T11:47:35.240Z", "currency": "USD", "customer_id": "abcd", "customer": { "id": "abcd", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "0002", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "370000", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "payment_checks": { "description": "The street address and postal code matched.", "avs_result_code": "Y" }, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "IN", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "PiX", "last_name": null, "origin_zip": null }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "IN", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "PiX", "last_name": null, "origin_zip": null }, "phone": null, "email": null }, "order_details": null, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "abcd", "created_at": 1754653655, "expires": 1754657255, "secret": "epk_ea6ff7c1100c41d1bba3b9da469d973c" }, "manual_retry_allowed": false, "connector_transaction_id": "120068658794", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "120068658794", "payment_link": null, "profile_id": "pro_NKH5miAdwTzhqZnuLPi0", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_bPe6GSr5FuXF6Rt5G61B", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-08T12:02:35.240Z", "fingerprint": null, "browser_info": null, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-08-08T11:47:36.237Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null } ``` <img width="1852" height="196" alt="image" src="https://github.com/user-attachments/assets/b4cbc146-b88e-4b9f-8b2c-ad99501b2589" /> </details> <details> <summary>BankOfAmerica</summary> ```curl curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_HVl6AlLdFHw0br1H7IymoIgOV4rO4SMCHUl1ZUKtXO3qQy3s1wlEEA5IVRUqPTxn' \ --data-raw '{ "amount": 6540, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "StripeCustomer", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "setup_future_usage": "on_session", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "12", "card_exp_year": "30", "card_holder_name": "joseph Doe", "card_cvc": "123" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` ```json { "payment_id": "pay_25C27lo5euAv5R8VDQQg", "merchant_id": "postman_merchant_GHAction_9700a943-a6a8-4bed-b484-3e2f24f5344a", "status": "succeeded", "amount": 6540, "net_amount": 6540, "shipping_cost": null, "amount_capturable": 0, "amount_received": 6540, "connector": "bankofamerica", "client_secret": "pay_25C27lo5euAv5R8VDQQg_secret_OEIaAxPmEZgTswpAE59V", "created": "2025-08-08T12:24:05.622Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": "CREDIT", "card_network": "Visa", "card_issuer": "JP Morgan", "card_issuing_country": "INDIA", "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "12", "card_exp_year": "30", "card_holder_name": "joseph Doe", "payment_checks": { "eci": null, "cavv": null, "eci_raw": null, "avs_response": { "code": "Y", "codeRaw": "Y" }, "approval_code": "831000", "card_verification": null, "consumer_authentication_response": null }, "authentication_data": { "acs_transaction_id": null, "system_trace_audit_number": null, "retrieval_reference_number": null } }, "billing": null }, "payment_token": "token_KTsWPzXqxSUFnBg64dG9", "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe", "origin_zip": null }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe", "origin_zip": null }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "StripeCustomer", "created_at": 1754655845, "expires": 1754659445, "secret": "epk_dbaa2f9dc5ca4740a7ee13edb03af456" }, "manual_retry_allowed": false, "connector_transaction_id": "7546558471516585304807", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_25C27lo5euAv5R8VDQQg_1", "payment_link": null, "profile_id": "pro_7ehsLWIksrpK2lU2ZorM", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_QXI5zECI8F4KGJwceq1a", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-08T12:39:05.622Z", "fingerprint": null, "browser_info": null, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-08-08T12:24:07.638Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null } ``` <img width="1852" height="174" alt="image" src="https://github.com/user-attachments/assets/cb60d35d-c7f6-4518-aabc-2a836e38c860" /> </details> <details> <summary>Refunds should work too</summary> ```curl curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_ecAzD6wCRTJ9vle4P8dSItXfE8hyWMx5ZInf03wYUoDE9YuOnbOU4ppvw24R12HP' \ --data '{ "payment_id": "pay_fFRCa0avK5F1mMiNIRDo", "amount": 600, "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` ```json { "refund_id": "ref_yiG83sVnRamfqs9wZui4", "payment_id": "pay_fFRCa0avK5F1mMiNIRDo", "amount": 600, "currency": "USD", "status": "pending", "reason": "Customer returned product", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "error_message": null, "error_code": null, "unified_code": null, "unified_message": null, "created_at": "2025-08-08T12:39:37.424Z", "updated_at": "2025-08-08T12:39:39.187Z", "connector": "barclaycard", "profile_id": "pro_zdyJ6MbtU1anAIfbiSim", "merchant_connector_id": "mca_P2TahMotR8ucEv5vaKDr", "split_refunds": null, "issuer_error_code": null, "issuer_error_message": null } ``` <img width="1857" height="61" alt="image" src="https://github.com/user-attachments/assets/df2907dd-7c18-47fa-af6d-b3652411cc19" /> </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `just clippy && just clippy_v2` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
<think> PR Context: - Title: feat(connector): add amount conversion framework to Powertranz - Merged: 2025-10-16T13:10:15Z - Files changed: 5 files - Commits: 16 commits Implementation approach: ## Description This PR implements the amount conversion framework for the Powertranz connector, transitioning from deprecated `f64`-based amount handling to the standardized type-safe `FloatMajorUnit` system. **Changes Made:** - Added `AmountConvertor` trait implementation with `FloatMajorUnitForConnector` to the `Powertranz` struct - Imp </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 8878, "pr_number": 9752, "commits_count": 0, "files_changed": 5, "response_length": 793, "file_count": 1, "needs_breakdown": false}
[REFACTOR] : [Worldline] Error Message For Connector Implementation ### :memo: Feature Description - In terms of errors, we are currently throwing a 'not supported' message, which shouldn't be the case as we are yet to decide on the implementation. ### :hammer: Possible Implementation - In order to manage payment methods that are not implemented by Hyperswitch or yet to be implemented, the connector transformers file should make use of the NotImplemented ConnectorError enum variant. - By doing so, we will throw same error message for all the Connector Implementation - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/2831 :bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: refactor(connector): [Worldline] change error message from NotSupported to NotImplemented - Merged: 2023-11-22T19:48:46Z - Files changed: 1 files - Commits: 2 commits Implementation approach: ## Description <!-- Describe your changes in detail --> ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding ch </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(connector): [Worldline] change error message from NotSupported to NotImplemented (#2893) Files to modify: **crates/router/src/connector/worldline/transformers.rs** Modify existing code
{"issue_number": 2866, "pr_number": 2893, "commits_count": 1, "files_changed": 1, "response_length": 1019, "file_count": 3, "needs_breakdown": false}
[FEATURE] log "MERCHANT_ID_NOT_IN_FLOW" if merchant_id is not found ### Feature Description Here, https://github.com/juspay/hyperswitch/blob/9b92d046de9fb794d67163582af4360d5e558037/crates/router/src/services/api.rs#L729 Instead of `unwrap_or("")`, ### Possible Implementation Change it to some const `MERCHANT_ID_NOT_FLOW`. ### Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? No, but I'm happy to collaborate on a PR with someone else
<think> PR Context: - Title: refactor: set merchant_id as `MERCHANT_ID_NOT_FOUND` for traces and metrics if not found - Merged: 2023-09-17T16:05:46Z - Files changed: 1 files - Commits: 3 commits Implementation approach: ## Description <!-- Describe your changes in detail --> In case the merchant_id is not found from the request, instead of using an empty string `("")` as merchant_id for traces and metrics, use `"MERCHANT_ID_NOT_FOUND"` ### Additional Changes - [ ] This PR modifies the API contract - [ ] Thi </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor: set merchant_id as `MERCHANT_ID_NOT_FOUND` for traces and metrics if not found (#2156) Files to modify: **crates/router/src/services/api.rs** Modify existing code
{"issue_number": 2153, "pr_number": 2156, "commits_count": 1, "files_changed": 1, "response_length": 997, "file_count": 3, "needs_breakdown": false}
feat(session_token): serialize with camelCase for gpay token ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Refactoring ## Description <!-- Describe your changes in detail --> Send the google pay session token ( taken from metadata ), in camelCase since google pay is expecting it in camelCase. <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> Refactoring request from the frontend team ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ![Screenshot 2023-01-09 at 3 26 36 PM](https://user-images.githubusercontent.com/48803246/211281999-51943c39-5826-4d54-a471-208efdad944e.png) ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code
<think> PR Context: - Title: revert: serialize with camelCase for gpay token - Merged: 2023-01-11T09:55:12Z - Files changed: 2 files - Commits: 3 commits Implementation approach: Reverts juspay/hyperswitch#324 In order to maintain consistency in the api, it has been decided that this transformation will be done in the frontend. @bernard-eugine </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** revert: serialize with camelCase for gpay token (#328) Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/router/src/core/payments/flows/session_flow.rs** Modify existing code
{"issue_number": 324, "pr_number": 328, "commits_count": 1, "files_changed": 2, "response_length": 666, "file_count": 4, "needs_breakdown": false}
[FEATURE] Authentication Analytics ### Feature Description Authentication analytics becomes one of the important components to track separate authentication system health and impact. ### Possible Implementation Added authentication events in SDK logs and pushed to /logs/sdk (Clickhouse) Generate aggregate queries over clickhouse. ### Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes, I am willing to submit a PR!
<think> PR Context: - Title: feat: authentication analytics - Merged: 2024-05-23T10:27:10Z - Files changed: 10 files - Commits: 2 commits Implementation approach: ## Description Modified authentication analytics queries to query api_events ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat: authentication analytics (#4684) Files to modify: **crates/analytics/src/auth_events/accumulator.rs** Modify existing code **crates/analytics/src/auth_events/core.rs** Modify existing code **crates/analytics/src/auth_events/metrics.rs** Add: - mod: private::frictionless_success_count **crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs** Modify existing code **crates/analytics/src/auth_events/metrics/challenge_success_count.rs** Modify existing code **crates/analytics/src/auth_events/metrics/frictionless_success_count.rs** Add: - function: private::load_metrics - struct: pub::FrictionlessSuccessCount - impl: impl super::AuthEventMetric<T> for FrictionlessSuccessCount **crates/analytics/src/clickhouse.rs** Modify existing code **crates/analytics/src/sqlx.rs** Modify existing code **crates/analytics/src/types.rs** Modify existing code **crates/api_models/src/analytics/auth_events.rs** Add: - struct: pub::FrictionlessSuccessCount
{"issue_number": 4252, "pr_number": 4684, "commits_count": 1, "files_changed": 10, "response_length": 1780, "file_count": 12, "needs_breakdown": false}
refactor: use lowercase names for run environment and config files ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates ## Description <!-- Describe your changes in detail --> This PR updates the `RUN_ENV` environment variable and config files to use `lowercase` names instead of `PascalCase` names. In addition, this fixes the values of `SCHEDULER_FLOW` environment variable in the `Dockerfile` and release workflows to use `snake_case` names instead of `PascalCase` names, since the code expected the names to be `snake_case` already. ### Additional Changes - [ ] This PR modifies the database schema - [x] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> This updates the file names for config files to use their lowercase names instead. This could break our sandbox environment for this reason. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> This decision originated from the discussion at https://github.com/juspay/hyperswitch/pull/794#discussion_r1144947357 when I was working on the PR. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Built Docker images, verified things work as expected. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: doc:Changelog for release v0.5.7 - Merged: 2023-04-19T08:01:28Z - Files changed: 1 files - Commits: 4 commits Implementation approach: # 0.5.7 (2023-04-18) ## New Features * **connector:** * [Shift4] add support for card 3DS payment (#828) (29999fe5) * [Nuvei] add support for card mandates (#818) (298a0a49) * **bank_redirects:** modify api contract for sofort (#880) (fc2e4514) * add template code for connector forte (#854) ## Bug Fixes * **connector:** [coinbase] make metadata as option parameter (#887) (f5728955) * Update events table after notifying merchant (#871) (ba013026) * **stripe:** remove </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 801, "pr_number": 907, "commits_count": 0, "files_changed": 1, "response_length": 762, "file_count": 4, "needs_breakdown": false}
fix(payments): populate merchant order ref id in list ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Populate merchant order reference id in payments list response ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context Closes [#5309](https://github.com/juspay/hyperswitch/issues/5309) ## How did you test it? For a particular payment merchant_order_ref_id_should be pouplated: Use list api: ``` curl --location 'http://localhost:8080/payments/list' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer JWT' \ --data '{ "payment_id": "test_XBmXZFG8IcR9CCAvFgxG" }' ``` Response: ``` { "count": 1, "total_count": 1, "data": [ { "payment_id": "test_XBmXZFG8IcR9CCAvFgxG", "merchant_id": "merchant_1720779856", "status": "succeeded", "amount": 20000, "net_amount": 0, "amount_capturable": 20000, "amount_received": null, "connector": "paypal_test", "client_secret": "test_XBmXZFG8IcR9CCAvFgxG_secret_61VMg0zl0IqpGhSJviK9", "created": "2024-07-12T08:46:38.000Z", "currency": "USD", "customer_id": "hs-dashboard-user", "customer": null, "description": "This is a sample payment", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": null, "payment_method": "card", "payment_method_data": null, "payment_token": null, "shipping": null, "billing": null, "order_details": null, "email": null, "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": null, "connector_transaction_id": "test_XBmXZFG8IcR9CCAvFgxG_1", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_lTdNfE1Lrfu0ajKZY5Dl", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": null, "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": null, "expires_on": null, "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": null, "charges": null, "frm_metadata": null, "merchant_order_reference_id": "test_merchant_order_ref_id" } ] } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
<think> PR Context: - Title: fix(payments): populate merchant order ref id in list - Merged: 2024-07-15T11:11:41Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description Hot fix to 2024.07.10 Populate merchant reference id Main PR: #5310 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(payments): populate merchant order ref id in list (#5321) Files to modify: **crates/router/src/core/payments/transformers.rs** Modify existing code
{"issue_number": 5310, "pr_number": 5321, "commits_count": 1, "files_changed": 1, "response_length": 941, "file_count": 3, "needs_breakdown": false}
feat(disputes): add support for disputes aggregate 1. Support for disputes aggregate 2. Support for disputes aggregate in profile level
<think> PR Context: - Title: feat(disputes): add support for disputes aggregate - Merged: 2024-09-18T07:25:25Z - Files changed: 11 files - Commits: 15 commits Implementation approach: ## Description <!-- Describe your changes in detail --> - Add support for disputes aggregate - Add support for profile level disputes aggregate - For now it will have list of intent status along with the their count for a given time range. ### Additional Changes - [X] This PR modifies t </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(disputes): add support for disputes aggregate (#5896) Co-authored-by: hyperswitch-bot[bot] <148 Files to modify: **crates/api_models/src/disputes.rs** Add: - struct: pub::DisputesAggregateResponse **crates/api_models/src/events/dispute.rs** Add: - function: private::get_api_event_type - impl: impl ApiEventMetric for DisputesAggregateResponse **crates/common_enums/src/enums.rs** Modify existing code **crates/router/src/core/disputes.rs** Add: - function: pub::get_aggregates_for_disputes **crates/router/src/db/dispute.rs** Add: - function: private::get_dispute_status_with_count - function: private::get_dispute_status_with_count **crates/router/src/db/kafka_store.rs** Add: - function: private::get_dispute_status_with_count **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/disputes.rs** Add: - function: pub::get_disputes_aggregate - function: pub::get_disputes_aggregate_profile **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/types/storage/dispute.rs** Add: - function: private::get_dispute_status_with_count **crates/router_env/src/logger/types.rs** Modify existing code
{"issue_number": 5898, "pr_number": 5896, "commits_count": 1, "files_changed": 11, "response_length": 2014, "file_count": 13, "needs_breakdown": false}
feat(users_roles): support switch for new user hierarchy Support switch - At org level - At merchant level - At profile level - For internal users Issue new token and set permissions accordingly
<think> PR Context: - Title: feat(user_roles): support switch for new hierarchy - Merged: 2024-08-28T08:25:55Z - Files changed: 11 files - Commits: 12 commits Implementation approach: ## Description Support switch for org, merchant, profile and internal users. For now switch exist only for merchant. After new switch, new token will be issued. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modif </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(user_roles): support switch for new hierarchy (#5692) Co-authored-by: hyperswitch-bot[bot] <148 Files to modify: **crates/api_models/src/events/user.rs** Modify existing code **crates/api_models/src/events/user_role.rs** Modify existing code **crates/api_models/src/user.rs** Remove: - struct: pub::SwitchMerchantIdRequest Add: - struct: pub::SwitchOrganizationRequest - struct: pub::SwitchMerchantRequest **crates/api_models/src/user_role.rs** Remove: - struct: pub::TransferOrgOwnershipRequest **crates/router/src/core/user.rs** Add: - function: pub::switch_org_for_user - function: pub::switch_merchant_for_user_in_org - function: pub::switch_profile_for_user_in_org_and_merchant **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/routes/user.rs** Add: - function: pub::switch_org_for_user - function: pub::switch_merchant_for_user_in_org - function: pub::switch_profile_for_user_in_org_and_merchant **crates/router/src/utils/user.rs** Modify existing code **crates/router/src/utils/user_role.rs** Add: - function: pub::set_role_permissions_in_cache_by_role_id_merchant_id_org_id **crates/router_env/src/logger/types.rs** Modify existing code
{"issue_number": 5689, "pr_number": 5692, "commits_count": 1, "files_changed": 11, "response_length": 2105, "file_count": 13, "needs_breakdown": false}
refactor(webhooks): check event type not supported before checking for profile_id ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix ## Description <!-- Describe your changes in detail --> This PR fixes the 4xx that we have been encountering in webhooks. More information can be found in this issue https://github.com/juspay/hyperswitch-cloud/issues/2691 ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> There are certain webhook events that are not supposed to be processed by hyperswitch. But the current implementation has this check to skip the webhook event type later once we decode the `profile_id` to find the merchant connector account. Few modifications have been made in this PR to overcome this problem. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> - Create a payment and check if webhooks are received and then 200 response is sent Curl for creating the payment. ```bash curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'api-key:' \ --data-raw '{ "amount": 6969, "currency": "USD", "confirm": true, "name": "John Dough", "capture_method": "automatic", "phone": "999999999", "phone_country_code": "+65", "customer_id": "cus_PAxm0MeCGM5TowgDKPc9", "email": "example@juspay.in", "setup_future_usage": "off_session", "description": "Its my fourth payment request", "authentication_type": "no_three_ds", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "123" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrisoff Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "Narayan", "last_name": "Doe" } }, "mandate_data": { "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "127.0.0.1", "user_agent": "amet irure esse" } }, "mandate_type": { "multi_use": { "amount": 7000, "currency": "USD" } } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" } }, "statement_descriptor_name": "hola", "statement_descriptor_suffix": "JS", "metadata": { "key1":"hello" } }' ``` ![image](https://github.com/juspay/hyperswitch/assets/48803246/4c5641ba-9f14-42f7-89fb-d2999ae6e875) The data can be found on stripe dashboard whether all webhooks are responded properly ( This is a reference image only and does not represent actual test data ) <img width="1665" alt="image" src="https://github.com/juspay/hyperswitch/assets/48803246/cd4f16ac-d1a9-4834-bbcb-86b24e43660b"> ## Impact area Webhooks - All webhook events ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code
<think> PR Context: - Title: feat(connector): accept connector_transaction_id in error_response of connector flows for Trustpay - Merged: 2023-12-07T09:38:15Z - Files changed: 2 files - Commits: 4 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Resolves [#3543](https://github.com/juspay/hyperswitch-cloud/issues/3543) ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screen </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): accept connector_transaction_id in error_response of connector flows for Trustpay ( Files to modify: **crates/router/src/connector/trustpay.rs** Modify existing code **crates/router/src/connector/trustpay/transformers.rs** Remove: - struct: pub::TrustPayTransactionStatusErrorResponse
{"issue_number": 3543, "pr_number": 3060, "commits_count": 1, "files_changed": 2, "response_length": 1143, "file_count": 4, "needs_breakdown": false}
fix(connector): [Trustpay] Add mapping to error code 100.390.105 ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Error mapping done to code `100.390.105` ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> No testing can be done since it matches error code in production which cant be replicated ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: fix(connector): [Trustpay] Add mapping to error code 100.390.105 - Merged: 2024-03-11T07:30:27Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Error mapping done to code `100.390.105` PR merged in main - #3968 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/enviro </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(connector): [Trustpay] Add mapping to error code 100.390.105 (#4019) Files to modify: **crates/router/src/connector/trustpay/transformers.rs** Modify existing code
{"issue_number": 3968, "pr_number": 4019, "commits_count": 1, "files_changed": 1, "response_length": 968, "file_count": 3, "needs_breakdown": false}
db: Implement KV for Refund table ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates ## Description <!-- Describe your changes in detail --> Implement KV for refund table ### Additional Changes - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> Implement Redis KV implementation for Refund table using reverse lookup. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: refactor: shrink sizes of `VARCHAR` columns and rename some columns - Merged: 2022-12-22T06:57:59Z - Files changed: 26 files - Commits: 4 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR includes the following changes: - Fixes typos in older rollback migrations. - Shrinks sizes of database columns which previously were `VARCHAR(255)`.The general rule followed with respect to IDs has been as follows: - IDs generated by us or sent by merchants a </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor: shrink sizes of `VARCHAR` columns and rename some columns (#188) Files to modify: **crates/router/src/core/payments/operations/payment_cancel.rs** Modify existing code **crates/router/src/core/payments/operations/payment_capture.rs** Modify existing code **crates/router/src/core/payments/operations/payment_confirm.rs** Modify existing code **crates/router/src/core/payments/operations/payment_create.rs** Modify existing code **crates/router/src/core/payments/operations/payment_session.rs** Modify existing code **crates/router/src/core/payments/operations/payment_start.rs** Modify existing code **crates/router/src/core/payments/operations/payment_status.rs** Modify existing code **crates/router/src/core/payments/operations/payment_update.rs** Modify existing code **crates/router/src/core/refunds.rs** Modify existing code **crates/router/src/core/utils.rs** Modify existing code **crates/router/src/db/connector_response.rs** Modify existing code **crates/router/src/db/payment_attempt.rs** Modify existing code **crates/router/src/db/refund.rs** Modify existing code **crates/storage_models/src/connector_response.rs** Modify existing code **crates/storage_models/src/mandate.rs** Modify existing code **crates/storage_models/src/payment_method.rs** Modify existing code **crates/storage_models/src/query/connector_response.rs** Modify existing code **crates/storage_models/src/query/payment_attempt.rs** Modify existing code **crates/storage_models/src/query/refund.rs** Modify existing code **crates/storage_models/src/refund.rs** Modify existing code **crates/storage_models/src/schema.rs** Modify existing code
{"issue_number": 149, "pr_number": 188, "commits_count": 1, "files_changed": 26, "response_length": 2499, "file_count": 23, "needs_breakdown": true}
feat: support profile level delete in V1 - V2 Add support to delete user role - Support profile level delete along with merchant level delete. - In v1v2 version, delete from both V1 and V2
<think> PR Context: - Title: feat(users): add support for profile user delete - Merged: 2024-08-14T15:00:53Z - Files changed: 5 files - Commits: 14 commits Implementation approach: ## Description - Add support to delete profile level users - Delete is backward compatible - Delete to support both V1 and V2 operations accordingly ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(users): add support for profile user delete (#5541) Co-authored-by: hyperswitch-bot[bot] <14852 Files to modify: **crates/common_enums/src/enums.rs** Modify existing code **crates/diesel_models/src/query/user_role.rs** Remove: - function: pub::delete_by_user_id_merchant_id Add: - function: pub::find_by_user_id_org_id_merchant_id_profile_id - function: pub::delete_by_user_id_org_id_merchant_id_profile_id **crates/router/src/core/user_role.rs** Modify existing code **crates/router/src/db/kafka_store.rs** Add: - function: private::list_user_roles_by_user_id **crates/router/src/db/user_role.rs** Remove: - function: private::delete_user_role_by_user_id_merchant_id - function: private::delete_user_role_by_user_id_merchant_id Add: - function: private::find_user_role_by_user_id_and_lineage - function: private::delete_user_role_by_user_id_and_lineage - function: private::find_user_role_by_user_id_and_lineage - function: private::delete_user_role_by_user_id_and_lineage
{"issue_number": 5540, "pr_number": 5541, "commits_count": 1, "files_changed": 5, "response_length": 1820, "file_count": 7, "needs_breakdown": false}
Refactor(routing): Fallback to current active routing algorithm Add connectors from the current active routing algorithm before fallback connectors
<think> PR Context: - Title: refactor(routing): Add connectors from current active routing algorithm before adding fallback connectors - Merged: 2025-05-14T18:35:38Z - Files changed: 1 files - Commits: 11 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR modifies critical paths , specifically the `decide_connector` function and the `route_connector_v1_for_payments` function in the payments confirm flow. These changes are made corresponding to a use case for Narvar. In case the connect </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(routing): Add connectors from current active routing algorithm before adding fallback conne Files to modify: **crates/router/src/core/payments.rs** Modify existing code
{"issue_number": 7920, "pr_number": 7921, "commits_count": 1, "files_changed": 1, "response_length": 1020, "file_count": 3, "needs_breakdown": false}
[Cypress] Add more connectors to GitHub CI - Bluesnap - PayPal - Iatapay
<think> PR Context: - Title: ci(cypress): fix nmi and paypal - Merged: 2025-02-06T10:39:20Z - Files changed: 5 files - Commits: 30 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR fixes NTID for PayPal by disabling it from running. closes #7172 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/e </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 7172, "pr_number": 7173, "commits_count": 0, "files_changed": 5, "response_length": 762, "file_count": 0, "needs_breakdown": false}
One click docker setup A script is needed to ensure one click docker setup, to minimise issues faced by users. > Run the whole setup with simple command > Show output with localhost links for different setups
<think> PR Context: - Title: docs: update the setup docs - Merged: 2025-04-24T07:56:02Z - Files changed: 2 files - Commits: 5 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Updated the readme and local setup guide to add the new script ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment varia </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 7761, "pr_number": 7839, "commits_count": 0, "files_changed": 2, "response_length": 757, "file_count": 0, "needs_breakdown": false}
feat(connector): add dynamic duitnow qr code, google pay and applpe pay for fiuu ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR adds support for duitnow dynamic qr code flow, Googlepay, Applepay. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [x] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> - duitnow cannot be tested in sbx, So i have tested it in prod env - ![image (5)](https://github.com/user-attachments/assets/a08a6fa2-3259-4f0c-b525-bf204ff96031) - google pay request : ``` { "amount": 300, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 300, "customer_id": "StripeCustomer", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method": "wallet", "payment_method_type": "google_pay", "payment_method_data": { "wallet": { "google_pay":{ "type" :"wallet", "info" : { "card_network":"visa", "card_details":"ajd" }, "description": "Its my first payment request", "tokenization_data" :{ "type": "sdjh", "token":"{\"signature\":\"MEUCIQDhc8VY22qWWGPHGGvsu7XPj/SkYdWtmPZYWBEsRjZo/wIgG4RFdnIExKiPDECBnEzLuzhes5+KGGFAAdkHBfgRkho\\u003d\",\"intermediateSigningKey\":{\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEItPcTdXMwAWYJfvcUnhC/zNTwD3rerU1P3kEUifXS+upKS3gLLiOod7cGmtYfybCOtXZCPWtF8Hm7phz3KXoVQ\\\\u003d\\\\u003d\\\",\\\"keyExpiration\\\":\\\"1728638833861\\\"}\",\"signatures\":[\"MEYCIQC524wPLpk2wb2UflHW7pcjVlWt3U6wftis+aSOi6IDpQIhAOXQIJcB2JwaDAISPR87q/FWfaN5OqKYju1QhHAMpSHg\"]},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"UVeWcXQglAL3U545D6KEWV35CHjXUEA47v6QKBdLwo6Zu5JzyEdkqmOpRGm7GP83YRyIrFojhQ2QVM8vPP0kFbPuBTmne/6452lES2undtKlSy62VbXp5EUZQ1Ril3AL+FG3/r6JeNP7JUyUP0VCOMXOMW6DG+pE7M5HSQm2wCQJgf6BKj9SXn3MO4xJs6EALoXm361Yvo2QNzdv12RMLAcrdujVcDsfoY0ALNQAY/Ei9HOPLQcWqBNNNF0KH0ZLru0reSrS4vWJ4hyoAsr2hoa+Py11Kvdwks0f+my2/nliaGZXKeCNRMznWztu52dPQF1kHWRZTDNBVTBvKocoRmnGAfI6rS13qaWmkGkqxLAfgNVJrei8qLDVMCyYMOBcoaMga+3vw0MOvX3EoV+FjZAkToWS1aQUD8E0FrFgbBQqJxQLLDfhh6VjzOAJQv5ypmQLw1yKQTgyzzgcOtWVb9Kbyw6QZWDTxA\\\\u003d\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BPrP92rJx4/fQZQItlgvyYF96u29hpavsUWa5LrfdDHnHt3/wq6YsfTDltkRPo5+WewNMLn/wJc6OySIYsGVQSU\\\\u003d\\\",\\\"tag\\\":\\\"D6iTFqN7W3rkMeLBwSka6jTv1Y+v9FppS3myc+MkGuM\\\\u003d\\\"}\"}" } } } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } } ``` response ``` { "payment_id": "pay_0TvE1N3qd0gxFkgAB6fx", "merchant_id": "merchant_1727958908", "status": "succeeded", "amount": 300, "net_amount": 300, "amount_capturable": 0, "amount_received": 300, "connector": "fiuu", "client_secret": "pay_0TvE1N3qd0gxFkgAB6fx_secret_qGdokCqwpIc5M0klVaHf", "created": "2024-10-03T14:08:13.743Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "google_pay": { "last4": "ajd", "card_network": "visa", "type": "wallet" } }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "google_pay", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "StripeCustomer", "created_at": 1727964493, "expires": 1727968093, "secret": "epk_340c7bc950df4779b2be2e177b93a13c" }, "manual_retry_allowed": false, "connector_transaction_id": "30882067", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_BxBe6yNCNIrIl2ZlRINC", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_M3jaHXlh8BQ3RJr1hysS", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-10-03T14:23:13.743Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-10-03T14:08:14.252Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` applepay respone: apple decrypt flow needs to be tested in prod env, this currently fails with transaction not approved in fiuu sandbox account. This needs to be tested in custom pod after deployment. ``` { "payment_id": "pay_f65jeQLCsKkrInUTxfLQ", "merchant_id": "merchant_1727976558", "status": "failed", "amount": 650, "net_amount": 650, "amount_capturable": 0, "amount_received": null, "connector": "fiuu", "client_secret": "pay_f65jeQLCsKkrInUTxfLQ_secret_KmLs0fu5NGG6VGM1kqJH", "created": "2024-10-03T17:30:31.588Z", "currency": "USD", "customer_id": "test_fb", "customer": { "id": "test_fb", "name": "Joseph Doe", "email": "something@gmail.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "apple_pay": { "last4": "0326", "card_network": "Mastercard", "type": "debit" } }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": "300", "error_message": "Transaction not approved", "unified_code": "UE_000", "unified_message": "Something went wrong", "payment_experience": null, "payment_method_type": "apple_pay", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "test_fb", "created_at": 1727976631, "expires": 1727980231, "secret": "epk_6a202a2569dd49818f19120a2f7009fb" }, "manual_retry_allowed": true, "connector_transaction_id": null, "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_njKZKluJ5UYynFk6UCMX", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_CANN8EPyc5P0ppj8SQIB", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-10-03T17:45:31.588Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-10-03T17:30:32.879Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
<think> PR Context: - Title: feat(connector): add dynamic duitnow qr code, google pay and applpepay for fiuu - Merged: 2024-10-10T07:58:52Z - Files changed: 6 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Original PR Number : (#6204) ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): add dynamic duitnow qr code, google pay and applpepay for fiuu (#6284) Co-authored- Files to modify: **crates/hyperswitch_connectors/src/connectors/fiuu.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs** Remove: - struct: pub::FiuuFPXPyamentRequest - enum: private::TxnType Add: - function: private::try_from - function: private::try_from - function: private::try_from - function: private::try_from - struct: pub::FiuuQRData - struct: pub::FiuuCardData - struct: pub::FiuuApplePayData - struct: pub::FiuuGooglePayData - struct: pub::QrTxnData - struct: pub::QrRequestData - struct: pub::FiuuSyncStatus - enum: pub::TxnType - enum: pub::FiuuTokenType - enum: pub::StatCode - impl: impl TryFrom<(&Card, &i32)> for FiuuPaymentMethodData - impl: impl TryFrom<&GooglePayWalletData> for FiuuPaymentMethodData - impl: impl TryFrom<FiuuSyncStatus> for enums::AttemptStatus **crates/hyperswitch_connectors/src/utils.rs** Add: - function: private::get_four_digit_expiry_year - function: private::get_expiry_month - trait: pub::ApplePayDecrypt - impl: impl ApplePayDecrypt for Box<ApplePayPredecryptData>
{"issue_number": 6204, "pr_number": 6284, "commits_count": 1, "files_changed": 6, "response_length": 2072, "file_count": 5, "needs_breakdown": false}
[FEATURE]: [Airwallex] Use `connector_response_reference_id` as reference to merchant ### :memo: Feature Description - Reference id are used to map transactions in the connector’s dashboard. - Hyperswitch manages several reference ids, such as `payment_id`, `attempt_id`, and `connector_transaction_id` for a single transaction. - However, merchants may encounter uncertainty when determining which ID to utilize in the connector dashboard to identify the payment. ### :hammer: Possible Implementation - When we receive a response from the connector for the payment, we deserialize it and populate the `response` field in RouterData. - For the `TransactionResponse` type, we must fill the `connector_response_reference_id` with a corresponding reference id for the merchant to identify the transaction. - One might need to have exposure to api docs of the connector for which it is being implemented to decide what to fill in connector_response_reference_id. - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/1735 🔖 Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: feat(connector): [Airwallex] Use connector_response_reference_id as reference to merchant - Merged: 2024-10-24T13:31:41Z - Files changed: 1 files - Commits: 4 commits Implementation approach: ## Description The `connector_response_reference_id` parameter has been set for the Airwallex Payment Solutions for uniform reference and transaction tracking. ### File Changes - [x] This PR modifies the Airwallex Transformers file. **Location- router/src/connector/airwallex/transformers.rs** ## Motivation and Context This PR was raised so that it Fixes #2322 ! ## How did you test it? - **I ran the following command, and al </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): [Airwallex] Use connector_response_reference_id as reference to merchant (#2747) Co Files to modify: **crates/router/src/connector/airwallex/transformers.rs** Modify existing code
{"issue_number": 2322, "pr_number": 2747, "commits_count": 1, "files_changed": 1, "response_length": 1022, "file_count": 4, "needs_breakdown": false}
[REFACTOR] : [Paypal] Error Message For Connector Implementation ### :memo: Feature Description - In terms of errors, we are currently throwing a 'not supported' message, which shouldn't be the case as we are yet to decide on the implementation. ### :hammer: Possible Implementation - In order to manage payment methods that are not implemented by Hyperswitch or yet to be implemented, the connector transformers file should make use of the NotImplemented ConnectorError enum variant. - By doing so, we will throw same error message for all the Connector Implementation - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/2831 :bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: refactor(connector): [Paypal] Change error message from NotSupported to NotImplemented - Merged: 2024-01-31T14:47:46Z - Files changed: 1 files - Commits: 11 commits Implementation approach: ## Description Refactored `NotSupported` Error calls to `NotImplemented` in the Paypal transformer. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provid </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(connector): [Paypal] Change error message from NotSupported to NotImplemented (#2877) Co-au Files to modify: **crates/router/src/connector/paypal/transformers.rs** Modify existing code
{"issue_number": 2858, "pr_number": 2877, "commits_count": 1, "files_changed": 1, "response_length": 1017, "file_count": 3, "needs_breakdown": false}
[BUG] Internal Server Error when trying to retrieve a payment in Multisafepay ### Bug Description It bugs out when you try to retrieve a payment (psync call) in multisafepay. `force_sync` is `true` FYI. ### Expected Behavior It should not throw a 500 ### Actual Behavior Throws a 500 as it fails to parse the struct ### Steps To Reproduce 1. Retrieve a payment after creating a payment without payment method data (PMD) and passing PMD in confirm call. 2. Retrieve a payment after creating a 3DS payment 3. Retrieve a payment after creating a recurring payment in greater amount to capture ### Context For The Bug <img width="1138" alt="image" src="https://github.com/juspay/hyperswitch/assets/69745008/71d6f8ca-8a04-4dab-84d5-52d8aa61897e"> ### Environment Are you using hyperswitch hosted version? Yes, Sandbox x-request-id: `25eb7fb9-d346-489c-a26a-5dfc1ba0c7e1` x-request-id: `27fd61bb-1a86-476b-abfb-54d04bd0a271` ### Have you spent some time to check if this bug has been raised before? - [X] I checked and didn't find similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? No, I don't have time to work on this right now
<think> PR Context: - Title: ci(postman): Add postman collection Forte, Multisafepay, Paypal, Powertranz, Rapyd, PayMe - Merged: 2023-08-10T13:33:23Z - Files changed: 8 files - Commits: 9 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Add even more collections: - Forte [Thanks to @likhinbopanna for their contribution] - Multisafepay [#1889] [[Thanks to @AkshayaFoiger for their contribution]] - Paypal [Thanks to @prasunna09 for their contribution] - Powertranz [Thanks to @Gnanasundari24 for their contribution] - Rapyd [Thanks to @hrithikesh026 for their contributio </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 1889, "pr_number": 1885, "commits_count": 0, "files_changed": 8, "response_length": 819, "file_count": 0, "needs_breakdown": false}
Support Wechatpay Scan and Pay
<think> PR Context: - Title: feat(Connector): [Stripe] Implement Wechatpay Digital Wallet - Merged: 2023-05-09T20:12:23Z - Files changed: 1 files - Commits: 13 commits Implementation approach: ## Description Implemented Wechatpay digital wallet, payment method for Stripe. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables ## Motivation and Context I </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(Connector): [Stripe] Implement Wechatpay Digital Wallet (#1049) Co-authored-by: Arjun Karthik < Files to modify: **crates/router/src/connector/stripe/transformers.rs** Add: - struct: pub::WechatpayPayment - struct: pub::StripeRedirectToQr - enum: pub::WechatClient
{"issue_number": 242, "pr_number": 1049, "commits_count": 1, "files_changed": 1, "response_length": 1079, "file_count": 3, "needs_breakdown": false}
refactor(api_keys): use a KMS encrypted API key hashing key and remove key ID prefix from plaintext API keys ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates ## Description <!-- Describe your changes in detail --> This PR modifies the API keys code to use a KMS encrypted API key hashing key instead of using a plaintext hashing key stored in the database. This includes the following changes: 1. Extracts the KMS code to a separate sub-module within the `services` module. 2. Adds new application configuration for API keys. 3. Modifies API key hashing code to use a KMS encrypted API key hashing key. ### Additional Changes - [x] This PR modifies the database schema - [x] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 5. `crates/router/src/configs` 6. `loadtest/config` --> The migrations can be found at: [`up.sql`](https://github.com/juspay/hyperswitch/blob/4f22018df818e23c6fd6664d6605697bf64e7afa/migrations/2023-02-21-094019_api_keys_remove_hash_key/up.sql) and [`down.sql`](https://github.com/juspay/hyperswitch/blob/4f22018df818e23c6fd6664d6605697bf64e7afa/migrations/2023-02-21-094019_api_keys_remove_hash_key/down.sql). I'm also clearing API keys from the table since we can't use the old API keys once we add/remove the `hash_key` column to/from the `api_keys` table. Moreover, since the API key endpoints are not being actively used on sandbox, I don't expect this to be too much of a problem. As for the application configuration: 1. If you're not using KMS (the `kms` feature is disabled), use the value generated by the following command for the `api_keys.hash_key` application configuration variable (we generate a 32 byte long random key and hex encode it): ```shell $ openssl rand -hex 32 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef ``` 2. If you're using KMS: 1. Set the `api_keys.aws_key_id` and `api_keys.aws_region` application configuration variables to the AWS key ID and region for the KMS key being used. 2. Generate a 32 byte long random key, hex encode it, then base64 encode it using the command: ```shell $ openssl rand -hex 32 | tr -d \\n | base64 MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWYwMTIzNDU2Nzg5YWJjZGVmMDEyMzQ1Njc4OWFiY2RlZg== ``` 3. Use the AWS KMS key to KMS encrypt the API key hashing key, and use the output ciphertext generated by the following command as the value for the `api_keys.kms_encrypted_hash_key` application configuration variable. ```shell aws kms encrypt --output json --key-id my-aws-key-id --plaintext MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWYwMTIzNDU2Nzg5YWJjZGVmMDEyMzQ1Njc4OWFiY2RlZg== ``` ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> Using a KMS encrypted hashing key should slightly increase the security, even if the database containing the API keys is breached. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Manual. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: refactor(api_keys): remove key ID prefix from plaintext API keys - Merged: 2023-03-05T13:24:24Z - Files changed: 2 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR removes the key ID prefix included in the plaintext API keys returned on creating a new API key. The key ID no longer needs to be sent by the user now that #639 makes it easier to identify the API key record in the database table. ## Motivation and Context <!-- Wh </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 639, "pr_number": 705, "commits_count": 0, "files_changed": 2, "response_length": 794, "file_count": 0, "needs_breakdown": false}
[BUG] Outgoing webhook retry scheduler tasks remain in pending state if merchant webhook URL is not configured ### Bug Description In the outgoing webhook retry process tracker (scheduler) workflow introduced in #3842, the process tracker entries added before the webhook is attempted to be delivered remain in the `process_started` status and `Pending` business status, if either: 1. The `webhook_details` field is not provided in the business profile (or merchant account with default profile). 2. The `webhook_details` is provided but the `webhook_url` within the `webhook_details` object is not provided. 3. The business profile initially had a webhoook URL configured but the profile was updated later to remove the webhook URL (or webhook details). Since in any of the above cases the URL to deliver the webhook to the merchant is unavailable, the task can be aborted. Another optimization is to not create the outgoing webhook event (in the `events` database table) at all, if the merchant webhook URL is not available. ### Expected Behavior - The event (and corresponding process tracker task) should not be created in the `events` table if the merchant webhook URL has not been configured. - In case the business profile initially had a webhook URL configured and was later removed from the business profile, the retry tasks for previously failed webhooks should be aborted. ### Actual Behavior The process tracker task remains in the `process_started` status and `Pending` business status. ### Steps To Reproduce 1. Create a merchant account without the `webhook_details` object or without the `webhook_url` field, using the API. 2. Create an API key, and create a merchant connector account. 3. Make a successful payment. 4. Query the `process_tracker` table in the database to search for workflows with the runner `OUTGOING_WEBHOOK_RETRY_WORKFLOW` and having the payment ID in the name: ```sql SELECT * FROM process_tracker WHERE runner = 'OUTGOING_WEBHOOK_RETRY_WORKFLOW' AND id LIKE '%pay_1234%'; ``` The `status` is `process_started` and the `business_status` of the task is `Pending`.
<think> PR Context: - Title: fix(webhooks): abort outgoing webhook retry task if webhook URL is not available in business profile - Merged: 2024-03-07T13:23:29Z - Files changed: 2 files - Commits: 5 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR fixes a bug in the outgoing webhook retry workflow where process tracker tasks remained in pending state if merchant webhook URL was not configured in the business profile. For more information, see: #3995. In addition, this PR incl </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(webhooks): abort outgoing webhook retry task if webhook URL is not available in business profile Files to modify: **crates/router/src/core/errors.rs** Add: - function: pub::is_webhook_delivery_retryable_error - impl: impl WebhooksFlowError **crates/router/src/core/webhooks.rs** Add: - function: private::get_webhook_url_from_business_profile
{"issue_number": 3995, "pr_number": 3997, "commits_count": 1, "files_changed": 2, "response_length": 1198, "file_count": 4, "needs_breakdown": false}
refactor(redis_interface): remove the `Drop` implementation on `RedisConnectionPool` ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR drops the `Drop` implementation (pun intended) on `RedisConnectionPool`. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> Fixes #1782. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Locally, with both a standalone Redis instance and a Redis cluster setup with Docker Compose. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: fix(redis_interface): add back Redis pool connect step - Merged: 2023-07-25T14:42:14Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR fixes a bug introduced in #1786 with Redis connection pool connections never being set up on startup. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(redis_interface): add back Redis pool connect step (#1789) Files to modify: **crates/redis_interface/src/lib.rs** Modify existing code
{"issue_number": 1786, "pr_number": 1789, "commits_count": 1, "files_changed": 1, "response_length": 929, "file_count": 3, "needs_breakdown": false}
[REFACTOR] : [Shift4] Error Message For Connector Implementation ### :memo: Feature Description - In terms of errors, we are currently throwing a 'not supported' message, which shouldn't be the case as we are yet to decide on the implementation. ### :hammer: Possible Implementation - In order to manage payment methods that are not implemented by Hyperswitch or yet to be implemented, the connector transformers file should make use of the NotImplemented ConnectorError enum variant. - By doing so, we will throw same error message for all the Connector Implementation - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/2831 :bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: refactor(connector): [Shift4] change error message from NotSupported to NotImplemented - Merged: 2023-11-30T19:06:32Z - Files changed: 1 files - Commits: 9 commits Implementation approach: ## Description <!-- Describe your changes in detail --> ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding ch </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(connector): [Shift4] change error message from NotSupported to NotImplemented (#2880) Files to modify: **crates/router/src/connector/shift4/transformers.rs** Modify existing code
{"issue_number": 2860, "pr_number": 2880, "commits_count": 1, "files_changed": 1, "response_length": 1010, "file_count": 3, "needs_breakdown": false}
chore: address Rust 1.83.0 clippy lints ### Description Address the clippy lints stabilized / enabled in Rust version 1.83.0. See #3391 for more information.
<think> PR Context: - Title: chore: address Rust 1.83.0 clippy lints and enable more clippy lints - Merged: 2024-12-02T14:57:14Z - Files changed: 30 files - Commits: 5 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR addresses clippy lints stabilized / enabled in Rust 1.83.0. The major warnings being thrown due to the version bump were [`empty_line_after_doc_comments`](https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** chore: address Rust 1.83.0 clippy lints and enable more clippy lints (#6705) Files to modify: **crates/api_models/src/admin.rs** Modify existing code **crates/api_models/src/analytics.rs** Modify existing code **crates/api_models/src/api_keys.rs** Remove: - impl: impl serde::de::Visitor<'de> for NeverVisitor Add: - impl: impl serde::de::Visitor<'_> for NeverVisitor **crates/api_models/src/conditional_configs.rs** Modify existing code **crates/api_models/src/enums.rs** Modify existing code **crates/api_models/src/payments.rs** Modify existing code **crates/api_models/src/pm_auth.rs** Modify existing code **crates/api_models/src/routing.rs** Modify existing code **crates/api_models/src/user/sample_data.rs** Modify existing code **crates/cards/src/validate.rs** Modify existing code **crates/common_enums/src/transformers.rs** Modify existing code **crates/common_utils/src/crypto.rs** Modify existing code **crates/common_utils/src/custom_serde.rs** Modify existing code **crates/common_utils/src/errors.rs** Modify existing code **crates/common_utils/src/ext_traits.rs** Modify existing code **crates/common_utils/src/pii.rs** Modify existing code **crates/common_utils/src/signals.rs** Modify existing code **crates/common_utils/src/types.rs** Remove: - impl: impl Visitor<'de> for ClientSecretVisitor Add: - impl: impl Visitor<'_> for ClientSecretVisitor **crates/common_utils/src/types/keymanager.rs** Modify existing code **crates/connector_configs/src/common_config.rs** Modify existing code **crates/connector_configs/src/connector.rs** Modify existing code **crates/diesel_models/src/configs.rs** Modify existing code **crates/diesel_models/src/lib.rs** Modify existing code **crates/diesel_models/src/organization.rs** Modify existing code **crates/diesel_models/src/payment_attempt.rs** Modify existing code **crates/diesel_models/src/reverse_lookup.rs** Modify existing code **crates/diesel_models/src/services/logger.rs** Modify existing code **crates/drainer/src/services.rs** Modify existing code **crates/euclid/src/dssa/analyzer.rs** Modify existing code **crates/euclid/src/dssa/graph.rs** Modify existing code **crates/euclid/src/dssa/types.rs** Remove: - impl: impl CtxValueKind<'a> Add: - impl: impl CtxValueKind<'_> **crates/euclid/src/frontend/ast.rs** Modify existing code **crates/euclid/src/frontend/ast/lowering.rs** Modify existing code **crates/euclid/src/frontend/ast/parser.rs** Modify existing code **crates/events/src/lib.rs** Modify existing code **crates/external_services/src/file_storage.rs** Modify existing code **crates/external_services/src/file_storage/file_system.rs** Modify existing code **crates/external_services/src/hashicorp_vault/core.rs** Modify existing code **crates/external_services/src/managers/encryption_management.rs** Modify existing code **crates/external_services/src/managers/secrets_management.rs** Modify existing code **crates/external_services/src/no_encryption.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/worldpay.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Modify existing code **crates/hyperswitch_constraint_graph/src/graph.rs** Modify existing code **crates/hyperswitch_domain_models/src/merchant_account.rs** Modify existing code **crates/hyperswitch_domain_models/src/payment_method_data.rs** Modify existing code **crates/hyperswitch_interfaces/src/secrets_interface.rs** Modify existing code **crates/hyperswitch_interfaces/src/secrets_interface/secret_state.rs** Modify existing code **crates/kgraph_utils/src/types.rs** Modify existing code **crates/masking/src/abs.rs** Modify existing code **crates/masking/src/boxed.rs** Modify existing code **crates/masking/src/diesel.rs** Remove: - impl: impl AsExpression<T> for &'expr Secret<S, I> Add: - impl: impl AsExpression<T> for &Secret<S, I> **crates/masking/src/lib.rs** Modify existing code **crates/masking/src/maskable.rs** Modify existing code **crates/masking/src/secret.rs** Modify existing code **crates/masking/src/serde.rs** Modify existing code **crates/masking/src/string.rs** Modify existing code **crates/masking/src/strong_secret.rs** Modify existing code **crates/masking/src/vec.rs** Modify existing code **crates/openapi/src/routes/payments.rs** Modify existing code **crates/openapi/src/routes/routing.rs** Modify existing code **crates/pm_auth/src/connector/plaid/transformers.rs** Modify existing code **crates/redis_interface/src/commands.rs** Modify existing code **crates/redis_interface/src/errors.rs** Modify existing code **crates/redis_interface/src/types.rs** Modify existing code **crates/router/src/connector/adyen/transformers.rs** Remove: - impl: impl TryFrom<(&domain::BankDebitData, &types::PaymentsAuthorizeRouterData)> for AdyenPaymentMethod<'a> - impl: impl TryFrom<(&domain::VoucherData, &types::PaymentsAuthorizeRouterData)> for AdyenPaymentMethod<'a> - impl: impl TryFrom<(&domain::WalletData, &types::PaymentsAuthorizeRouterData)> for AdyenPaymentMethod<'a> Add: - impl: impl TryFrom<(&domain::BankDebitData, &types::PaymentsAuthorizeRouterData)> for AdyenPaymentMethod<'_> - impl: impl TryFrom<(&domain::VoucherData, &types::PaymentsAuthorizeRouterData)> for AdyenPaymentMethod<'_> **crates/router/src/connector/braintree/transformers.rs** Modify existing code **crates/router/src/connector/datatrans.rs** Modify existing code **crates/router/src/connector/globalpay/requests.rs** Modify existing code **crates/router/src/connector/paypal/transformers.rs** Modify existing code **crates/router/src/connector/riskified/transformers/api.rs** Modify existing code **crates/router/src/connector/signifyd/transformers/api.rs** Modify existing code **crates/router/src/connector/utils.rs** Modify existing code **crates/router/src/connector/wellsfargopayout.rs** Modify existing code **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/core/payment_methods/cards.rs** Modify existing code **crates/router/src/core/payment_methods/utils.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/pm_auth/transformers.rs** Modify existing code **crates/router/src/core/refunds.rs** Modify existing code **crates/router/src/core/routing/helpers.rs** Remove: - impl: impl RoutingAlgorithmHelpers<'h> Add: - impl: impl RoutingAlgorithmHelpers<'_> **crates/router/src/core/user.rs** Modify existing code **crates/router/src/core/user_role/role.rs** Modify existing code **crates/router/src/db/user_authentication_method.rs** Modify existing code **crates/router/src/routes/payment_link.rs** Modify existing code **crates/router/src/routes/payments.rs** Modify existing code **crates/router/src/services/api/client.rs** Modify existing code **crates/router/src/services/authentication/decision.rs** Modify existing code **crates/router/src/services/kafka.rs** Modify existing code **crates/router/src/services/kafka/authentication.rs** Remove: - impl: impl super::KafkaMessage for KafkaAuthentication<'a> Add: - impl: impl super::KafkaMessage for KafkaAuthentication<'_> **crates/router/src/services/kafka/authentication_event.rs** Remove: - impl: impl super::KafkaMessage for KafkaAuthenticationEvent<'a> Add: - impl: impl super::KafkaMessage for KafkaAuthenticationEvent<'_> **crates/router/src/services/kafka/dispute.rs** Remove: - impl: impl super::KafkaMessage for KafkaDispute<'a> Add: - impl: impl super::KafkaMessage for KafkaDispute<'_> **crates/router/src/services/kafka/dispute_event.rs** Remove: - impl: impl super::KafkaMessage for KafkaDisputeEvent<'a> Add: - impl: impl super::KafkaMessage for KafkaDisputeEvent<'_> **crates/router/src/services/kafka/fraud_check.rs** Remove: - impl: impl super::KafkaMessage for KafkaFraudCheck<'a> Add: - impl: impl super::KafkaMessage for KafkaFraudCheck<'_> **crates/router/src/services/kafka/fraud_check_event.rs** Remove: - impl: impl super::KafkaMessage for KafkaFraudCheckEvent<'a> Add: - impl: impl super::KafkaMessage for KafkaFraudCheckEvent<'_> **crates/router/src/services/kafka/payment_attempt.rs** Remove: - impl: impl super::KafkaMessage for KafkaPaymentAttempt<'a> Add: - impl: impl super::KafkaMessage for KafkaPaymentAttempt<'_> **crates/router/src/services/kafka/payment_attempt_event.rs** Remove: - impl: impl super::KafkaMessage for KafkaPaymentAttemptEvent<'a> Add: - impl: impl super::KafkaMessage for KafkaPaymentAttemptEvent<'_> **crates/router/src/services/kafka/payment_intent.rs** Remove: - impl: impl super::KafkaMessage for KafkaPaymentIntent<'a> Add: - impl: impl super::KafkaMessage for KafkaPaymentIntent<'_> **crates/router/src/services/kafka/payment_intent_event.rs** Remove: - impl: impl super::KafkaMessage for KafkaPaymentIntentEvent<'a> Add: - impl: impl super::KafkaMessage for KafkaPaymentIntentEvent<'_> **crates/router/src/services/kafka/payout.rs** Remove: - impl: impl super::KafkaMessage for KafkaPayout<'a> Add: - impl: impl super::KafkaMessage for KafkaPayout<'_> **crates/router/src/services/kafka/refund.rs** Remove: - impl: impl super::KafkaMessage for KafkaRefund<'a> Add: - impl: impl super::KafkaMessage for KafkaRefund<'_> **crates/router/src/services/kafka/refund_event.rs** Remove: - impl: impl super::KafkaMessage for KafkaRefundEvent<'a> Add: - impl: impl super::KafkaMessage for KafkaRefundEvent<'_> **crates/router/src/services/logger.rs** Modify existing code **crates/router/src/types/storage/payment_link.rs** Modify existing code **crates/router/src/types/transformers.rs** Modify existing code **crates/router/src/utils/user_role.rs** Modify existing code **crates/router/src/workflows/payment_sync.rs** Modify existing code **crates/router/tests/connectors/aci.rs** Modify existing code **crates/router_derive/src/lib.rs** Modify existing code **crates/router_derive/src/macros/operation.rs** Modify existing code **crates/router_env/src/lib.rs** Modify existing code **crates/router_env/src/logger/config.rs** Modify existing code **crates/router_env/src/logger/formatter.rs** Modify existing code **crates/router_env/src/logger/setup.rs** Modify existing code **crates/router_env/src/logger/storage.rs** Modify existing code **crates/router_env/src/logger/types.rs** Modify existing code **crates/router_env/tests/logger.rs** Modify existing code **crates/router_env/tests/test_module/mod.rs** Remove: - mod: pub::some_module **crates/storage_impl/src/mock_db.rs** Modify existing code **crates/storage_impl/src/redis/cache.rs** Remove: - impl: impl TryFrom<RedisValue> for CacheRedact<'a> Add: - impl: impl TryFrom<RedisValue> for CacheRedact<'_> **crates/storage_impl/src/redis/kv_store.rs** Modify existing code
{"issue_number": 6704, "pr_number": 6705, "commits_count": 1, "files_changed": 30, "response_length": 12574, "file_count": 129, "needs_breakdown": true}
[REFACTOR]: [Nuvei] Remove Default Case Handling ### :memo: Feature Description - We utilize match statements to make pivotal decisions, such as generating requests based on the payment method type and managing responses received from the connector. - These conditions generally go hand in hand with enum variants. - Default case is used because a match statement needs to be exhaustive i.e. every variant needs to be covered. - So, if all the explicit cases are handled then default is used to handle the rest. - Each connector have these match statements but many of them don’t provide reference to each variant in their default case, rather a `_` is put to handle all the other cases. - This approach carries a risk because developers may inadvertently overlook the need for explicit handling of the new cases. ### :hammer: Possible Implementation - Instead of relying on a default match case `_`, developers should handle each and every variant explicitly. - By doing so, if there are any changes in the future, they can readily assess the impact of their modifications simply by compiling the code. - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/1955 :bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: refactor(connector): [Nuvei] remove default case handling - Merged: 2023-10-16T19:28:26Z - Files changed: 1 files - Commits: 6 commits Implementation approach: ## Description <!-- Describe your changes in detail --> - Fix issue #2278 - Changes to be made : Remove default case handling - Added all the ```Banknames``` (which are not ```NuveiBIC``` ) against the default case - File changed: **```transformers.rs```** (crates/router/src/connector/nuvei/tra </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(connector): [Nuvei] remove default case handling (#2584) Co-authored-by: Prasunna Soppa <70 Files to modify: **crates/router/src/connector/nuvei/transformers.rs** Modify existing code
{"issue_number": 2278, "pr_number": 2584, "commits_count": 1, "files_changed": 1, "response_length": 986, "file_count": 4, "needs_breakdown": false}
[FIX] Re-revert changes done in `pr#7866` by `pr#7882` ### Context [PR#7882](https://github.com/juspay/hyperswitch/pull/7882) accidentally reverted changes made in [PR#7882](https://github.com/juspay/hyperswitch/pull/7866), which was a merchant critical PR. ### Proposed Fix Re revert the changes.
<think> PR Context: - Title: fix(payment_methods): Re-revert changes done in `pr#7866` by `pr#7882` - Merged: 2025-05-05T12:58:42Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Context https://github.com/juspay/hyperswitch/pull/7882 accidentally reverted changes made in https://github.com/juspay/hyperswitch/pull/7866, which was a merchant critical PR. Reason: - This might have occured due to incorrect resolution </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(payment_methods): Re-revert changes done in `pr#7866` by `pr#7882` (#7954) Files to modify: **crates/router/src/core/payment_methods/cards.rs** Modify existing code
{"issue_number": 7952, "pr_number": 7954, "commits_count": 1, "files_changed": 1, "response_length": 975, "file_count": 3, "needs_breakdown": false}
add filters for amount and label in payments list Add new filters to filters payments list by: - **amount**: filter payments on the basis of amount equal to , less than, greater than and range - **merchant connector id**: filter payments list on the basis of merchant_connector id, which will be unique for every connector label
<think> PR Context: - Title: feat(payments): add amount and connector id filter in list - Merged: 2024-04-18T13:58:33Z - Files changed: 11 files - Commits: 9 commits Implementation approach: ## Description This PR add support to filter payments list by amount and merchant connector id. ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide li </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(payments): add amount and connector id filter in list (#4354) Co-authored-by: hyperswitch-bot[b Files to modify: **crates/api_models/src/payments.rs** Add: - struct: pub::AmountFilter **crates/common_utils/src/consts.rs** Modify existing code **crates/data_models/src/payments/payment_attempt.rs** Modify existing code **crates/data_models/src/payments/payment_intent.rs** Modify existing code **crates/diesel_models/src/query/payment_attempt.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/db/kafka_store.rs** Modify existing code **crates/router/src/routes/payments.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_attempt.rs** Modify existing code **crates/storage_impl/src/payments/payment_attempt.rs** Modify existing code **crates/storage_impl/src/payments/payment_intent.rs** Modify existing code
{"issue_number": 4352, "pr_number": 4354, "commits_count": 1, "files_changed": 11, "response_length": 1715, "file_count": 13, "needs_breakdown": false}
fix(trustpay): [Trustpay] Add error code mapping '800.100.100' ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Error mapping done to code `800.100.100` ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> No testing can be done since it matches error code in production which cant be replicated ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: fix(trustpay): [Trustpay] Add error code mapping '800.100.100' - Merged: 2024-03-27T10:09:44Z - Files changed: 1 files - Commits: 2 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Error mapping done to code `800.100.100` OSS Main PR - #4224 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment va </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(trustpay): [Trustpay] Add error code mapping '800.100.100' (#4226) Co-authored-by: Gnanasundari Files to modify: **crates/router/src/connector/trustpay/transformers.rs** Modify existing code
{"issue_number": 4224, "pr_number": 4226, "commits_count": 1, "files_changed": 1, "response_length": 995, "file_count": 3, "needs_breakdown": false}
fix: add time_range constraint to retrieve payment attempt list Currently, to retrieve the total count for payments, we use a query that gets the total count of attempts based on the last active attempt ID. To enhance performance, we need to add a time_range to the query. This will ensure that the query is executed only for the given time constraint, improving efficiency by narrowing the search to a specific time period.
<think> PR Context: - Title: fix(payments): add time range in list payment attempts query - Merged: 2024-09-19T18:20:57Z - Files changed: 30 files - Commits: 9 commits Implementation approach: ## Description - Add time range to filter total count for payment attempt list. - Move `TimeRange` type to common utils so that it can be used in diesel models and across all the other api models ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the datab </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(payments): add time range in list payment attempts query (#5959) Co-authored-by: hyperswitch-bot Files to modify: **crates/analytics/src/disputes/metrics.rs** Modify existing code **crates/analytics/src/opensearch.rs** Modify existing code **crates/api_models/src/analytics.rs** Modify existing code **crates/api_models/src/analytics/search.rs** Modify existing code **crates/api_models/src/events.rs** Remove: - impl: impl ApiEventMetric for TimeRange **crates/api_models/src/payments.rs** Remove: - struct: pub::TimeRange **crates/api_models/src/payouts.rs** Modify existing code **crates/api_models/src/refunds.rs** Modify existing code **crates/common_utils/src/events.rs** Add: - impl: impl ApiEventMetric for TimeRange **crates/common_utils/src/types.rs** Add: - struct: pub::TimeRange **crates/diesel_models/src/query/payment_attempt.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_intent.rs** Modify existing code **crates/hyperswitch_domain_models/src/payouts.rs** Modify existing code **crates/hyperswitch_domain_models/src/payouts/payouts.rs** Modify existing code **crates/hyperswitch_domain_models/src/refunds.rs** Modify existing code **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/router/src/core/disputes.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payouts.rs** Modify existing code **crates/router/src/core/refunds.rs** Modify existing code **crates/router/src/db/dispute.rs** Modify existing code **crates/router/src/db/kafka_store.rs** Modify existing code **crates/router/src/db/refund.rs** Modify existing code **crates/router/src/routes/disputes.rs** Modify existing code **crates/router/src/routes/payments.rs** Modify existing code **crates/router/src/routes/payouts.rs** Modify existing code **crates/router/src/routes/refunds.rs** Modify existing code **crates/router/src/types/api/payments.rs** Modify existing code **crates/router/src/types/storage/dispute.rs** Modify existing code **crates/router/src/types/storage/refund.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_attempt.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_intent.rs** Modify existing code **crates/storage_impl/src/mock_db/payouts.rs** Modify existing code **crates/storage_impl/src/payments/payment_attempt.rs** Modify existing code **crates/storage_impl/src/payments/payment_intent.rs** Modify existing code **crates/storage_impl/src/payouts/payouts.rs** Modify existing code
{"issue_number": 5958, "pr_number": 5959, "commits_count": 1, "files_changed": 30, "response_length": 3612, "file_count": 40, "needs_breakdown": true}
[FIX] Remove ToSchema from RefundAggregateResponse and exclude it from OpenAPI documentation ### Feature Description The RefundAggregateResponse type used by the [/refunds/aggregate](https://github.com/juspay/hyperswitch/blob/37925626e6446900f1d16e0e5f184ee472d4be3e/crates/router/src/routes/app.rs#L1004) API is currently annotated with ToSchema, which generates OpenAPI schema documentation for it. However, since this API is internal and should not be exposed to external users, the schema should not be generated or included in the OpenAPI documentation. Current Behavior: - The `RefundAggregateResponse` struct is annotated with ToSchema, which automatically generates OpenAPI documentation. - This results in the exposure of internal API details that should remain hidden from external consumers. Expected Behavior: - Remove the `ToSchema` derive macro from the RefundAggregateResponse struct. - Ensure that this struct and its associated API are excluded from OpenAPI documentation generation. ### Possible Implementation The Api [refunds/aggregate](https://github.com/juspay/hyperswitch/blob/37925626e6446900f1d16e0e5f184ee472d4be3e/crates/router/src/core/refunds.rs#L1098) returns `RefundAggregateResponse` The following code should be modified to remove ToSchema and update the OpenAPI documentation accordingly: ``` #[derive(Clone, Debug, serde::Serialize, ToSchema)] pub struct RefundAggregateResponse { /// The list of refund status with their count pub status_with_count: HashMap<enums::RefundStatus, i64>, } ``` Tasks: - Remove the ToSchema derive macro from the RefundAggregateResponse struct. - Remove any references to RefundAggregateResponse from openapi.rs to ensure it is not documented. - Test to verify that this type is no longer included in the OpenAPI schema. Additional Context: Since the `/refunds/aggregate` API is for internal use only, removing the OpenAPI schema ensures that this internal API remains undocumented for merchants. ### Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### Submission Process: - Ask the maintainers for assignment of the issue, you can request for assignment by commenting on the issue itself. - Once assigned, submit a pull request (PR). - Maintainers will review and provide feedback, if any. - Maintainers can unassign issues due to inactivity, [read more here](https://github.com/juspay/hyperswitch/wiki/Hacktoberfest-Contribution-Rules). Refer [here](https://github.com/juspay/hyperswitch/blob/main/docs/TERMS_OF_CONTEST.md) for Terms and conditions for the contest.
<think> PR Context: - Title: fix(refunds): remove to schema from refund aggregate response and exclude it from open api documentation - Merged: 2024-11-05T09:26:13Z - Files changed: 5 files - Commits: 11 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Removed all the openapi references to `RefundAggregateResponse`. 1. Removed `ToSchema` trait for `RefundAggregateResponse`. 2. Removed references from `openapi` and `openapi_v2` to `RefundAggregateResponse`. 3. Generated new `openapi_spec </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(refunds): remove to schema from refund aggregate response and exclude it from open api documenta Files to modify: **crates/api_models/src/refunds.rs** Modify existing code **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code
{"issue_number": 5990, "pr_number": 6405, "commits_count": 1, "files_changed": 5, "response_length": 1136, "file_count": 5, "needs_breakdown": false}
feat(analytics): implement currency conversion to power multi-currency aggregation ## Current Behaviour The total amount calculated for all payment analytics buckets related to amounts is incorrect because currency conversion is not being applied before summing the values. As a result, amounts in different currencies are being added together, leading to an inaccurate total. ## Proposed Changes - introduce `<AMOUNT_RELATED_FIELD>_in_usd` fields to convert and store value in `USD` - introduce total_in_usd to store the total value in usd - Generally provide currency_conversion facility to metrics function for other future use cases
<think> PR Context: - Title: feat(analytics): implement currency conversion to power multi-currency aggregation - Merged: 2024-11-06T09:51:02Z - Files changed: 18 files - Commits: 12 commits Implementation approach: ## Description - implemented currency_conversion for calculating values of amount related metrics from their currency (i.e `INR`) to `USD` and store it in a separate field variant I created `<fieldname>_in_usd` - Implemented a total_amount_in_usd variant for all the total fields related to amount </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(analytics): implement currency conversion to power multi-currency aggregation (#6418) Co-author Files to modify: **crates/analytics/src/errors.rs** Modify existing code **crates/analytics/src/payment_intents/accumulator.rs** Modify existing code **crates/analytics/src/payment_intents/core.rs** Modify existing code **crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs** Modify existing code **crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs** Modify existing code **crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs** Modify existing code **crates/analytics/src/payments/accumulator.rs** Modify existing code **crates/analytics/src/payments/core.rs** Modify existing code **crates/analytics/src/payments/metrics/payment_processed_amount.rs** Modify existing code **crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs** Modify existing code **crates/api_models/src/analytics.rs** Modify existing code **crates/api_models/src/analytics/payment_intents.rs** Modify existing code **crates/api_models/src/analytics/payments.rs** Modify existing code **crates/router/src/analytics.rs** Modify existing code **crates/router/src/core/currency.rs** Add: - function: pub::get_forex_exchange_rates **crates/router/src/utils/currency.rs** Modify existing code
{"issue_number": 6416, "pr_number": 6418, "commits_count": 1, "files_changed": 18, "response_length": 2259, "file_count": 18, "needs_breakdown": true}
feat: populate payment method details in payments response ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Described in #5652 ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context Helps in identification of payment method details which were used for the payment. This is returned in payment retrieve and payment webhooks. ## How did you test it? <details> <summary>1. Complete and retrieve a gift card payment</summary> curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_JCI3dRg06RjMyOrBDO81euxfOykGXlA9zgW4Cf2iXGy2xwexsY6GOSH5sI41GugN' \ --data-raw '{ "amount": 1100, "currency": "EUR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 1100, "customer_id": "StripeCustomer", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "gift_card", "payment_method_type": "givex", "payment_method_data": { "gift_card": { "givex": { "number": "6364530000000000", "cvc": "122222" } } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' </details> <details> <summary>2. Retrieve and verify in webhooks response as well</summary> curl --location 'http://localhost:8080/payments/pay_oRcnlCyFw1WVMQkg4fZq?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_p9yMRqUZKavXldvbcW8w0GfzR1ynBE2ORUu4FPY3rU82G8OFBx2XOq6ty71UrBIN' Response { "payment_id": "pay_oRcnlCyFw1WVMQkg4fZq", "merchant_id": "postman_merchant_GHAction_011d2d37-e13d-4b83-a896-816c4d097d18", "status": "succeeded", "amount": 1100, "net_amount": 1100, "amount_capturable": 0, "amount_received": 1100, "connector": "adyen", "client_secret": "pay_oRcnlCyFw1WVMQkg4fZq_secret_NEFqOOcfDZyWNd5BXExn", "created": "2024-08-26T06:08:24.376Z", "currency": "EUR", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "gift_card", "payment_method_data": { "gift_card": { "givex": { "last4": "0000" } }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "PiX", "last_name": null }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "PiX", "last_name": null }, "phone": null, "email": null }, "order_details": null, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "givex", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "F7S9XBDCFJK94875", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_oRcnlCyFw1WVMQkg4fZq_1", "payment_link": null, "profile_id": "pro_gsiLSYq37GwBEhz0ev26", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_xR9f8EBOdN45KgAkTCLx", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-08-26T06:23:24.376Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-08-26T06:08:25.813Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null } ![image](https://github.com/user-attachments/assets/7bdce0da-daa8-44ba-86c4-2d81cda2b691) ![image](https://github.com/user-attachments/assets/968d31bd-133e-42cb-9a57-13a94006672a) </details> <details> <summary>3. Bank Debit - ACH</summary> curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_JCI3dRg06RjMyOrBDO81euxfOykGXlA9zgW4Cf2iXGy2xwexsY6GOSH5sI41GugN' \ --data-raw '{ "amount": 10000, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "StripeCustomer", "email": "abcdef123@gmail.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://duck.com", "setup_future_usage": "on_session", "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "127.0.0.1", "user_agent": "amet irure esse" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "127.0.0.1" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "payment_method": "bank_debit", "payment_method_type": "ach", "payment_method_data": { "bank_debit": { "ach_bank_debit": { "account_number": "40308669", "routing_number": "121000358", "sort_code": "560036", "shopper_email": "example@gmail.com", "card_holder_name": "joseph Doe", "bank_account_holder_name": "David Archer", "billing_details": { "houseNumberOrName": "50", "street": "Test Street", "city": "Amsterdam", "stateOrProvince": "NY", "postalCode": "12010", "country": "US", "name": "A. Klaassen", "email": "example@gmail.com" }, "reference": "daslvcgbaieh" } } } }' </details> <details> <summary>4. Retrieve txn details</summary> curl --location 'http://localhost:8080/payments/pay_yyhXMuPPvXTjFYbFM4sS?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_p9yMRqUZKavXldvbcW8w0GfzR1ynBE2ORUu4FPY3rU82G8OFBx2XOq6ty71UrBIN' Response { "payment_id": "pay_yyhXMuPPvXTjFYbFM4sS", "merchant_id": "postman_merchant_GHAction_011d2d37-e13d-4b83-a896-816c4d097d18", "status": "succeeded", "amount": 10000, "net_amount": 10000, "amount_capturable": 0, "amount_received": 10000, "connector": "adyen", "client_secret": "pay_yyhXMuPPvXTjFYbFM4sS_secret_8dripBlpBRYSlLwBD3qi", "created": "2024-08-26T06:10:37.599Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "abcdef123@gmail.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "bank_debit", "payment_method_data": { "bank_debit": { "ach": { "account_number": "****8669", "routing_number": "121***358", "bank_account_holder_name": null, "bank_name": null, "bank_type": null, "bank_holder_type": null } }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": null, "last_name": null }, "phone": null, "email": null }, "order_details": null, "email": "abcdef123@gmail.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "ach", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "L53M262VC5XBZX65", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_yyhXMuPPvXTjFYbFM4sS_1", "payment_link": null, "profile_id": "pro_gsiLSYq37GwBEhz0ev26", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_xR9f8EBOdN45KgAkTCLx", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-08-26T06:25:37.599Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": "pm_iBk2oopRt92TdFdZdLCH", "payment_method_status": "active", "updated": "2024-08-26T06:10:40.328Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null } ![image](https://github.com/user-attachments/assets/6c39bc2b-8a0b-4546-8676-c50bd2a3a768) ![image](https://github.com/user-attachments/assets/28a43963-91e3-485b-8b09-71e54a3f83d0) </details> <details> <summary>5. Bank Debit - Bacs</summary> curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_JCI3dRg06RjMyOrBDO81euxfOykGXlA9zgW4Cf2iXGy2xwexsY6GOSH5sI41GugN' \ --data-raw '{ "amount": 10000, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "StripeCustomer", "email": "abcdef123@gmail.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://duck.com", "setup_future_usage": "on_session", "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "127.0.0.1", "user_agent": "amet irure esse" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "127.0.0.1" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "payment_method": "bank_debit", "payment_method_type": "ach", "payment_method_data": { "bank_debit": { "ach_bank_debit": { "account_number": "40308669", "routing_number": "121000358", "sort_code": "560036", "shopper_email": "example@gmail.com", "card_holder_name": "joseph Doe", "bank_account_holder_name": "David Archer", "billing_details": { "houseNumberOrName": "50", "street": "Test Street", "city": "Amsterdam", "stateOrProvince": "NY", "postalCode": "12010", "country": "US", "name": "A. Klaassen", "email": "example@gmail.com" }, "reference": "daslvcgbaieh" } } } }' </details> <details> <summary>6. Retrieve txn details</summary> curl --location 'http://localhost:8080/payments/pay_alnXBCvp6f9jl6ZqWo1e?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_p9yMRqUZKavXldvbcW8w0GfzR1ynBE2ORUu4FPY3rU82G8OFBx2XOq6ty71UrBIN' Response { "payment_id": "pay_alnXBCvp6f9jl6ZqWo1e", "merchant_id": "postman_merchant_GHAction_011d2d37-e13d-4b83-a896-816c4d097d18", "status": "processing", "amount": 100, "net_amount": 100, "amount_capturable": 0, "amount_received": null, "connector": "adyen", "client_secret": "pay_alnXBCvp6f9jl6ZqWo1e_secret_dwQNXM4uPcs7PNeyxPnN", "created": "2024-08-26T06:11:42.510Z", "currency": "GBP", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "abcdef123@gmail.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "bank_debit", "payment_method_data": { "bank_debit": { "bacs": { "account_number": "****8669", "sort_code": "56**36", "bank_account_holder_name": null } }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "GB", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": null, "last_name": null }, "phone": null, "email": null }, "order_details": null, "email": "abcdef123@gmail.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "bacs", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "FWJ6KDDCFJK94875", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_alnXBCvp6f9jl6ZqWo1e_1", "payment_link": null, "profile_id": "pro_gsiLSYq37GwBEhz0ev26", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_xR9f8EBOdN45KgAkTCLx", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-08-26T06:26:42.510Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": "pm_FWrcMK5kATtjyw9i0hqP", "payment_method_status": "inactive", "updated": "2024-08-26T06:11:48.748Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null } ![image](https://github.com/user-attachments/assets/6e87ee04-f172-4ab0-89d4-c2f52c1b9259) </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
<think> PR Context: - Title: feat: populate payment method details in payments response - Merged: 2024-09-04T07:53:12Z - Files changed: 10 files - Commits: 1 commits Implementation approach: Reverts juspay/hyperswitch#5661 </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(revert): populate payment method details in payments response (#5785) Files to modify: **crates/api_models/src/payments.rs** Remove: - mod: pub::additional_info **crates/api_models/src/payments/additional_info.rs** Remove: - struct: pub::AchBankDebitAdditionalData - struct: pub::BacsBankDebitAdditionalData - struct: pub::BecsBankDebitAdditionalData - struct: pub::SepaBankDebitAdditionalData - struct: pub::BankRedirectAdditionalData - struct: pub::BancontactBankRedirectAdditionalData - struct: pub::BlikBankRedirectAdditionalData - struct: pub::GiropayBankRedirectAdditionalData - struct: pub::PixBankTransferAdditionalData - struct: pub::LocalBankTransferAdditionalData - struct: pub::GivexGiftCardAdditionalData - struct: pub::CardTokenAdditionalData - struct: pub::UpiCollectAdditionalData - enum: pub::BankDebitAdditionalData - enum: pub::BankRedirectDetails - enum: pub::BankTransferAdditionalData - enum: pub::GiftCardAdditionalData - enum: pub::UpiAdditionalData **crates/hyperswitch_domain_models/src/payment_method_data.rs** Remove: - function: private::from - function: private::from - function: private::from - function: private::from - function: private::from - function: private::from - function: private::from - function: private::from - function: private::from - function: private::from - function: private::from - function: private::from - function: private::from - function: private::from - impl: impl From<CardRedirectData> for api_models::payments::CardRedirectData - impl: impl From<CryptoData> for api_models::payments::CryptoData - impl: impl From<UpiData> for api_models::payments::additional_info::UpiAdditionalData - impl: impl From<Box<BoletoVoucherData>> for Box<api_models::payments::BoletoVoucherData> - impl: impl From<Box<AlfamartVoucherData>> for Box<api_models::payments::AlfamartVoucherData> - impl: impl From<Box<IndomaretVoucherData>> for Box<api_models::payments::IndomaretVoucherData> - impl: impl From<Box<JCSVoucherData>> for Box<api_models::payments::JCSVoucherData> - impl: impl From<VoucherData> for api_models::payments::VoucherData - impl: impl From<GiftCardData> for payment_additional_types::GiftCardAdditionalData - impl: impl From<CardToken> for payment_additional_types::CardTokenAdditionalData - impl: impl From<BankDebitData> for api_models::payments::additional_info::BankDebitAdditionalData - impl: impl From<BankTransferData> for api_models::payments::additional_info::BankTransferAdditionalData - impl: impl From<RealTimePaymentData> for api_models::payments::RealTimePaymentData - impl: impl From<OpenBankingData> for api_models::payments::OpenBankingData **crates/masking/src/lib.rs** Remove: - mod: pub::masked_string **crates/masking/src/masked_string.rs** Remove: - function: private::apply_mask - function: private::from - function: private::from - function: private::from - function: private::from - struct: pub::MaskedSortCode - struct: pub::MaskedRoutingNumber - struct: pub::MaskedBankAccount - struct: pub::MaskedIban - impl: impl SerializableSecret for MaskedSortCode - impl: impl From<String> for MaskedSortCode - impl: impl SerializableSecret for MaskedRoutingNumber - impl: impl From<String> for MaskedRoutingNumber - impl: impl SerializableSecret for MaskedBankAccount - impl: impl From<String> for MaskedBankAccount - impl: impl SerializableSecret for MaskedIban - impl: impl From<String> for MaskedIban **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code
{"issue_number": 5661, "pr_number": 5785, "commits_count": 1, "files_changed": 10, "response_length": 4174, "file_count": 10, "needs_breakdown": true}
fix: fixing payment method information for refunds ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix ## Description This PR solves the following bugs 1. Refund not working for normal payments 2. Refund not working for recurring payments 3. While also maintaining support for `authorizedotnet` refunds <!-- Describe your changes in detail --> ### Additional Changes - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 5. `crates/router/src/configs` 6. `loadtest/config` --> ## Motivation and Context N/A <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <img width="688" alt="Screenshot 2023-01-06 at 5 25 32 PM" src="https://user-images.githubusercontent.com/51093026/211007775-4a04ad9a-2dd0-4866-8af1-f6c8c5ed1e5a.png"> <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code
<think> PR Context: - Title: fix: add validation for specific payment methods in refunds - Merged: 2023-01-10T12:25:19Z - Files changed: 4 files - Commits: 4 commits Implementation approach: ## Description Blocked on #313. Please change the target branch during merge This is a validation at notified by @bernard-eugine to avoid going through specific refund cases with error being: `Refunds not possible through hyperswitch. Please raise Refunds through {connector} dashboard` <!-- Describe your changes in detail --> ### Additional Changes - [ ] This PR modifies the database schema - </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 313, "pr_number": 314, "commits_count": 0, "files_changed": 4, "response_length": 789, "file_count": 0, "needs_breakdown": false}
[FEATURE] Use proxy exclusion instead of a separate proxied client ### Feature Description Currently we provide the option for proxying all external requests made to Connectors. We also use reqwest clients to make API calls to basilisk/locker or other utilities. Recently we started reusing the `reqwest::Client` (via once_cell) for performance reasons Our current approach involves maintaining 2 clients: - Proxied Client for any requests going outside our system - Non-Proxied client for internal services Currently we need to maintain a list of the services that should bypass proxy & choose a client accordingly. This adds a bit of a boilerplate whenever we try to make requests. ### Possible Implementation Expected behavior: Instead we want to push this behavior down to the reqwest library… we believe the [no_proxy](https://docs.rs/reqwest/latest/reqwest/struct.Proxy.html#method.no_proxy) function should help us avoid this maintenance. We would ideally accept a list of `proxy_bypass_urls` as part of our config which would then be used to create a single `reqwest::Client` which can be used for internal + external services ### Have you spent some time to check if this feature request has been raised before? - [X] I checked and didn't find similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? No, I don't have time to work on this right now
<think> PR Context: - Title: refactor(proxy): specify hosts for proxy exclusion instead of complete URLs - Merged: 2025-01-15T13:04:48Z - Files changed: 10 files - Commits: 3 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR refactors the logic for excluding specific HTTP / HTTPS traffic from being proxied via the outgoing proxy. Specifically, the changes included are: 1. We no longer need two clients (a proxied client and a non-proxied client), we ca </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(proxy): specify hosts for proxy exclusion instead of complete URLs (#6957) Files to modify: **crates/common_enums/src/enums.rs** Modify existing code **crates/router/src/bin/scheduler.rs** Modify existing code **crates/router/src/configs/defaults.rs** Modify existing code **crates/router/src/configs/settings.rs** Modify existing code **crates/router/src/lib.rs** Modify existing code **crates/router/src/services/api.rs** Modify existing code **crates/router/src/services/api/client.rs** Remove: - function: pub::proxy_bypass_urls **crates/router/src/services/openidconnect.rs** Modify existing code
{"issue_number": 1039, "pr_number": 6957, "commits_count": 1, "files_changed": 10, "response_length": 1448, "file_count": 10, "needs_breakdown": false}
feat(single_use): add extra fields in `Mandate` table and `MandateData` [Blocked on #61] ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates ## Description This PR adds single use mandate support and a 2 new fields to the mandate table (i.e. singe_use_amount, single_use_currency) <!-- Describe your changes in detail --> ### Additional Changes - [x] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> The change includes the following files. - migrations/2022-12-05-090521_single_use_mandate_fields/up.sql - migrations/2022-12-05-090521_single_use_mandate_fields/down.sql ## Motivation and Context Here, the intension is adding a new Validation feature in PaymentsCore, for that reason following are the steps that the change is broken down to. 1. Create new types for the change #45 2. Introduce the Flow and Connector Integration #47 3. Add Stripe POC #50 4. Introduce the new operation and all the related components in the payments core #53 + #61 5. Changing the `MandateData` type 6. Move the mandate related behaviour to domain <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: feat(connector): [ADYENPLATFORM] add card payouts - Merged: 2025-07-01T11:43:42Z - Files changed: 2 files - Commits: 4 commits Implementation approach: ## Description This PR enables card payouts through AdyenPlatform connector. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files wi </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): [ADYENPLATFORM] add card payouts (#8504) Co-authored-by: hyperswitch-bot[bot] <1485 Files to modify: **crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs** Add: - function: private::try_from - function: private::try_from - struct: pub::AdyenCardDetails - struct: pub::AdyenCardIdentification - struct: pub::AdyenCardTokenDetails - struct: pub::AdyenCardTokenIdentification - enum: pub::AdyenPayoutMethodDetails - impl: impl TryFrom<&hyperswitch_domain_models::address::AddressDetails> for AdyenAddress - impl: impl TryFrom<(&types::PayoutsRouterData<F>, enums::PayoutType)> for AdyenAccountHolder **crates/router/src/configs/defaults/payout_required_fields.rs** Modify existing code
{"issue_number": 66, "pr_number": 8504, "commits_count": 1, "files_changed": 2, "response_length": 1556, "file_count": 4, "needs_breakdown": false}
Consider adding `#![forbid(unsafe_code)]` [Here](https://github.com/juspay/orca/blob/main/crates/router/src/lib.rs) and in any other crate roots it's better to declare `#![forbid(unsafe_code)]` as we do in `masking` crate. This will ease a life of readers and auditors a lot, and will require quite a reasoning for those who will intend to contribute any `unsafe` code.
<think> PR Context: - Title: chore: add `#[forbid(unsafe_code)]` to all crates - Merged: 2022-12-13T11:23:20Z - Files changed: 6 files - Commits: 1 commits Implementation approach: ## Motivation and Context Closes #108 ## How did you test it? Manual, compiler-guided. ## Checklist - [x] I formatted the code `cargo +nightly fmt` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** chore: add `#[forbid(unsafe_code)] to all crates` (#131) Files to modify: **crates/api_models/src/lib.rs** Modify existing code **crates/common_utils/src/lib.rs** Modify existing code **crates/redis_interface/src/lib.rs** Modify existing code **crates/router/src/lib.rs** Modify existing code **crates/router_derive/src/lib.rs** Modify existing code **crates/router_env/src/lib.rs** Modify existing code
{"issue_number": 108, "pr_number": 131, "commits_count": 1, "files_changed": 6, "response_length": 946, "file_count": 8, "needs_breakdown": false}
[REFACTOR] : [CryptoPay] Error Message For Connector Implementation ### :memo: Feature Description - In terms of errors, we are currently throwing a 'not supported' message, which shouldn't be the case as we are yet to decide on the implementation. ### :hammer: Possible Implementation - In order to manage payment methods that are not implemented by Hyperswitch or yet to be implemented, the connector transformers file should make use of the NotImplemented ConnectorError enum variant. - By doing so, we will throw same error message for all the Connector Implementation - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/2831 :bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: refactor(connector): [Cryptopay] change error message from not supported to not implemented - Merged: 2023-12-17T17:52:16Z - Files changed: 1 files - Commits: 3 commits Implementation approach: ## Description <!-- Describe your changes in detail --> ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding ch </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(connector): [Cryptopay] change error message from not supported to not implemented (#2846) Files to modify: **crates/router/src/connector/cryptopay/transformers.rs** Modify existing code
{"issue_number": 2839, "pr_number": 2846, "commits_count": 1, "files_changed": 1, "response_length": 1023, "file_count": 3, "needs_breakdown": false}
[BUG] No provision for approving payments kept in ManualReview state for FRM flows ### Bug Description Once a fraudulent payment transaction is identified before authorization, it can be canceled or kept in manual reviewing state. If it is canceled, the payment is marked as a `failed` transaction. If the decision for the transaction is `manual_review`, it needs to be reviewed by the consumer and can be approved or rejected. If the transaction seem legit, the consumer can hit the `/approve` endpoint for approving the payments. This flow is broken. ### Expected Behavior If a txn is marked as `fraudulent`, it should still proceed for authorization, without capturing the amount. Upon approval, the amount can be captured. Upon rejection, the txn can be voided. ### Actual Behavior If a txn is marked as `fraudulent`, the flow would store the `payment_method_data` in locker, which could be later fetched if approval was given. Upon approval, it tries to fetch `payment_method_data` from locker, but fails (due to recent locker changes). Upon rejection, it marks the txn as `failed`. ### Steps To Reproduce 1. Create a merchant account 2. Create an API key 3. Add payment connector 4. Add FRM connector (enable pre flows for card, and set merchant_decision to `manual_review`) 5. Create a payment using debit / credit card w huge amounts, so it can be marked as fraudulent 6. Returned status - `requires_merchant_action` 7. Try to approve this payment 8. Returned error - payment_method_data not found ### Context For The Bug This is specifically for Pre-Transaction FRM flows, where the decision is set to `manual_review`. If a txn is stuck with state `requires_merchant_action`, those transactions can never be approved. They can only be rejected. ### Environment Are you using hyperswitch hosted version? Yes/No If yes, please provide the value of the `x-request-id` response header to help us debug your issue. If not (or if building/running locally), please provide the following details: 1. Operating System or Linux distribution: 2. Rust version (output of `rustc --version`): `rustc 1.74.1 (a28077b28 2023-12-04)` 3. App version (output of `cargo r --features vergen -- --version`): `` ### Have you spent some time checking if this bug has been raised before? - [X] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes, I am willing to submit a PR!
<think> PR Context: - Title: fix(frm): update FRM manual review flow - Merged: 2024-01-19T06:58:28Z - Files changed: 7 files - Commits: 7 commits Implementation approach: ## Description #3175 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths wh </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(frm): update FRM manual review flow (#3176) Co-authored-by: Kashif <mohammed.kashif@juspay.in> Files to modify: **crates/router/src/core/fraud_check.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/operations/payment_approve.rs** Modify existing code **crates/router/src/core/payments/operations/payment_reject.rs** Modify existing code **crates/router/src/core/payments/operations/payment_response.rs** Modify existing code **crates/router/src/core/payments/retry.rs** Modify existing code **crates/router/src/routes/payments.rs** Modify existing code
{"issue_number": 3175, "pr_number": 3176, "commits_count": 1, "files_changed": 7, "response_length": 1421, "file_count": 9, "needs_breakdown": false}
ci: run tests on PRs with `S-awaiting-merge` label ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates ## Description <!-- Describe your changes in detail --> This PR updates the CI workflow to run tests when PRs are labeled `S-awaiting-merge`. This could either be when the PR is opened, reopened, marked ready for review (from a draft PR), assigned a label, or synchronized with the base branch. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> We often have people opening WIP PRs which unnecessarily use CI resources with no fruitful results. This change is a hopeful attempt to prevent that. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Haven't tested it, "I hope it works" (TM). :crossed_fingers: ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt` - [ ] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: ci: remove label trigger for CI runs - Merged: 2023-01-10T12:52:52Z - Files changed: 1 files - Commits: 2 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR reverts the change made in #166. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 166, "pr_number": 334, "commits_count": 0, "files_changed": 1, "response_length": 766, "file_count": 0, "needs_breakdown": false}
[FEAT] Implement Refund for JPMorgan this connector lacks basic feature i.e., refunds. relevant docs: - https://developer.payments.jpmorgan.com/api/commerce/online-payments/overview - https://developer.payments.jpmorgan.com/api/commerce/online-payments/online-payments/online-payments#/operations/V2RefundPost
<think> PR Context: - Title: feat(connector): [jpmorgan] implement refund flow - Merged: 2025-06-25T07:01:17Z - Files changed: 3 files - Commits: 4 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR implements refund flow for JPMorgan connector. Connector returns `Authorized` state (`Pending`). Post RSync call, the status gets updated to `Success`. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): [jpmorgan] implement refund flow (#8436) Files to modify: **crates/hyperswitch_connectors/src/connectors/jpmorgan.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs** Remove: - struct: pub::MerchantSoftware - struct: pub::RefundResponse
{"issue_number": 8435, "pr_number": 8436, "commits_count": 1, "files_changed": 3, "response_length": 1097, "file_count": 4, "needs_breakdown": false}
refactor(cypress): fix payouts not running ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [x] CI/CD ## Description <!-- Describe your changes in detail --> - remove logs (again), this prevents exposure of `globalState` in everywhere possible - refactor(cypress): fix payouts not running - set a global variable to check if connector auth exist for a payout as well as payin (payment) - if not, skip `connector create` call eventually skipping all the tests (goes to `pending` state, no payment fails) - We put `before` before `beforeEach` just so that the `globalState` is set and eventually, `beforeEach` will look after whether to continue further or not - move `payment_methods_enabled` to `commons.js` to avoid it from interfering in payouts (optional change done to keep `connector create` call clean for payouts) - This will also enable us to make `connector create` call dynamic, meaning, in future, we can pass connector specific `payment_method` list - update readme ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> NIL ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Bank redirects fix raised at https://github.com/juspay/hyperswitch/pull/4903 |Adyen|Bank of America|Bluesnap|Cybersource| |-|-|-|-| |![image](https://github.com/juspay/hyperswitch/assets/69745008/1f16684e-1fe2-41df-ae33-97fd1d104f77)|![image](https://github.com/juspay/hyperswitch/assets/69745008/4eaf367a-d3a3-415d-b5c2-92a4668c109a)|![image](https://github.com/juspay/hyperswitch/assets/69745008/906ab3fa-bf09-4a1c-8629-c0699d12aee6)|![image](https://github.com/juspay/hyperswitch/assets/69745008/1121ad4f-ed49-497c-bcbe-ad7b1d5389da)| |NMI|PayPal|Stripe|Trustpay| |![image](https://github.com/juspay/hyperswitch/assets/69745008/4036b786-d60d-4c7f-ab0b-110d7492e40b)|![image](https://github.com/juspay/hyperswitch/assets/69745008/3df5cfb8-c628-4a5b-bae7-2fb39563c99b)|![image](https://github.com/juspay/hyperswitch/assets/69745008/92ca2ac9-5fea-45c7-b93d-0a8d1fd6579e)|![image](https://github.com/juspay/hyperswitch/assets/69745008/66e417e8-d276-4df7-83e4-724f50d7a8cd)| Adyen started refusing payment for sending too many requests. After `beforeEach` refactoring: <img width="543" alt="image" src="https://github.com/juspay/hyperswitch/assets/69745008/b1214307-fa62-4bbd-8d46-6475609cbdf6"> Doc refs: - https://filiphric.com/cypress-basics-before-beforeeach-after-aftereach - https://docs.cypress.io/guides/references/best-practices - https://medium.com/software-testing-pipeline/cypress-test-hooks-570a67ebb31 [Routing fails as we are supposed to pass JWT Token and not API Key which results in it throwing `4XX` searching for `Authorization` parameter] _____ > [!IMPORTANT] > This PR only deals with the following: > - Connector create for Payments > - Payouts and skipping payout tests > - Stripe bank redirects redirection > > And hence, it should not affect other flows. Any failures that occurred other than these are not because of this change. Those failures are to be handled separately _____ ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
<think> PR Context: - Title: fix(cypress): address cypress skipping tests - Merged: 2024-06-20T10:12:12Z - Files changed: 17 files - Commits: 15 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR fixes error introduced in commit [`24217d1` (#4904)](https://github.com/juspay/hyperswitch/pull/4904/commits/24217d132f87c31ecb2a44ac6340425d26750a5f) of PR https://github.com/juspay/hyperswitch/pull/4904 which led to tests getting s </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 4904, "pr_number": 5046, "commits_count": 0, "files_changed": 17, "response_length": 776, "file_count": 0, "needs_breakdown": false}
[FEATURE]: [Opayo] Use `connector_response_reference_id` as reference to merchant ### :memo: Feature Description - Reference id are used to map transactions in the connector’s dashboard. - Hyperswitch manages several reference ids, such as `payment_id`, `attempt_id`, and `connector_transaction_id` for a single transaction. - However, merchants may encounter uncertainty when determining which ID to utilize in the connector dashboard to identify the payment. ### :hammer: Possible Implementation - When we receive a response from the connector for the payment, we deserialize it and populate the `response` field in RouterData. - For the `TransactionResponse` type, we must fill the `connector_response_reference_id` with a corresponding reference id for the merchant to identify the transaction. - One might need to have exposure to api docs of the connector for which it is being implemented to decide what to fill in connector_response_reference_id. - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/1735 🔖 Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: feat(connector): [Opayo] Add connector id - Merged: 2023-10-04T19:50:40Z - Files changed: 1 files - Commits: 9 commits Implementation approach: ## Description <!-- Describe your changes in detail --> opayo uses [transaction_Id ](https://developer-eu.elavon.com/docs/opayo/spec/api-reference#operation/createTransaction) filled the connector_response_reference_id ### Additional Changes - [ ] This PR modifies the API contract - [ ] This </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): [Opayo] Add connector id (#2418) Co-authored-by: kamalika0363 <kamlaikaghora14@gmai Files to modify: **crates/router/src/connector/opayo/transformers.rs** Modify existing code
{"issue_number": 2341, "pr_number": 2418, "commits_count": 1, "files_changed": 1, "response_length": 970, "file_count": 3, "needs_breakdown": false}
[FEATURE]: [Bambora] Use `connector_response_reference_id` as reference to merchant ### :memo: Feature Description - Reference id are used to map transactions in the connector’s dashboard. - Hyperswitch manages several reference ids, such as `payment_id`, `attempt_id`, and `connector_transaction_id` for a single transaction. - However, merchants may encounter uncertainty when determining which ID to utilize in the connector dashboard to identify the payment. ### :hammer: Possible Implementation - When we receive a response from the connector for the payment, we deserialize it and populate the `response` field in RouterData. - For the `TransactionResponse` type, we must fill the `connector_response_reference_id` with a corresponding reference id for the merchant to identify the transaction. - One might need to have exposure to api docs of the connector for which it is being implemented to decide what to fill in connector_response_reference_id. - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/1735 🔖 Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: feat(connector): [Bambora] Use connector_response_reference_id as reference to the connector - Merged: 2023-10-19T14:22:51Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description The `connector_response_reference_id` parameter has been set for the Bambora Payment Solutions for uniform reference and transaction tracking. ### File Changes - [x] This PR modifies the Bambora Transformers file. **Location- router/src/connector/bambora/transformers.rs** ## Motivation and Context This PR was raised so that it Fixes #2324 ! ## How did you test it? - **I ran the following command, and all the </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): [Bambora] Use connector_response_reference_id as reference to the connector (#2635) Files to modify: **crates/router/src/connector/bambora/transformers.rs** Modify existing code
{"issue_number": 2324, "pr_number": 2635, "commits_count": 1, "files_changed": 1, "response_length": 1023, "file_count": 4, "needs_breakdown": false}
feat(core): Add record attempt operation for revenue recovery webhooks ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> **Revenue record operation** In revenue recovery webhook flow, we mainly consume 3 types of events 1) PaymentFailure 2) PaymentSuccess 3) InvoiceCancel For PaymentFailure or PaymentSuccess scenario we need to record the attempt and update the payment intent fields. This PR adds support for this operations. **Why do we need to record the payment attempts ?** To predict the next schedule time of mit transaction we need previous attempts information like error message, code and billing info, mandate details etc. So we store this info in payment_attempt against intent(invoice). **Why do we need to update payment intent ?** Intent Status should be altered based on attempt status. Apart from this info like no of retries, payment method token details needs to be update in update trackers of record attempt operation. ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Testcase 1: create payment connector mca : ``` curl --location 'http://localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: cloth_seller_FFzEuYGiJhp3SfL7AXoZ' \ --header 'x-profile-id: pro_gj36mgkfbJuFw2ZVvzX8' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "payment_processor", "connector_name": "stripe", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "stripe apikey" }, "connector_webhook_details": { "merchant_secret": "" }, "profile_id": "pro_gj36mgkfbJuFw2ZVvzX8" }' ``` response : ``` { "connector_type": "payment_processor", "connector_name": "stripe", "connector_label": "stripe_business", "id": "mca_oAXqVf3BZs7bOS0iNhV7", "profile_id": "pro_gj36mgkfbJuFw2ZVvzX8", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "sk*******************************************************************************************************5b" }, "payment_methods_enabled": null, "connector_webhook_details": { "merchant_secret": "", "additional_secret": null }, "metadata": null, "disabled": false, "frm_configs": null, "applepay_verified_domains": null, "pm_auth_config": null, "status": "active", "additional_merchant_data": null, "connector_wallets_details": null, "feature_metadata": null } ``` get the payment connector mca and create billing connector mca Create billing connector mca ``` curl --location 'http://localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: cloth_seller_FFzEuYGiJhp3SfL7AXoZ' \ --header 'x-profile-id: pro_gj36mgkfbJuFw2ZVvzX8' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "billing_processor", "connector_name": "chargebee", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "chargebee apikey" }, "connector_webhook_details": { "merchant_secret": "chargebee", "additional_secret" : "password" }, "feature_metadata" : { "revenue_recovery" : { "max_retry_count" : 27, "billing_connector_retry_threshold" : 16, "billing_account_reference" :{ "mca_oAXqVf3BZs7bOS0iNhV7" : "gw_16BlyOUaPA0eq12MZ" } } }, "profile_id": "pro_gj36mgkfbJuFw2ZVvzX8" }' ``` response : ``` { "connector_type": "payment_processor", "connector_name": "chargebee", "connector_label": "chargebee_business", "id": "mca_1WvloGjsk5KcxOZ6fBPd", "profile_id": "pro_gj36mgkfbJuFw2ZVvzX8", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "sk*******************************************************************************************************5b" }, "payment_methods_enabled": null, "connector_webhook_details": { "merchant_secret": "chargebee", "additional_secret": "password" }, "metadata": null, "disabled": false, "frm_configs": null, "applepay_verified_domains": null, "pm_auth_config": null, "status": "active", "additional_merchant_data": null, "connector_wallets_details": null, "feature_metadata": { "revenue_recovery": { "max_retry_count": 27, "billing_connector_retry_threshold": 16, "billing_account_reference": { "mca_oAXqVf3BZs7bOS0iNhV7": "gw_16BlyOUaPA0eq12MZ" } } } } ``` Send chargebee simulated webhook either from dashboard or postman request : ``` curl --location 'http://localhost:8080/v2/webhooks/cloth_seller_FFzEuYGiJhp3SfL7AXoZ/pro_gj36mgkfbJuFw2ZVvzX8/mca_1WvloGjsk5KcxOZ6fBPd' \ --header 'Content-Type: application/json' \ --header 'Authorization: ••••••' \ --data-raw '{ "id": "ev_169vy3UaPFn4L4mf", "occurred_at": 1737361021, "source": "admin_console", "user": "ns22eem1r18@student.nitw.ac.in", "object": "event", "api_version": "v2", "content": { "transaction": { "id": "txn_169vy3UaPFmC44me", "customer_id": "Azq8o5UaLqWWvyGd", "subscription_id": "Azq8o5UaLr2WnyHG", "gateway_account_id": "gw_16BlyOUaPA0eq12MZ", "payment_source_id": "pm_169vy3UaPDo0t4hL", "payment_method": "card", "gateway": "stripe", "type": "payment", "date": 1737361019, "exchange_rate": 1, "amount": 5, "id_at_gateway": "ch_3QjGAJSHworDX2hs0B120C0A", "status": "failure", "updated_at": 1737361021, "fraud_reason": "Payment complete.", "resource_version": 1737361021397, "deleted": false, "object": "transaction", "masked_card_number": "************4242", "currency_code": "INR", "base_currency_code": "INR", "amount_unused": 0, "linked_invoices": [ { "invoice_id": "9", "applied_amount": 500000, "applied_at": 1737361021, "invoice_date": 1737361018, "invoice_total": 500000, "invoice_status": "paid" } ], "linked_refunds": [], "initiator_type": "merchant", "three_d_secure": false, "payment_method_details": "{\"card\":{\"first_name\":\"test2\",\"last_name\":\"name2\",\"iin\":\"424242\",\"last4\":\"4242\",\"funding_type\":\"credit\",\"expiry_month\":12,\"expiry_year\":2026,\"billing_addr1\":\"asdf\",\"billing_addr2\":\"asd\",\"billing_city\":\"asdf\",\"billing_state\":\"asdfaf\",\"billing_country\":\"AF\",\"billing_zip\":\"12345\",\"masked_number\":\"************4242\",\"object\":\"card\",\"brand\":\"visa\"}}" }, "invoice": { "id": "invoice_1234", "customer_id": "Azq8o5UaLqWWvyGd", "subscription_id": "Azq8o5UaLr2WnyHG", "recurring": false, "status": "paid", "price_type": "tax_exclusive", "date": 1737361018, "due_date": 1737361018, "net_term_days": 0, "exchange_rate": 1, "total": 5, "amount_paid": 0, "amount_adjusted": 0, "write_off_amount": 0, "credits_applied": 0, "amount_due": 0, "paid_at": 1737361019, "updated_at": 1737361021, "resource_version": 1737361021401, "deleted": false, "object": "invoice", "first_invoice": false, "amount_to_collect": 0, "round_off_amount": 0, "has_advance_charges": false, "currency_code": "INR", "base_currency_code": "INR", "generated_at": 1737361018, "is_gifted": false, "term_finalized": true, "channel": "web", "tax": 0, "line_items": [ { "id": "li_169vy3UaPFmBR4md", "date_from": 1737361004, "date_to": 1737361004, "unit_amount": 500000, "quantity": 1, "amount": 500000, "pricing_model": "flat_fee", "is_taxed": false, "tax_amount": 0, "object": "line_item", "subscription_id": "Azq8o5UaLr2WnyHG", "customer_id": "Azq8o5UaLqWWvyGd", "description": "Implementation Charge", "entity_type": "charge_item_price", "entity_id": "cbdemo_implementation-charge-INR", "tax_exempt_reason": "tax_not_configured", "discount_amount": 0, "item_level_discount_amount": 0 } ], "sub_total": 500000, "linked_payments": [ { "txn_id": "txn_169vy3UaPFmC44me", "applied_amount": 500000, "applied_at": 1737361021, "txn_status": "success", "txn_date": 1737361019, "txn_amount": 500000 } ], "applied_credits": [], "adjustment_credit_notes": [], "issued_credit_notes": [], "linked_orders": [], "dunning_attempts": [], "billing_address": { "first_name": "test1", "last_name": "name", "email": "johndoe@gmail.com", "company": "johndoe", "phone": "+91 83 17 575848", "line1": "asdf", "line2": "asd", "line3": "ahjkd", "city": "asdf", "state_code": "TG", "state": "Telangana", "country": "IN", "zip": "561432", "validation_status": "not_validated", "object": "billing_address" }, "site_details_at_creation": { "timezone": "Asia/Calcutta" } }, "customer": { "id": "Azq8o5UaLqWWvyGd", "first_name": "john", "last_name": "doe", "email": "john@gmail.com", "phone": "831 757 5848", "company": "johndoe", "auto_collection": "on", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1737310670, "created_from_ip": "205.254.163.189", "taxability": "taxable", "updated_at": 1737360899, "pii_cleared": "active", "channel": "web", "resource_version": 1737360899990, "deleted": false, "object": "customer", "billing_address": { "first_name": "test1", "last_name": "name", "email": "johndoe@gmail.com", "company": "johndoe", "phone": "+91 83 17 575848", "line1": "asdf", "line2": "asd", "line3": "ahjkd", "city": "asdf", "state_code": "TG", "state": "Telangana", "country": "IN", "zip": "561432", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "valid", "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "INR", "mrr": 0, "primary_payment_source_id": "pm_169vy3UaPDo0t4hL", "payment_method": { "object": "payment_method", "type": "card", "reference_id": "cus_RcUo8xTwe0sHP7/card_1QjG2dSHworDX2hs6YIjKdML", "gateway": "stripe", "gateway_account_id": "gw_16BlyOUaPA0eq12MZ", "status": "valid" } }, "subscription": { "id": "Azq8o5UaLr2WnyHG", "billing_period": 1, "billing_period_unit": "month", "customer_id": "Azq8o5UaLqWWvyGd", "status": "active", "current_term_start": 1737310793, "current_term_end": 1739989193, "next_billing_at": 1739989193, "created_at": 1737310793, "started_at": 1737310793, "activated_at": 1737310793, "created_from_ip": "205.254.163.189", "updated_at": 1737310799, "has_scheduled_changes": false, "channel": "web", "resource_version": 1737310799688, "deleted": false, "object": "subscription", "currency_code": "INR", "subscription_items": [ { "item_price_id": "cbdemo_premium-INR-monthly", "item_type": "plan", "quantity": 1, "unit_price": 100000, "amount": 0, "free_quantity": 3, "object": "subscription_item" } ], "shipping_address": { "first_name": "test1", "last_name": "name", "email": "johndoe@gmail.com", "company": "johndoe", "phone": "+91 83 17 575848", "line1": "asdf", "line2": "asd", "line3": "ahjkd", "city": "asdf", "state_code": "TG", "state": "Telangana", "country": "IN", "zip": "561432", "validation_status": "not_validated", "object": "shipping_address" }, "due_invoices_count": 0, "mrr": 0, "exchange_rate": 1, "base_currency_code": "INR", "has_scheduled_advance_invoices": false } }, "event_type": "payment_failed", "webhook_status": "scheduled", "webhooks": [ { "id": "whv2_6oZfZUaLmtchA5Bl", "webhook_status": "scheduled", "object": "webhook" } ] }' ``` This should create Payment intent, payment attempt in our system with right values in DB Payment intent details in DB ![Screenshot 2025-03-05 at 12 43 36 PM](https://github.com/user-attachments/assets/a584e694-3c44-48ed-862f-eea8d756ecc3) Payment attempt details in DB ![Screenshot 2025-03-05 at 12 41 02 PM](https://github.com/user-attachments/assets/3b9762b2-9c60-43c5-be93-646f74cacd38) Test case 2 : change the transaction id in above simulated webhooks and hit the request again, it should create new payment attempt but update the payment intent feature metadata. ![Screenshot 2025-03-05 at 1 20 35 PM](https://github.com/user-attachments/assets/f1926c83-d670-4c52-ae38-01cd39fb43e6) Test case 3 : After passing succeded transaction, we should not allow to record further transactions ![Screenshot 2025-03-05 at 1 25 47 PM](https://github.com/user-attachments/assets/dd9b3540-9289-497d-8b8d-014b7b93b82d) Note: This above webhook will still not recieve api response it will only create objects in our system . ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
<think> PR Context: - Title: feat(connector): Add support for passive churn recovery webhooks - Merged: 2025-02-22T21:44:08Z - Files changed: 30 files - Commits: 30 commits Implementation approach: ## Description <!-- Describe your changes in detail --> **Recovery Incoming Webhooks service :** Consume incoming webhooks of billing platforms to schedule revenue recovery retries in hs. **Endpoint :** v2/webhooks/revenue_recovery/{{profile_id}}/{{merchant_connector_account_id}} **Authe </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): Add support for passive churn recovery webhooks (#7109) Co-authored-by: Chikke Sruj Files to modify: **crates/api_models/src/payments.rs** Add: - struct: pub::PaymentAttemptFeatureMetadata - struct: pub::PaymentAttemptRevenueRecoveryData **crates/api_models/src/webhooks.rs** Add: - enum: pub::InvoiceIdType **crates/common_enums/src/enums.rs** Add: - enum: pub::TriggeredBy **crates/common_utils/src/ext_traits.rs** Add: - function: private::async_unwrap_or_else - function: private::async_unwrap_or_else **crates/diesel_models/src/payment_attempt.rs** Add: - struct: pub::PaymentAttemptFeatureMetadata - struct: pub::PaymentAttemptRecoveryData **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/hyperswitch_domain_models/src/lib.rs** Add: - mod: pub::revenue_recovery **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Add: - function: private::from - function: private::from - struct: pub::PaymentAttemptFeatureMetadata - struct: pub::PaymentAttemptRevenueRecoveryData - impl: impl From<&PaymentAttemptFeatureMetadata> for DieselPaymentAttemptFeatureMetadata - impl: impl From<DieselPaymentAttemptFeatureMetadata> for PaymentAttemptFeatureMetadata **crates/hyperswitch_domain_models/src/revenue_recovery.rs** Add: - function: pub::get_attempt_triggered_by - function: pub::get_action - function: private::from - function: private::from - struct: pub::RevenueRecoveryAttemptData - struct: pub::RevenueRecoveryInvoiceData - struct: pub::RecoveryPaymentIntent - struct: pub::RecoveryPaymentAttempt - enum: pub::RecoveryAction - impl: impl RecoveryPaymentAttempt - impl: impl RecoveryAction - impl: impl From<&RevenueRecoveryInvoiceData> for api_models::payments::AmountDetails - impl: impl From<&RevenueRecoveryInvoiceData> for api_models::payments::PaymentsCreateIntentRequest **crates/hyperswitch_interfaces/src/webhooks.rs** Add: - function: private::get_revenue_recovery_attempt_details - function: private::get_revenue_recovery_invoice_details **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/router/src/core/errors.rs** Add: - enum: pub::RevenueRecoveryError **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/webhooks.rs** Add: - mod: private::recovery_incoming **crates/router/src/core/webhooks/incoming_v2.rs** Modify existing code **crates/router/src/core/webhooks/recovery_incoming.rs** Add: - function: pub::recovery_incoming_webhook_flow - function: private::get_payment_intent - function: private::create_payment_intent - function: private::get_payment_attempt - function: private::record_payment_attempt - struct: pub::RevenueRecoveryInvoice - struct: pub::RevenueRecoveryAttempt - impl: impl RevenueRecoveryInvoice - impl: impl RevenueRecoveryAttempt **crates/router/src/routes.rs** Add: - mod: pub::recovery_webhooks **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/routes/recovery_webhooks.rs** Add: - function: pub::recovery_receive_incoming_webhook **crates/router/src/services/connector_integration_interface.rs** Add: - function: private::get_revenue_recovery_attempt_details - function: private::get_revenue_recovery_invoice_details **crates/router_env/src/logger/types.rs** Modify existing code
{"issue_number": 7236, "pr_number": 7109, "commits_count": 1, "files_changed": 30, "response_length": 4498, "file_count": 28, "needs_breakdown": true}
refactor(fix): [Stripe] Fix bug in Stripe ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description In Stripe Wechatpay, the status ```requires_customer_action``` doesn't change even after redirection. As success or failure only gets updated through Webhook. This caused an error as redirection link was sent by the connector even in sync call. To avoid this, once the redirection is complete we change the status to ```pending```. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Through hs-payments-test.netlify.app/ <img width="1728" alt="Screen Shot 2023-06-12 at 3 46 49 PM" src="https://github.com/juspay/hyperswitch/assets/131388445/84fac00f-46de-4b30-8209-7c48fcff31c9"> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: refactor(fix): [Stripe] Fix bug in Stripe - Merged: 2023-06-22T09:06:43Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description Revert for #1412 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(fix): [Stripe] Fix bug in Stripe (#1505) Files to modify: **crates/router/src/connector/stripe.rs** Modify existing code
{"issue_number": 1412, "pr_number": 1505, "commits_count": 1, "files_changed": 1, "response_length": 907, "file_count": 3, "needs_breakdown": false}
refactor(common_utils): move `serde` implementations and date-time utils to `common_utils` crate ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates ## Description <!-- Describe your changes in detail --> This PR moves custom `serde` implementations and date-time utils from the `router` crate to the `common_utils` crate. ### Additional Changes - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> N/A ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> This change unblocks splitting out API models to a separate crate. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Created a payment via Postman after the refactor. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: refactor: raise appropriate errors instead of `ValidateError` - Merged: 2022-12-06T07:04:07Z - Files changed: 12 files - Commits: 7 commits Implementation approach: ## Description <!-- Describe your changes in detail --> To describe briefly, this PR raises appropriate errors instead of `ValidateError` and removes `ValidateError` in favor of `ValidationError`. A better understanding of the changes involved in this PR can be obtained from the commit log. <details> <summary>Commit Log (click to expand):</summary> <ul> <li>fix(connectors): raise <code>ParsingError</code> or <code>ConnectorError</code> during transformat </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor: raise appropriate errors instead of `ValidateError` (#71) Files to modify: **crates/router/src/compatibility/stripe/errors.rs** Modify existing code **crates/router/src/connector/checkout/transformers.rs** Modify existing code **crates/router/src/connector/stripe/transformers.rs** Modify existing code **crates/router/src/core/errors.rs** Modify existing code **crates/router/src/core/errors/api_error_response.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/payments/operations/payment_confirm.rs** Modify existing code **crates/router/src/core/payments/operations/payment_start.rs** Modify existing code **crates/router/src/core/payments/operations/payment_update.rs** Modify existing code **crates/router/src/core/refunds.rs** Modify existing code **crates/router/src/services/api.rs** Modify existing code **crates/router/src/utils/ext_traits.rs** Modify existing code
{"issue_number": 40, "pr_number": 71, "commits_count": 1, "files_changed": 12, "response_length": 1786, "file_count": 14, "needs_breakdown": false}
feat(merchant_context): add struct `merchant_context` and replace all instances of `merchant_account` and `key_store` in core # Introduction of MerchantContext: Unified Merchant Operation Context ## Challenge Currently, merchant account and key store information are passed separately throughout the codebase, leading to scattered merchant context handling and reduced maintainability. Functions individually manage these components, making it difficult to implement platform-wide features or connected account capabilities. ## Proposed Changes Introducing `MerchantContext`, a new type that encapsulates both merchant account and key store information: ```rust pub enum MerchantContext { NormalMerchant(Box<Context>), } pub struct Context(pub MerchantAccount, pub MerchantKeyStore); ``` The type provides controlled access through methods: - `get_merchant_account()`: Access merchant account details - `get_merchant_key_store()`: Access cryptographic key store ## Why 1. **Unified Context**: Encapsulates merchant authentication and operational context in one place 2. **Cleaner Architecture**: Replaces scattered merchant account and key store parameters with a single context object 3. **Enhanced Control**: Method-based access enables validation, transformation, and future enhancements 4. **Maintainability**: Centralized merchant context management reduces code duplication and improves traceability ## How The implementation follows a tree-like flow where the `MerchantContext` is: 1. Declared at the route handler level (root) 2. Passed down through core operation handlers (branches) 3. Finally consumed in database operations or other terminal functions (leaves) This creates a clear, traceable flow of merchant context through the entire operation chain, making it easier to understand and maintain merchant-related operations. ## Future Objectives 1. **Operational Context extension**: The enum structure allows adding new variants for different operations, enabling: - Platform-level context inheritance - Connected account operations - cherry picking context for individual fragment of flows 2. **Granular Context Control**: - Move context declaration to auth layer - Enable advanced platform features by implementing context creation logic for platform operations This architectural change sets the foundation for future platform features while maintaining current functionality and improving code organization.
<think> PR Context: - Title: feat(merchant_context): add struct `merchant_context` and replace all instances of `merchant_account` and `key_store` in core - Merged: 2025-04-29T09:43:05Z - Files changed: 30 files - Commits: 30 commits Implementation approach:
{"issue_number": 7875, "pr_number": 7882, "commits_count": 1, "files_changed": 30, "response_length": 11810, "file_count": 141, "needs_breakdown": true}
feat(pm_list): support filter based on disabled connectors ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] New feature ## Description <!-- Describe your changes in detail --> Ability to filter merchant connector account based on disabled status <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> Provide this functionality at the db level so all other apis can make use of it. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Create a payment_connector with disabled = true and then call the pm list. Only active connectors will be considered ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code
<think> PR Context: - Title: chore(deps): bump zerocopy from 0.7.26 to 0.7.31 - Merged: 2023-12-15T09:57:26Z - Files changed: 1 files - Commits: 1 commits Implementation approach: Bumps [zerocopy](https://github.com/google/zerocopy) from 0.7.26 to 0.7.31. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/google/zerocopy/releases">zerocopy's releases</a>.</em></p> <blockquote> <h2>v0.7.30</h2> <h2>What's Changed</h2> <ul> <li>[policies] Document yanking policy by <a href="https://github.com/joshlf"><code>@​joshlf</code></a> in <a href="https://redirect.github.com/google/zerocopy/pull/677">google/zerocopy#677</a></li> <li>[ci] Roll p </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 660, "pr_number": 3136, "commits_count": 0, "files_changed": 1, "response_length": 778, "file_count": 0, "needs_breakdown": false}
feat(cypress): generate test reports ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [x] CI/CD ## Description <!-- Describe your changes in detail --> This PR adds configs and commands to generate test reports. Reports are generated automatically after the test is run. File format will be: - Screenshots: `[<connector_name>] <screenshot_name> (failed).png` - Reports: - If `reportName` is passed explicitly as a variable: - `<connector_name>_report_<hyperswitch_version>.html` - `<connector_name>_report_<hyperswitch_version>.json` - If `reportName` is not passed explicitly as a variable: - `<connector_name>_report.html` - `<connector_name>_report.json` ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> This is a P0 requirement that notifies people of tests that are failing with reports. At present, we only get to know that the specific test is failed, but no one that I know is bothered to care about just because it is still immature. With this change, we should see test reports being generated and served right to us after the tests are run. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Once the test run, below is format in which the reports get generated: When the tests are running: <img width="741" alt="image" src="https://github.com/user-attachments/assets/a0519b2b-0001-4e5d-b9a8-afd04ec0f809"> After generation of report is completed: <img width="739" alt="image" src="https://github.com/user-attachments/assets/36ea237c-9a22-4fcc-9f64-f9d166e04ef9"> Above mentioned commands merge these reports into one: |Side panel|Main window| |-|-| |<img width="1459" alt="image" src="https://github.com/user-attachments/assets/6f11f93d-c941-4f83-a618-6f883a9ea2d7">|<img width="1459" alt="image" src="https://github.com/user-attachments/assets/154834f7-aa76-408b-a4e0-37f5a33c0d33">| Embedded Screenshots: <img width="1299" alt="image" src="https://github.com/user-attachments/assets/9988e468-c0e7-4aa8-9677-363f21dc93b2"> In order for `Embedded Screenshots` to work https://github.com/juspay/hyperswitch/pull/5563/files#diff-5c94114f761905519a09ff1393545cfed7d2c7399079736b6c3c34cc64f03cd6 was removed with commit [`67c014e` (#5563)](https://github.com/juspay/hyperswitch/pull/5563/commits/67c014e249ec93554bae4fcc70d4a7b50c68556f) ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `prettier . --write` - [ ] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
<think> PR Context: - Title: feat(cypress): generate test reports - Merged: 2024-08-12T13:14:41Z - Files changed: 7 files - Commits: 12 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR adds configs and commands to generate test reports. Reports are generated automatically after the test is run. File format will be: - Screenshots: `[<connector_name>] <screenshot_name> (failed).png` - Reports: - If `reportNa </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 5563, "pr_number": 5563, "commits_count": 0, "files_changed": 7, "response_length": 767, "file_count": 0, "needs_breakdown": false}
feat(connector): [ZSL] add connector template code ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Zsl only supports automatic payment create and payment status gets updated through webhooks ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: refactor(core): add cache redaction for cgraph - Merged: 2025-10-01T11:30:08Z - Files changed: 2 files - Commits: 2 commits Implementation approach: ## Description <!-- Describe your changes in detail --> https://github.com/juspay/hyperswitch/pull/9629 This pull request enhances cache management for connector creation by introducing a new mechanism to invalidate related cache entries whenever a new connector is added. The main change is the ad </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(core): add cache redaction for cgraph (#9639) Co-authored-by: hyperswitch-bot[bot] <1485255 Files to modify: **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/core/routing/helpers.rs** Add: - function: pub::redact_cgraph_cache
{"issue_number": 4285, "pr_number": 9639, "commits_count": 1, "files_changed": 2, "response_length": 1052, "file_count": 4, "needs_breakdown": false}
[REFACTOR]: [Opayo] Remove Default Case Handling ### :memo: Feature Description - We utilize match statements to make pivotal decisions, such as generating requests based on the payment method type and managing responses received from the connector. - These conditions generally go hand in hand with enum variants. - Default case is used because a match statement needs to be exhaustive i.e. every variant needs to be covered. - So, if all the explicit cases are handled then default is used to handle the rest. - Each connector have these match statements but many of them don’t provide reference to each variant in their default case, rather a `_` is put to handle all the other cases. - This approach carries a risk because developers may inadvertently overlook the need for explicit handling of the new cases. ### :hammer: Possible Implementation - Instead of relying on a default match case `_`, developers should handle each and every variant explicitly. - By doing so, if there are any changes in the future, they can readily assess the impact of their modifications simply by compiling the code. - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/1955 :bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: refactor(connector): added default case for Opayo - Merged: 2023-10-25T18:29:03Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> #2279 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with correspond </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(connector): added default case for Opayo (#2687) Files to modify: **crates/router/src/connector/opayo/transformers.rs** Modify existing code
{"issue_number": 2279, "pr_number": 2687, "commits_count": 1, "files_changed": 1, "response_length": 935, "file_count": 3, "needs_breakdown": false}
[FEATURE] add payment methods afterpay, klarna, affirm for adyen connector ### Feature Description Support for payment methods afterpay, klarna and affirm should be added for adyen connector ### Possible Implementation Implementation is similar to card payment method. Newly adding payment method should support following flows, 1. Authorise 2. Capture 3. Cancel 4. Refund 5. Webhook ### Have you spent some time to check if this feature request has been raised before? - [X] I checked and didn't find similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes I am willing to submit a PR!
<think> PR Context: - Title: feat(connector): add afterpay,klarna,affirm support in adyen connector - Merged: 2023-02-09T21:07:10Z - Files changed: 7 files - Commits: 7 commits Implementation approach: Fixes #470 , #488 ## Description add payment methods like affirm, klarna, afterpay support for adyen connector ### Additional Changes - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Follo </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): add afterpay, klarna, affirm support in adyen connector (#516) Files to modify: **crates/router/src/connector/adyen.rs** Modify existing code **crates/router/src/connector/adyen/transformers.rs** Remove: - function: private::try_from - impl: impl TryFrom<&types::BrowserInformation> for AdyenBrowserInfo Add: - function: private::from - function: private::get_recurring_processing_model - function: private::get_browser_info - function: private::get_additional_data - function: private::get_amount_data - function: private::get_address_info - function: private::get_line_items - function: private::get_telephone_number - function: private::get_shopper_name - function: private::get_country_code - function: private::get_card_specific_payment_data - function: private::get_wallet_specific_payment_data - struct: pub::ShopperName - struct: pub::Address - struct: pub::LineItem - enum: pub::PaymentType - impl: impl From<&types::PaymentsAuthorizeRouterData> for AdyenShopperInteraction **crates/router/src/connector/utils.rs** Add: - function: private::get_return_url **crates/router/tests/connectors/adyen.rs** Add: - function: private::get_data - function: private::get_auth_token - function: private::get_name - function: private::get_payment_info - function: private::get_payment_authorize_data - function: private::should_only_authorize_payment - function: private::should_capture_authorized_payment - function: private::should_partially_capture_authorized_payment - function: private::should_void_authorized_payment - function: private::should_refund_manually_captured_payment - function: private::should_partially_refund_manually_captured_payment - function: private::should_make_payment - function: private::should_refund_auto_captured_payment - function: private::should_partially_refund_succeeded_payment - function: private::should_refund_succeeded_payment_multiple_times - function: private::should_fail_payment_for_incorrect_card_number - function: private::should_fail_payment_for_empty_card_number - function: private::should_fail_payment_for_incorrect_cvc - function: private::should_fail_payment_for_invalid_exp_month - function: private::should_fail_payment_for_incorrect_expiry_year - function: private::should_fail_capture_for_invalid_payment - struct: private::AdyenTest - impl: impl ConnectorActions for AdyenTest - impl: impl utils::Connector for AdyenTest - impl: impl AdyenTest **crates/router/tests/connectors/connector_auth.rs** Modify existing code **crates/router/tests/connectors/main.rs** Add: - mod: private::adyen
{"issue_number": 488, "pr_number": 516, "commits_count": 1, "files_changed": 7, "response_length": 3568, "file_count": 8, "needs_breakdown": false}
[REFACTOR]: [ACI] Remove Default Case Handling ### :memo: Feature Description - We utilize match statements to make pivotal decisions, such as generating requests based on the payment method type and managing responses received from the connector. - These conditions generally go hand in hand with enum variants. - Default case is used because a match statement needs to be exhaustive i.e. every variant needs to be covered. - So, if all the explicit cases are handled then default is used to handle the rest. - Each connector have these match statements but many of them don’t provide reference to each variant in their default case, rather a `_` is put to handle all the other cases. - This approach carries a risk because developers may inadvertently overlook the need for explicit handling of the new cases. ### :hammer: Possible Implementation - Instead of relying on a default match case `_`, developers should handle each and every variant explicitly. - By doing so, if there are any changes in the future, they can readily assess the impact of their modifications simply by compiling the code. - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/1955 :bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: refactor(connector): [Aci] remove default case handling - Merged: 2024-03-18T07:03:55Z - Files changed: 1 files - Commits: 30 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Instead of _ case, handled each and every case explicitly. Fixes #2201 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/envir </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(connector): [Aci] remove default case handling (#2513) Co-authored-by: Prasunna Soppa <705 Files to modify: **crates/router/src/connector/aci/transformers.rs** Modify existing code
{"issue_number": 2201, "pr_number": 2513, "commits_count": 1, "files_changed": 1, "response_length": 984, "file_count": 3, "needs_breakdown": false}
feat(single_use): add extra fields in `Mandate` table and `MandateData` [Blocked on #61] ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates ## Description This PR adds single use mandate support and a 2 new fields to the mandate table (i.e. singe_use_amount, single_use_currency) <!-- Describe your changes in detail --> ### Additional Changes - [x] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> The change includes the following files. - migrations/2022-12-05-090521_single_use_mandate_fields/up.sql - migrations/2022-12-05-090521_single_use_mandate_fields/down.sql ## Motivation and Context Here, the intension is adding a new Validation feature in PaymentsCore, for that reason following are the steps that the change is broken down to. 1. Create new types for the change #45 2. Introduce the Flow and Connector Integration #47 3. Add Stripe POC #50 4. Introduce the new operation and all the related components in the payments core #53 + #61 5. Changing the `MandateData` type 6. Move the mandate related behaviour to domain <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless its an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: fix(payout): use get_string_repr for formatting payout IDs - Merged: 2025-07-05T15:11:29Z - Files changed: 10 files - Commits: 2 commits Implementation approach: ## Description This PR fixes the bug report - https://github.com/juspay/hyperswitch/issues/8392#issuecomment-3032692625 Introduces below changes - Use `get_string_repr` for formatting payoutIDs which were using default formatter - Update connector configs for `adyenplatform` (WASM) - Update pa </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(payout): use get_string_repr for formatting payout IDs (#8547) Co-authored-by: hyperswitch-bot[b Files to modify: **crates/router/src/core/payouts.rs** Modify existing code
{"issue_number": 66, "pr_number": 8547, "commits_count": 1, "files_changed": 10, "response_length": 972, "file_count": 3, "needs_breakdown": false}
feat(connector): enforce logging for connector requests ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Enforce logging on Connector Request, while maintaining PII masking. For constructing the request body have a function `log_and_get_request_body` that allows generic argument which is the struct that is passed as the body for connector integration, and a function that can be use to encode it into String. We log the request in this function, as the struct will be intact and the masked values will be masked. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context Currently, we are logging the request but, we are masking the entire payload, so we are unable to deduce which fields were sent and track the overall outbound flows on the connector end. ## How did you test it? Unit tests for top 5 connectors 1. Stripe <img width="984" alt="image" src="https://github.com/juspay/hyperswitch/assets/56996463/bfd6e897-0880-4716-b9d7-dcca6501c795"> 2. Checkout <img width="984" alt="image" src="https://github.com/juspay/hyperswitch/assets/56996463/e2c03a57-e7de-425e-8239-124884f5a24f"> 3. Adyen <img width="879" alt="image" src="https://github.com/juspay/hyperswitch/assets/56996463/77e5083f-9528-4923-b807-0063b8c5f3bf"> 4. Bluesnap <img width="872" alt="image" src="https://github.com/juspay/hyperswitch/assets/56996463/4ddd5f54-cfb1-4328-a336-c1a951dd75ed"> 5. Zen <img width="1189" alt="image" src="https://github.com/juspay/hyperswitch/assets/56996463/2bbb84cc-9a1d-43ac-8916-cf24b1fbc589"> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: fix(connector): [TrustPay] change the request encoding - Merged: 2023-06-23T13:31:12Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Change the encoding of the request body from string of json to url_encoded. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/envi </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(connector): [TrustPay] change the request encoding (#1530) Files to modify: **crates/router/src/connector/trustpay.rs** Modify existing code
{"issue_number": 1467, "pr_number": 1530, "commits_count": 1, "files_changed": 1, "response_length": 935, "file_count": 3, "needs_breakdown": false}
[BUG] Fix postman collections - [x] NMI: Scenarios 10 and 11 are run before 1 - [x] Bluesnap: Inconsistency of payment method being saved in saved card flow - [x] Checkout: Inconsistency of payment method being saved in saved card flow - [x]Adyen: Inconsistency of payment method being saved in saved card flow ## Solution - Remove `Copy` in Scenarios 10 and 11 form `.meta.json` to match with actual folder names - Set `random_number` in `pre_request.js` for Bluesnap connector to make `customer_id` unique
<think> PR Context: - Title: ci(postman): fix bluesnap and checkout collections for saved card flow - Merged: 2024-03-13T14:24:46Z - Files changed: 12 files - Commits: 5 commits Implementation approach: ## Description <!-- Describe your changes in detail --> - NMI: Removed `Copy` from `.meta.json` to fix `Scenario 10` an `11` from running before `Scenario 1` - Bluesnap: Make `customer_id` unique to avoid payment method from being saved Closes #4070 > [!NOTE] > `.json` files are auto-gene </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 4070, "pr_number": 4071, "commits_count": 0, "files_changed": 12, "response_length": 801, "file_count": 0, "needs_breakdown": false}
feat: Implement subscriptions workflow and incoming webhook support ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This pr adds support for the invoice-generated event type for the incoming webhook for Chargebee and creates a process tracker entry that will trigger a S2S call and invoice sync. ### 1. __Invoice Generated Webhook Support__ - Implements handling for Chargebee's `invoice_generated` webhook event - Creates process tracker entries for subscription workflow management - Added SubscriptionId to ObjectReferenceId for subscription webhook - Created a get_mca_from_subscription_id function to fetch the MerchantConnectorAccount from the SubscriptionId ### 2. __Subscription Workflow Integration__ - Adds subscription workflow tracking data - Implements process tracker integration for subscription events ### 3. __Database Changes__ - Insert details into the invoice table ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Insert into subscription table ``` INSERT INTO public.subscription ( id, status, billing_processor, payment_method_id, merchant_connector_id, client_secret, connector_subscription_id, merchant_id, customer_id, metadata, created_at, modified_at, profile_id, merchant_reference_id ) VALUES ( '169vD0Uxi8JB746e', 'active', 'chargebee', 'pm_98765', 'mca_YH3XxYGMv6IbKD0icBie', 'secret_subs_1231abcd', '169vD0Uxi8JB746e', 'merchant_1758710612', 'gaurav_test', '{"plan":"basic","trial":true}', NOW(), NOW(), 'pro_RkLiGcSuaRjmxA5suSfV', 'ref_subs_1231abcd' ); ``` incoming webhook for chargebee ``` curl --location 'http://localhost:8080/webhooks/merchant_1758710612/mca_YH3XxYGMv6IbKD0icBie' \ --header 'api-key: dev_5LNrrMNqyyFle8hvMssLob9pFq6OIEh0Vl3DqZttFXiDe7wrrScUePEYrIiYfSKT' \ --header 'Content-Type: application/json' \ --header 'authorization: Basic aHlwZXJzd2l0Y2g6aHlwZXJzd2l0Y2g=' \ --data-raw '{ "api_version": "v2", "content": { "invoice": { "adjustment_credit_notes": [], "amount_adjusted": 0, "amount_due": 14100, "amount_paid": 0, "amount_to_collect": 14100, "applied_credits": [], "base_currency_code": "INR", "channel": "web", "credits_applied": 0, "currency_code": "INR", "customer_id": "gaurav_test", "date": 1758711043, "deleted": false, "due_date": 1758711043, "dunning_attempts": [], "exchange_rate": 1.0, "first_invoice": false, "generated_at": 1758711043, "has_advance_charges": false, "id": "3", "is_gifted": false, "issued_credit_notes": [], "line_items": [ { "amount": 14100, "customer_id": "gaurav_test", "date_from": 1758711043, "date_to": 1761303043, "description": "Enterprise Suite Monthly", "discount_amount": 0, "entity_id": "cbdemo_enterprise-suite-monthly", "entity_type": "plan_item_price", "id": "li_169vD0Uxi8JBp46g", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "flat_fee", "quantity": 1, "subscription_id": "169vD0Uxi8JB746e", "tax_amount": 0, "tax_exempt_reason": "tax_not_configured", "unit_amount": 14100 } ], "linked_orders": [], "linked_payments": [], "net_term_days": 0, "new_sales_amount": 14100, "object": "invoice", "price_type": "tax_exclusive", "recurring": true, "reference_transactions": [], "resource_version": 1758711043846, "round_off_amount": 0, "site_details_at_creation": { "timezone": "Asia/Calcutta" }, "status": "payment_due", "sub_total": 14100, "subscription_id": "169vD0Uxi8JB746e", "tax": 0, "term_finalized": true, "total": 14100, "updated_at": 1758711043, "write_off_amount": 0 } }, "event_type": "invoice_generated", "id": "ev_169vD0Uxi8JDf46i", "object": "event", "occurred_at": 1758711043, "source": "admin_console", "user": "ankit.gupta.001@juspay.in", "webhook_status": "scheduled", "webhooks": [ { "id": "whv2_169mYOUxi3nvkZ8v", "object": "webhook", "webhook_status": "scheduled" } ] }' ``` response 200 ok <img width="2551" height="555" alt="image" src="https://github.com/user-attachments/assets/29c9f075-cbb6-4a3d-ace0-cee8a884644a" /> db entry into invoice table <img width="578" height="449" alt="image" src="https://github.com/user-attachments/assets/23614dcf-70fc-480b-9922-0d5645e1d333" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
<think> PR Context: - Title: refactor(webhooks): Fix incoming webhooks failure - Merged: 2025-10-16T19:20:19Z - Files changed: 2 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This pr fixes bug due to Webhooks PR [#9400](https://github.com/juspay/hyperswitch/pull/9400), causing all incoming webhooks to fail for merchant ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the </think> To implement this, you'll need to modify: (No detailed commit information available)
{"issue_number": 9400, "pr_number": 9894, "commits_count": 0, "files_changed": 2, "response_length": 779, "file_count": 0, "needs_breakdown": false}
[BUG] Logging sensitive information on deserialization failure ### Bug Description In `common_utils/src/ext_traits.rs` we are logging serde_json Values in plaintext when deserialization fails. This is a problem in cases where the JSON objects contain sensitive data. ### Expected Behavior Sensitive data is not logged. Values are logged after masking. ### Actual Behavior Sensitive information is logged. ### Steps To Reproduce Supply malformed data to the `parse_value` method in `ValueExt` trait. ### Context For The Bug _No response_ ### Environment Are you using hyperswitch hosted version? Yes ### Have you spent some time checking if this bug has been raised before? - [x] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes, I am willing to submit a PR!
<think> PR Context: - Title: fix(common_utils): Prevent logging sensitive information on deserialization failure - Merged: 2025-09-24T13:24:48Z - Files changed: 1 files - Commits: 6 commits Implementation approach: ## Description - Modified `parse_value` method in `ValueExt` trait to log the JSON object after masking on deserialization failure. - Modified `parse_struct` method in `BytesExt`, `ByteSliceExt` and `StringExt` to log values after converting them into a `serde_json::Value` and then masking ### A </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(common_utils): Prevent logging sensitive information on deserialization failure (#8970) Files to modify: **crates/common_utils/src/ext_traits.rs** Modify existing code
{"issue_number": 8969, "pr_number": 8970, "commits_count": 1, "files_changed": 1, "response_length": 991, "file_count": 3, "needs_breakdown": false}
[FEATURE]: [OpenNode] Currency Unit Conversion ### :memo: Feature Description - Each currency can be described in terms of base or minor units. - For instance, when dealing with USD currency, the Cent is considered as the minor unit, while the Dollar is considered the base unit. - In Hyperswitch, the amount value is expected to be always provided in minor units. - For example: In USD, If the amount is 1 in base unit (Dollar), then it will be equivalent to 100 in minor units (Cent) - Some of the connectors integrated require the amount to be converted to a desirable unit before being passed to them. - We have functions `to_currency_base_unit` and `to_currency_lower_unit` in place to convert the minor unit amount to its decimal equivalent and vice versa. These conversions are handled explicitly based on the connector. ### :hammer: Possible Implementation - ConnectorCommon trait have been implemented for the connector. - This trait contains `get_currency_unit` method. This method needs to be implemented. - It will define what type of conversion needs to be done during `connector_router_data` creation. Concurrently handle the creation of `connector_router_data` to be passed for the connector request body creation. - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/2196 :bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: feat(connector): [OpenNode] Currency Unit Conversion - Merged: 2023-10-27T11:36:08Z - Files changed: 2 files - Commits: 7 commits Implementation approach: ## Description - Addressing Issue: #2240 - Modified two files in `hyperswitch/crates/router/src/connector/` - `opennode.rs` - Implement `get_currency_unit` function - Modify `ConnectorIntegration` implementations for `Opennode` - `opennode/transformers.rs` - Implement `Opennod </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(connector): [OpenNode] Currency Unit Conversion (#2645) Files to modify: **crates/router/src/connector/opennode.rs** Add: - function: private::get_currency_unit **crates/router/src/connector/opennode/transformers.rs** Add: - function: private::try_from - struct: pub::OpennodeRouterData - impl: impl TryFrom<( &types::api::CurrencyUnit, types::storage::enums::Currency, i64, T, )> for OpennodeRouterData<T> **Commit 2:** feat(connector): [OpenNode] Currency Unit Conversion (#2645) Files to modify: **crates/router/src/connector/opennode.rs** Add: - function: private::get_currency_unit **crates/router/src/connector/opennode/transformers.rs** Add: - function: private::try_from - struct: pub::OpennodeRouterData - impl: impl TryFrom<( &types::api::CurrencyUnit, types::storage::enums::Currency, i64, T, )> for OpennodeRouterData<T>
{"issue_number": 2240, "pr_number": 2645, "commits_count": 2, "files_changed": 2, "response_length": 1741, "file_count": 7, "needs_breakdown": false}
ci(postman): refactor NMI postman collection ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [x] CI/CD ## Description <!-- Describe your changes in detail --> This PR aims at refactoring NMI collection by bringing it back to life. Added more flows to look after regressions. Closes #3734 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> We need to check for regressions. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Ran the collection: <img width="980" alt="image" src="https://github.com/juspay/hyperswitch/assets/69745008/9aaad0eb-a4d7-4735-9d8c-303d323fc915"> There is a bug in NMI connector which needs to be addressed. Created a separate collection to reproduce it. ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible - [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
<think> PR Context: - Title: refactor(test_utils): use json to run collection and add run time edit - Merged: 2024-03-04T08:13:36Z - Files changed: 30 files - Commits: 30 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR refactors test_utils crate's `newman_runner` to support dynamic values through postman variables. The main issue with `newman-dir` is that in order to export the collection, the variables must be of type string (Example: Variable </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(test_utils): use json to run collection and add run time edit (#3807) Co-authored-by: hyper Files to modify: **crates/test_utils/src/main.rs** Modify existing code **crates/test_utils/src/newman_runner.rs** Add: - function: private::get_collection_path - function: pub::check_connector_for_dynamic_amount - function: pub::remove_quotes_for_integer_values
{"issue_number": 3805, "pr_number": 3807, "commits_count": 1, "files_changed": 30, "response_length": 1187, "file_count": 4, "needs_breakdown": false}
feat(core): implemented platform merchant account ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [X] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description #### About the feature - This the first PR for the Platform Account feature. - Feature is under development and behind the feature flag. - Feature is supposed to be disabled for sandbox and production environments. #### Enabling the platform account. - New API has been created to enable platform account. - API requires Admin API auth. - Once enabled, there is no way of disabling platform account as of now. #### How it works - A new special header is to be sent by the platform called `x-connected-merchant-id`. - Platform will use its own API key irrespective of the merchant id present in the above header. - Value of this header is supposed to be the merchant id of the merchant account on behalf of which the platform is performing the operation. - **If the platform has `is_platform` true and the merchant account on behalf of which operation is performed belongs to the same organisation as platform** then the operation is allowed. #### Payment Intent - Operation will be performed for merchant id present in the `x-connected-merchant-id` header. - `platform_merchant_id` column for the payment intent will be populated with platforms merchant id. #### Other operations - Will add context of `platform_merchant_id` in other operations as well. <!-- Describe your changes in detail --> ### Additional Changes - [x] This PR modifies the API contract - [x] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context #6883 <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? 1. Create a merchant account(m1). 2. Use below api to convert it into platform account. ```sh curl --location --request POST '<BASE URL>/accounts/{merchant_id}/platform' \ --header 'api-key:<ADMIN API KEY>' ``` 3. Create another merchant account in the same organisation(m2). 4. Do a payment using platform's(m1) API key for connected merchant account(m2) by passing header `x-connected-merchant-id` with value as connected merchant account's merchant id. 5. Check if payment is created for connected merchant account. 6. Check if `platform_merchant_id` is populated with platform's merchant id. <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [X] I formatted the code `cargo +nightly fmt --all` - [X] I addressed lints thrown by `cargo clippy` - [X] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
<think> PR Context: - Title: refactor(payments): Add platform merchant account checks for payment intent - Merged: 2025-02-14T10:05:46Z - Files changed: 21 files - Commits: 7 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Currently payment_intent stores platform_merchant_id. This can be used to identify if the payment was created by platform merchant. If the payment was initialized by platform merchant, the merchant who is the owner of the payment should not </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(payments): Add platform merchant account checks for payment intent (#7204) Files to modify: **crates/router/src/core/payments/operations/payment_approve.rs** Modify existing code **crates/router/src/core/payments/operations/payment_cancel.rs** Modify existing code **crates/router/src/core/payments/operations/payment_capture.rs** Modify existing code **crates/router/src/core/payments/operations/payment_capture_v2.rs** Modify existing code **crates/router/src/core/payments/operations/payment_complete_authorize.rs** Modify existing code **crates/router/src/core/payments/operations/payment_confirm.rs** Modify existing code **crates/router/src/core/payments/operations/payment_confirm_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payment_get.rs** Modify existing code **crates/router/src/core/payments/operations/payment_get_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payment_post_session_tokens.rs** Modify existing code **crates/router/src/core/payments/operations/payment_reject.rs** Modify existing code **crates/router/src/core/payments/operations/payment_session.rs** Modify existing code **crates/router/src/core/payments/operations/payment_session_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payment_start.rs** Modify existing code **crates/router/src/core/payments/operations/payment_status.rs** Modify existing code **crates/router/src/core/payments/operations/payment_update.rs** Modify existing code **crates/router/src/core/payments/operations/payment_update_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payments_incremental_authorization.rs** Modify existing code **crates/router/src/core/payments/operations/tax_calculation.rs** Modify existing code **crates/router/src/core/utils.rs** Add: - function: private::validate_platform_merchant - function: private::get_platform_merchant_id - trait: pub::ValidatePlatformMerchant - impl: impl ValidatePlatformMerchant for storage::PaymentIntent **crates/router/src/routes/payment_methods.rs** Modify existing code
{"issue_number": 6882, "pr_number": 7204, "commits_count": 1, "files_changed": 21, "response_length": 3008, "file_count": 23, "needs_breakdown": true}
[FEATURE]: add support for three letter and numeric country codes ### Feature Description We are currently using two_letter country codes internally since majority of connectors accept only two_letter codes, there may arise a situation where some connector will accept only three_letter country codes or numeric codes. There is a complete list of the mapping https://www.nationsonline.org/oneworld/country_code_list.htm. ### Possible Implementation We can have an enum `Country` which will be the actual country name and then provide mapping to two_letter, three_letter codes and even numeric_codes. All the variants map to same enum `Country`. This can be achieved by implementing a custom serializer and deserializer as shown above. ```rust #[derive(Clone, Copy, Debug)] pub enum Country { Afghanistan, Albania, // ... } #[derive(Clone, Copy, Debug)] pub enum Alpha2CountryCode { AF, AL, // ... } impl Country { // Note the `const`. Similar implementation for `to_alpha2(&self)`. pub const fn from_alpha2(code: Alpha2CountryCode) -> Self { match code { Alpha2CountryCode::AF => Self::Afghanistan, Alpha2CountryCode::AL => Self::Albania, // ... } } } mod custom_serde { use super::*; pub mod alpha2_country_code { use super::*; pub fn serialize<S>(code: &Country, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer, { // Serialize country as Alpha-2 code Err(serde::ser::Error::custom("not implemented")) } pub fn deserialize<'a, D>(deserializer: D) -> Result<Country, D::Error> where D: serde::Deserializer<'a>, { // Deserialize Alpha-2 code from string, then convert to country enum Err(serde::de::Error::custom("not implemented")) } } } #[derive(serde::Deserialize, serde::Serialize)] struct Address { #[serde(with = "custom_serde::alpha2_country_code")] country: Country, } ``` ### Have you spent some time to check if this feature request has been raised before? - [X] I checked and didn't find similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? No, but I'm happy to collaborate on a PR with someone else
<think> PR Context: - Title: feat: allow (de)serializing countries to/from alpha-2, alpha-3 and numeric country codes - Merged: 2023-04-06T13:58:01Z - Files changed: 4 files - Commits: 19 commits Implementation approach: ## Description fixes #804 ### Additional Changes - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/ </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat: allow (de)serializing countries to/from alpha-2, alpha-3 and numeric country codes (#836) Co-a Files to modify: **crates/common_enums/src/enums.rs** Add: - function: private::fmt - function: pub::from_alpha2 - function: pub::to_alpha2 - function: pub::from_alpha3 - function: pub::to_alpha3 - function: pub::from_numeric - function: pub::to_numeric - function: pub::serialize - function: private::expecting - function: pub::deserialize - function: pub::serialize - function: private::expecting - function: pub::deserialize - function: pub::serialize - function: private::expecting - function: pub::deserialize - function: private::test_serialize_alpha2 - function: private::test_serialize_alpha3 - function: private::test_serialize_numeric - function: private::test_deserialize_alpha2 - function: private::test_deserialize_alpha3 - function: private::test_deserialize_numeric - function: private::test_deserialize_and_serialize - function: private::test_serialize_and_deserialize - function: private::test_deserialize_invalid_country_code - struct: pub::NumericCountryCodeParseError - struct: private::FieldVisitor - struct: private::FieldVisitor - struct: private::FieldVisitor - struct: private::Alpha2Request - struct: private::Alpha3Request - struct: private::NumericRequest - struct: private::HyperswitchRequestAlpha2 - struct: private::HyperswitchRequestAlpha3 - struct: private::HyperswitchRequestNumeric - enum: pub::CountryAlpha2 - enum: pub::CountryAlpha3 - enum: pub::Country - impl: impl Display for NumericCountryCodeParseError - impl: impl Country - impl: impl Visitor<'de> for FieldVisitor - impl: impl Visitor<'de> for FieldVisitor - impl: impl Visitor<'de> for FieldVisitor - mod: private::custom_serde - mod: pub::alpha2_country_code - mod: pub::alpha3_country_code - mod: pub::numeric_country_code - mod: private::tests
{"issue_number": 804, "pr_number": 836, "commits_count": 1, "files_changed": 4, "response_length": 2862, "file_count": 3, "needs_breakdown": false}
[BUG] Unclear Database error messages ### Bug Description Any database errors are reported as ``` DatabaseError: An unknown error occurred ``` These do not give any info over the type of errors that could exist, this leads to longer debug times for the most trivial/simplistic errors. Partly this seems to be some limitation of the diesel library itself... ### Expected Behavior We should get more descriptive errors that help us to debug, some examples could be - Permission error - table does not exist - syntax error (diesel schema does not match table) ..... ### Actual Behavior Any database errors are reported as ``` DatabaseError: An unknown error occurred ``` ### Steps To Reproduce N/A ### Context For The Bug N/A ### Environment N/A ### Have you spent some time to check if this bug has been raised before? - [X] I checked and didn't find similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? None
<think> PR Context: - Title: fix(errors): use `Debug` impl instead of `Display` for error types wrapping `error_stack::Report` - Merged: 2023-03-05T15:54:30Z - Files changed: 9 files - Commits: 3 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR uses the `Debug` implementation instead of `Display` implementation for printing error types which wrap around `error_stack::Report`. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(errors): use `Debug` impl instead of `Display` for error types wrapping `error_stack::Report` (# Files to modify: **crates/drainer/src/errors.rs** Modify existing code **crates/router/src/core/errors.rs** Modify existing code
{"issue_number": 626, "pr_number": 714, "commits_count": 1, "files_changed": 9, "response_length": 1066, "file_count": 4, "needs_breakdown": false}
fix(router): Move Customer PML endpoint to OLAP (v2) [This PR](https://github.com/juspay/hyperswitch/pull/7241) added customer PML for v2, but the route was incorrectly added under OLTP instead of OLAP, need to fix
<think> PR Context: - Title: fix(router): Move Customer PML endpoint to OLAP (v2) - Merged: 2025-06-18T08:23:04Z - Files changed: 1 files - Commits: 2 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Moved customer saved PML route to OLAP in v2 ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Prov </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(router): Move Customer PML endpoint to OLAP (v2) (#8303) Files to modify: **crates/router/src/routes/app.rs** Modify existing code
{"issue_number": 8302, "pr_number": 8303, "commits_count": 1, "files_changed": 1, "response_length": 923, "file_count": 3, "needs_breakdown": false}
fix(payments): remove time range filter from payment attempt hotfix Corresponding issue: https://github.com/juspay/hyperswitch/issues/6160
<think> PR Context: - Title: fix(payments_list): remove time range to filter payments attempts - Merged: 2024-09-30T16:59:32Z - Files changed: 6 files - Commits: 1 commits Implementation approach: ## Description Corresponding main branch PR: #6159 Currently created_at is not indexed in payment attempt table, when applying filtering with active attempt ids. We are adding extra overhead of checking time_range, though we need not to as we will be already getting filtered attempt ids from inte </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(payments_list): remove time range to filter payments attempts (#6162) Files to modify: **crates/diesel_models/src/query/payment_attempt.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/db/kafka_store.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_attempt.rs** Modify existing code **crates/storage_impl/src/payments/payment_attempt.rs** Modify existing code
{"issue_number": 6163, "pr_number": 6162, "commits_count": 1, "files_changed": 6, "response_length": 1346, "file_count": 8, "needs_breakdown": false}
Add audit events for CompleteAuthorize update Created from #4525 This covers adding events for Complete Authorize operation This event should include the payment data similar to [PaymentCancel](https://github.com/juspay/hyperswitch/pull/4166) It should also include any metadata for the event e.g reason for payment rejection, error codes, rejection source etc ### Submission Process: - Ask the maintainers for assignment of the issue, you can request for assignment by commenting on the issue itself. - Once assigned, submit a pull request (PR). - Maintainers will review and provide feedback, if any. - Maintainers can unassign issues due to inactivity, [read more here](https://github.com/juspay/hyperswitch/wiki/Hacktoberfest-Contribution-Rules). Refer [here](https://github.com/juspay/hyperswitch/blob/main/docs/TERMS_OF_CONTEST.md) for Terms and conditions for the contest.
<think> PR Context: - Title: feat(events): add audit event for CompleteAuthorize - Merged: 2024-12-05T07:46:26Z - Files changed: 2 files - Commits: 4 commits Implementation approach: ## Description Created from #4674 This covers adding events for `CompleteAuthorize` operation ## How did you test it Use `globalpay` as connector, `wallet` as payment_method and `paypal` as payment_method_type ```bash "payment_method": "wallet", "payment_method_types": [ { </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(events): add audit event for CompleteAuthorize (#6310) Co-authored-by: Sandeep Kumar <83278309+ Files to modify: **crates/router/src/core/payments/operations/payment_complete_authorize.rs** Modify existing code **crates/router/src/events/audit_events.rs** Modify existing code
{"issue_number": 4674, "pr_number": 6310, "commits_count": 1, "files_changed": 2, "response_length": 1072, "file_count": 4, "needs_breakdown": false}
[BUG] : [Cybersource] Mandate creation condition ### Bug Description Currently mandate gets created if `mandate_data` is passed in the request which is deprecated ### Expected Behavior Create mandate with connector if setup_future_usgae: off_session and customer_acceptance is present ### Actual Behavior Currently mandate gets created if `mandate_data` is passed in the request which is deprecated ### Steps To Reproduce Provide an unambiguous set of steps to reproduce this bug. Include code or configuration to reproduce, if relevant. 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' ### Context For The Bug _No response_ ### Environment Are you using hyperswitch hosted version? Yes/No If yes, please provide the value of the `x-request-id` response header to help us debug your issue. If not (or if building/running locally), please provide the following details: 1. Operating System or Linux distribution: 2. Rust version (output of `rustc --version`): `` 3. App version (output of `cargo r --features vergen -- --version`): `` ### Have you spent some time checking if this bug has been raised before? - [X] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes, I am willing to submit a PR!
<think> PR Context: - Title: fix(connector): [cybersource] update mandate condition - Merged: 2024-03-13T08:24:58Z - Files changed: 1 files - Commits: 1 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Create mandate with connector if `setup_future_usgae: off_session` and `customer_acceptance` is present. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies a </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(connector): [cybersource] update mandate condition (#4048) Files to modify: **crates/router/src/connector/cybersource/transformers.rs** Modify existing code
{"issue_number": 4049, "pr_number": 4048, "commits_count": 1, "files_changed": 1, "response_length": 951, "file_count": 3, "needs_breakdown": false}
feat(connector): implement pre auth flow for gpayments ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> implement pre auth flow for gpayments ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Manual. 1. Create a merchant with checkout payment connector and gpayments authentication connector. ``` curl --location 'http://localhost:8080/account/postman_merchant_GHAction_184925e6-5bcf-48b7-9863-faa5f74ff0a5/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "fiz_operations", "connector_name": "checkout", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "", "api_secret": "", "key1": "" }, "test_mode": false, "disabled": false, "business_country": "US", "business_label": "default", "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "paypal", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": false, "installment_payment_enabled": false } ] } ], "metadata": { "acquirer_bin": "438309", "acquirer_merchant_id": "00002000000", "city": "NY", "unit": "245" } }' ``` ``` curl --location 'http://localhost:8080/account/postman_merchant_GHAction_184925e6-5bcf-48b7-9863-faa5f74ff0a5/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "authentication_processor", "business_country": "US", "business_label": "default", "connector_name": "gpayments", "connector_account_details": { "auth_type": "CertificateAuth", "certificate": "", "private_key": "=" }, "test_mode": true, "disabled": false, "metadata": { "mcc": "5411", "merchant_country_code": "840", "merchant_name": "Dummy Merchant", "endpoint_prefix": "hyperswitch", "merchant_id": "123456789012345", "three_ds_requestor_name": "juspay-prev", "three_ds_requestor_id": "juspay-prev" } }' ``` 2. Create a payment with "request_external_three_ds_authentication": true, ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_uUxE0Jyfdziw9ZvBoF7NxH06M0ny7P3gtCJXFTbC9GSXWx1KqYgMlQsLr9q0HYHg' \ --data-raw '{ "amount": 6540, "currency": "USD", "confirm": false, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "StripeCustomer", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://duck.com", "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX" }, "phone": { "number": "123456789", "country_code": "12" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX" }, "phone": { "number": "123456789", "country_code": "12" } }, "request_external_three_ds_authentication": true, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` 3. Confirm the payment (should get `three_ds_invoke` as next action type). ``` curl --location 'http://localhost:8080/payments/pay_gw37bOcJ8d0SmUSjEW3G/confirm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_27c2226e51514a1ca1f0842bee794ef1' \ --data '{ "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "115.99.183.2" }, "client_secret": "pay_gw37bOcJ8d0SmUSjEW3G_secret_DFfmbty5pCaoht5JsI1C", "payment_method": "card", "payment_method_data": { "card": { "card_number": "4100000000600008", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "123" } } }' ``` Should get `three_ds_method_invode` as next action type in payment respone. And status should be `requires_customer_action`. Payment response should look like this ``` { "payment_id": "pay_jiO1tY3EV90hebt2qckE", "merchant_id": "postman_merchant_GHAction_e0414c14-fe48-49e6-8f45-8e28f5a2eb32", "status": "requires_customer_action", "amount": 6540, "net_amount": 6540, "amount_capturable": 6540, "amount_received": null, "connector": "checkout", "client_secret": "pay_jiO1tY3EV90hebt2qckE_secret_QrR1Yhdq9JOF57dIY6x0", "created": "2024-05-29T13:00:22.147Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": null, "payment_method_data": null, "payment_token": "token_bTfzD6IO8dmhCrGgXa4b", "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "PiX", "last_name": null }, "phone": { "number": "123456789", "country_code": "12" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "PiX", "last_name": null }, "phone": { "number": "123456789", "country_code": "12" }, "email": null }, "order_details": null, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": { "type": "three_ds_invoke", "three_ds_data": { "three_ds_authentication_url": "http://localhost:8080/payments/pay_jiO1tY3EV90hebt2qckE/3ds/authentication", "three_ds_authorize_url": "http://localhost:8080/payments/pay_jiO1tY3EV90hebt2qckE/postman_merchant_GHAction_e0414c14-fe48-49e6-8f45-8e28f5a2eb32/authorize/checkout", "three_ds_method_details": { "three_ds_method_key": "threeDSMethodData", "three_ds_method_data_submission": true, "three_ds_method_data": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjY5ZmJjNWExLTlmNGYtNGI4Ny1iMjA5LTM2YzkyZDBlYWIxNyIsInRocmVlRFNNZXRob2ROb3RpZmljYXRpb25VUkwiOiJodHRwczovL3dlYmhvb2suc2l0ZS9iZDA2ODYzZC04MmMyLTQyZWEtYjM1Yi01ZmZkNWVjZWNlNzEifQ==", "three_ds_method_url": "https://acs-challenge.testlab.3dsecure.cloud/acs/tdsmethodaction" }, "poll_config": { "poll_id": "external_authentication_pay_jiO1tY3EV90hebt2qckE", "delay_in_secs": 2, "frequency": 5 }, "message_version": "2.2.0", "directory_server_id": null } }, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": null, "connector_transaction_id": null, "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_jnTRVUadt7vdxhdC4DSk", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_0NshOYlui5L4igYEZj5c", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": { "authentication_flow": null, "electronic_commerce_indicator": null, "status": "started", "ds_transaction_id": "69fbc5a1-9f4f-4b87-b209-36c92d0eab17", "version": "2.2.0", "error_code": null, "error_message": null }, "external_3ds_authentication_attempted": true, "expires_on": "2024-05-29T13:15:22.147Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "115.99.183.2", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2024-05-29T13:00:27.790Z", "charges": null, "frm_metadata": null } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
<think> PR Context: - Title: refactor(payment_methods): add Wallets payment method data to new domain type to be used in connector module - Merged: 2024-04-03T13:01:24Z - Files changed: 30 files - Commits: 29 commits Implementation approach: ## Description fixes[ #4692](https://github.com/juspay/hyperswitch-cloud/issues/4692) We need to have separate types for api model and domain, currently we are using the api type in application as well. This PR add a new domain type for `Wallet` payment_method_data to be used everywhere in the app </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(payment_methods): add Wallets payment method data to new domain type to be used in connecto Files to modify: **crates/router/src/connector/aci/transformers.rs** Modify existing code **crates/router/src/connector/adyen/transformers.rs** Modify existing code **crates/router/src/connector/airwallex/transformers.rs** Modify existing code **crates/router/src/connector/authorizedotnet/transformers.rs** Modify existing code **crates/router/src/connector/bankofamerica/transformers.rs** Remove: - impl: impl TryFrom<(&types::SetupMandateRouterData, payments::ApplePayWalletData)> Add: - impl: impl TryFrom<(&types::SetupMandateRouterData, domain::ApplePayWalletData)> **crates/router/src/connector/bluesnap/transformers.rs** Modify existing code **crates/router/src/connector/boku/transformers.rs** Remove: - impl: impl TryFrom<(&types::PaymentsAuthorizeRouterData, &api::WalletData)> for api_models::payments::WalletData::MomoRedirect Add: - impl: impl TryFrom<(&types::PaymentsAuthorizeRouterData, &domain::WalletData)> for domain::WalletData::MomoRedirect **crates/router/src/connector/braintree/transformers.rs** Modify existing code **crates/router/src/connector/checkout/transformers.rs** Modify existing code **crates/router/src/connector/cybersource/transformers.rs** Modify existing code **crates/router/src/connector/dummyconnector/transformers.rs** Modify existing code **crates/router/src/connector/globalpay/transformers.rs** Modify existing code **crates/router/src/connector/globepay/transformers.rs** Modify existing code **crates/router/src/connector/mollie/transformers.rs** Modify existing code **crates/router/src/connector/multisafepay/transformers.rs** Modify existing code **crates/router/src/connector/nexinets/transformers.rs** Modify existing code **crates/router/src/connector/nmi/transformers.rs** Modify existing code **crates/router/src/connector/noon/transformers.rs** Modify existing code **crates/router/src/connector/nuvei/transformers.rs** Modify existing code **crates/router/src/connector/payme/transformers.rs** Modify existing code **crates/router/src/connector/paypal/transformers.rs** Modify existing code **crates/router/src/connector/payu/transformers.rs** Modify existing code **crates/router/src/connector/rapyd/transformers.rs** Modify existing code **crates/router/src/connector/shift4/transformers.rs** Modify existing code **crates/router/src/connector/square/transformers.rs** Modify existing code **crates/router/src/connector/stripe/transformers.rs** Remove: - impl: impl TryFrom<(&payments::WalletData, Option<types::PaymentMethodToken>)> for StripePaymentMethodData Add: - impl: impl TryFrom<(&domain::WalletData, Option<types::PaymentMethodToken>)> for StripePaymentMethodData **crates/router/src/connector/utils.rs** Modify existing code **crates/router/src/connector/worldpay/transformers.rs** Modify existing code **crates/router/src/connector/zen/transformers.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/types/domain/payments.rs** Add: - function: private::from - function: private::from - function: private::from - impl: impl From<api_models::payments::WalletData> for WalletData - impl: impl From<api_models::payments::GooglePayWalletData> for GooglePayWalletData - impl: impl From<api_models::payments::ApplePayWalletData> for ApplePayWalletData **crates/router/tests/connectors/payu.rs** Modify existing code **crates/router/tests/connectors/worldpay.rs** Modify existing code
{"issue_number": 4692, "pr_number": 4160, "commits_count": 1, "files_changed": 30, "response_length": 4574, "file_count": 36, "needs_breakdown": true}
[BUG] update `api_key_expiry_workflow` to validate the expiry before scheduling the task ### Bug Description We have a `process_tracker` which schedules the task to future date, and executes it whenever the time is up. We have a feature to schedule a reminder email to notify the merchants when their api_key is about to expire. Currently, when the api_key is created with some expiry set, process tracker schedules the 1st email, 7 days prior to api_key expiry. But just in case merchant sets the expiry to next day, process tracker will schedule the email to past day which won't be executed by process tracker. ### Expected Behavior During the api_key expiry if the merchant sets the expiry to next day or any other day before 7 days, we need to perform a validation something like - calculate the schedule_time of 1st email during api_key creation. if it is before the current_time, don't create an entry in process_tracker. file to include the change - https://github.com/juspay/hyperswitch/blob/e913bfc4958da613cd352eca9bc38b23ab7ac38e/crates/router/src/core/api_keys.rs#L193C1-L193C1 ### Steps To Reproduce 1. Run below commands in 3 diff terminals - cargo r --features email (application) - SCHEDULER_FLOW=producer cargo r --bin scheduler (producer binary) - SCHEDULER_FLOW=consumer cargo r --bin scheduler (consumer binary) 2. Create an api_key with expiry set to next day in postman. 3. Check the process_tracker table in db which will contain the schedule_time field set to past day. ### Context For The Bug Just to cover the edge case ### Have you spent some time to check if this bug has been raised before? - [X] I checked and didn't find similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? No, but I'm happy to collaborate on a PR with someone else
<think> PR Context: - Title: fix(router): validate schedule time before scheduling API key expiry reminder - Merged: 2023-07-24T18:44:21Z - Files changed: 1 files - Commits: 3 commits Implementation approach: ## Description During the api_key expiry if the merchant sets the expiry to next day or any other day before 7 days, we need to perform a validation something like - calculate the schedule_time of 1st email during api_key creation. if it is before the current_time, don't create an entry in process_t </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** fix(router): validate schedule time before scheduling API key expiry reminder (#1776) Co-authored-by Files to modify: **crates/router/src/core/api_keys.rs** Modify existing code
{"issue_number": 1625, "pr_number": 1776, "commits_count": 1, "files_changed": 1, "response_length": 991, "file_count": 3, "needs_breakdown": false}
[FEATURE] Allow rotating and revoking API keys ### Feature Description As of now, the `merchant_account` table has an `api_key` field which restricts a merchant account to only have one API key. Furthermore, there are no mechanisms in place to revoke and regenerate API keys. To improve the convenience of rotating and revoking API keys, it'd be better to allow multiple API keys to be associated with a merchant account. Furthermore, API keys are stored in plaintext as of now. It'd be great if they could be hashed as well, when this request is addressed. ### Possible Implementation A possible approach to address this is to add an `api_keys` table with `name`, `merchant_id`, `hashed_key` fields (including any additional fields as necessary). And for the API interface, this could include endpoints to create, retrieve, update and revoke an API key, and an endpoint to list all API keys associated with the current merchant account. ### Have you spent some time to check if this feature request has been raised before? - [X] I checked and didn't find similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes I am willing to submit a PR!
<think> PR Context: - Title: feat(generics): allow specifying optional offset and order clauses for `generic_filter()` - Merged: 2023-02-06T12:23:38Z - Files changed: 7 files - Commits: 4 commits Implementation approach: ## Description <!-- Describe your changes in detail --> This PR updates the `generic_filter()` function to accept an optional `offset` parameter. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(generics): allow specifying optional offset and order clauses for `generic_filter()` (#502) Files to modify: **crates/storage_models/src/query/generics.rs** Modify existing code **crates/storage_models/src/query/mandate.rs** Modify existing code **crates/storage_models/src/query/merchant_connector_account.rs** Modify existing code **crates/storage_models/src/query/payment_attempt.rs** Modify existing code **crates/storage_models/src/query/payment_method.rs** Modify existing code **crates/storage_models/src/query/process_tracker.rs** Modify existing code **crates/storage_models/src/query/refund.rs** Modify existing code
{"issue_number": 501, "pr_number": 502, "commits_count": 1, "files_changed": 7, "response_length": 1475, "file_count": 9, "needs_breakdown": false}
[FEATURE] Analytics for payouts ### Feature Description **APIs** There is no provision for listing / filtering payout transactions processed via HyperSwitch. This needs to be implemented for analytical processing for payouts. - List API helps in listing payouts based on generic constraints - Filter API helps in filtering payouts based on payout specific filters **Dashboard Analytics** There are two tables for core payout operations - payouts - payout_attempt The information regarding payouts and the attempts are stored in respective tables. For fetching all the information, there needs to be 2 DB calls for gathering entire context. As of writing this issue, Hyperswitch's dashboard can read data only from a single table in CKH. As a temporary measure, all the required fields are to be moved to a single table. ### Possible Implementation List API to include below constraints (similar to payments) - customer_id - starting_after - ending_before - limit - created - created_lt - created_gt - created_lte - created_gte Filter API to include below filters - payout_id - profile_id - customer_id - limit - offset - time_range - connector - currency - status - payout_method - entity_type Below columns are to be added in `payout_attempt` - payout_type - amount - destination_currency - source_currency - recurring - entity_type ### Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### Are you willing to submit a PR? Yes, I am willing to submit a PR!
<think> PR Context: - Title: feat(payouts): implement list and filter APIs - Merged: 2024-03-21T09:11:03Z - Files changed: 26 files - Commits: 30 commits Implementation approach: ## Description Explained in issue - #3652 ### Additional Changes - [x] This PR modifies the API contract - [x] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Fol </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feat(payouts): implement list and filter APIs (#3651) Co-authored-by: hyperswitch-bot[bot] <14852550 Files to modify: **crates/api_models/src/events/payouts.rs** Add: - function: private::get_api_event_type - function: private::get_api_event_type - function: private::get_api_event_type - function: private::get_api_event_type - impl: impl ApiEventMetric for PayoutListConstraints - impl: impl ApiEventMetric for PayoutListFilterConstraints - impl: impl ApiEventMetric for PayoutListResponse - impl: impl ApiEventMetric for PayoutListFilters **crates/api_models/src/payments.rs** Remove: - function: private::default_limit **crates/api_models/src/payouts.rs** Add: - struct: pub::PayoutAttemptResponse - struct: pub::PayoutListFilterConstraints - struct: pub::PayoutListResponse - struct: pub::PayoutListFilters **crates/common_enums/src/enums.rs** Modify existing code **crates/common_utils/src/consts.rs** Add: - function: pub::default_payments_list_limit - function: pub::default_payouts_list_limit **crates/data_models/src/payouts.rs** Add: - function: private::from - function: private::from - function: private::from - struct: pub::PayoutListParams - enum: pub::PayoutFetchConstraints - impl: impl From<api_models::payouts::PayoutListConstraints> for PayoutFetchConstraints - impl: impl From<api_models::payments::TimeRange> for PayoutFetchConstraints - impl: impl From<api_models::payouts::PayoutListFilterConstraints> for PayoutFetchConstraints **crates/data_models/src/payouts/payout_attempt.rs** Add: - struct: pub::PayoutListFilters **crates/data_models/src/payouts/payouts.rs** Modify existing code **crates/diesel_models/src/query/payout_attempt.rs** Add: - function: pub::get_filters_for_payouts **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/routes/payouts.rs** Add: - function: pub::payouts_list - function: pub::payouts_filter **crates/router/src/core/payments/transformers.rs** Add: - function: private::foreign_from - impl: impl ForeignFrom<(storage::Payouts, storage::PayoutAttempt)> for api::PayoutCreateResponse **crates/router/src/core/payouts.rs** Add: - function: pub::payouts_list_core - function: pub::payouts_filtered_list_core - function: pub::payouts_list_available_filters_core **crates/router/src/core/payouts/helpers.rs** Add: - function: pub::filter_by_constraints **crates/router/src/core/payouts/validator.rs** Add: - function: pub::validate_payout_list_request - function: pub::validate_payout_list_request_for_joins **crates/router/src/db/kafka_store.rs** Add: - function: private::get_filters_for_payouts - function: private::filter_payouts_by_constraints - function: private::filter_payouts_and_attempts - function: private::filter_payouts_by_time_range_constraints **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/routes/payouts.rs** Add: - function: pub::payouts_list - function: pub::payouts_list_by_filter - function: pub::payouts_list_available_filters **crates/router/src/types/api/payouts.rs** Modify existing code **crates/router_env/src/logger/types.rs** Modify existing code **crates/storage_impl/src/mock_db/payout_attempt.rs** Add: - function: private::get_filters_for_payouts **crates/storage_impl/src/mock_db/payouts.rs** Add: - function: private::filter_payouts_by_constraints - function: private::filter_payouts_and_attempts - function: private::filter_payouts_by_time_range_constraints **crates/storage_impl/src/payouts/payout_attempt.rs** Add: - function: private::get_filters_for_payouts - function: private::get_filters_for_payouts **crates/storage_impl/src/payouts/payouts.rs** Add: - function: private::filter_payouts_by_constraints - function: private::filter_payouts_and_attempts - function: private::filter_payouts_by_time_range_constraints - function: private::filter_payouts_by_constraints - function: private::filter_payouts_and_attempts - function: private::filter_payouts_by_time_range_constraints
{"issue_number": 3652, "pr_number": 3651, "commits_count": 1, "files_changed": 26, "response_length": 5060, "file_count": 27, "needs_breakdown": true}
[REFACTOR]: [Forte] Remove Default Case Handling ### :memo: Feature Description - We utilize match statements to make pivotal decisions, such as generating requests based on the payment method type and managing responses received from the connector. - These conditions generally go hand in hand with enum variants. - Default case is used because a match statement needs to be exhaustive i.e. every variant needs to be covered. - So, if all the explicit cases are handled then default is used to handle the rest. - Each connector have these match statements but many of them don’t provide reference to each variant in their default case, rather a `_` is put to handle all the other cases. - This approach carries a risk because developers may inadvertently overlook the need for explicit handling of the new cases. ### :hammer: Possible Implementation - Instead of relying on a default match case `_`, developers should handle each and every variant explicitly. - By doing so, if there are any changes in the future, they can readily assess the impact of their modifications simply by compiling the code. - You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/1955 :bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/` ### :package: Have you spent some time checking if this feature request has been raised before? - [X] I checked and didn't find a similar issue ### :package: Have you read the Contributing Guidelines? - [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) ### :sparkles: Are you willing to submit a PR?
<think> PR Context: - Title: refactor(connector): [Forte] Remove Default Case Handling - Merged: 2023-10-19T14:15:52Z - Files changed: 1 files - Commits: 6 commits Implementation approach: ## Description - Addresses Issue #2270 - Modified `crates/router/src/connector/forte/transformers.rs` - Convert `NotImplemented` to `NotSupported` in default case ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR mo </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** refactor(connector): [Forte] Remove Default Case Handling (#2625) Files to modify: **crates/router/src/connector/forte/transformers.rs** Modify existing code
{"issue_number": 2270, "pr_number": 2625, "commits_count": 1, "files_changed": 1, "response_length": 951, "file_count": 3, "needs_breakdown": false}
Add Worldline for card payments
<think> PR Context: - Title: feature(connector): add capture flow support for worldline - Merged: 2023-01-18T11:14:30Z - Files changed: 11 files - Commits: 8 commits Implementation approach: ## Description <!-- Describe your changes in detail --> Add support for capture flow in worldline connector Payment Method: card ### Additional Changes - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding cha </think> To implement this, you'll need to modify: **Detailed Implementation:** **Commit 1:** feature(connector): add capture flow support for worldline (#399) Files to modify: **crates/router/src/connector/worldline.rs** Remove: - function: private::get_content_type - function: private::get_content_type Add: - function: private::build_headers - function: private::get_http_method - function: private::get_content_type - function: private::get_headers - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - impl: impl ConnectorCommonExt<Flow, Request, Response> for Worldline **crates/router/src/connector/worldline/transformers.rs** Remove: - function: private::from - impl: impl From<PaymentStatus> for enums::AttemptStatus **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/types.rs** Modify existing code **crates/router/tests/connectors/cybersource.rs** Modify existing code **crates/router/tests/connectors/globalpay.rs** Modify existing code **crates/router/tests/connectors/payu.rs** Modify existing code **crates/router/tests/connectors/utils.rs** Modify existing code **crates/router/tests/connectors/worldline.rs** Modify existing code **crates/router/tests/connectors/worldpay.rs** Modify existing code
{"issue_number": 233, "pr_number": 399, "commits_count": 1, "files_changed": 11, "response_length": 2171, "file_count": 12, "needs_breakdown": false}