hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

feat(connector): [nordea] sepa bank debit

Open pixincreate opened this issue 7 months ago • 1 comments

Type of Change

  • [ ] Bugfix
  • [x] New feature
  • [ ] Enhancement
  • [ ] Refactoring
  • [ ] Dependency updates
  • [ ] Documentation
  • [ ] CI/CD

Description

This PR introduces SEPA Bank Debit targeting Payments API SEPA Credit Transfer in Nordea.

There are a few bottle necks that does not allow this connector from working (as of 20250525):

  • Connector requires access_token to make a payment. Getting access_token is a 2 step process which Hyperswitch core does not allow at present.
    • Initial call has to be made to /authorize end point to get a code (this is single use long-lived token)
    • Second call has to be made to /authorize/token end point by passing code to get the access_token and refresh_token where access_token is short lived and expires every 3600 seconds (every hour) while refresh_token is a single-use long-lived token
    • Once code is used to get access_token and refresh_token it is no longer needed
    • refresh_token is used to get access_token every time it expires
  • /personal/v4/payments/sepa was deprecated on 20250525 and /personal/v5/payments/sepa-credit-transfer(s) (it is still not clear in the doc)
    • Payments via Sepa credit transfer is again a 2 step process where /sepa-credit-transfer(s) returns PendingConfirmation as payment status which requires TPP (us) to make another call to /payments/sepa-credit-transfer(s)/confirm endpoint that returns a response with a link having signing as reference with a redirect url to complete the transaction

Other than that, below are not supported by the connector:

  • Manual Capture
  • Refunds
  • Webhooks

Additional Changes

  • [ ] This PR modifies the API contract
  • [ ] This PR modifies the database schema
  • [ ] This PR modifies application configuration/environment variables

Motivation and Context

New connector Nordea SEPA integration. Closes #8134.

How did you test it?

  • Cannot be tested due to above mentioned limitations.
  • Connector's Postman collection as well as their API console constantly throw invalid digest error

Checklist

  • [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

coderabbit:

@coderabbitai ignore

pixincreate avatar May 25 '25 16:05 pixincreate

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payments/flows/approve_flow.rs  98% smaller
  crates/router/src/core/payments/flows/authorize_flow.rs  98% smaller
  crates/router/src/core/payments/flows/cancel_flow.rs  98% smaller
  crates/router/src/core/payments/flows/cancel_post_capture_flow.rs  98% smaller
  crates/router/src/core/payments/flows/capture_flow.rs  98% smaller
  crates/router/src/core/payments/flows/complete_authorize_flow.rs  98% smaller
  crates/router/src/core/payments/flows/incremental_authorization_flow.rs  98% smaller
  crates/router/src/core/payments/flows/post_session_tokens_flow.rs  98% smaller
  crates/router/src/core/payments/flows/psync_flow.rs  98% smaller
  crates/router/src/core/payments/flows/reject_flow.rs  98% smaller
  crates/router/src/core/payments/flows/session_flow.rs  98% smaller
  crates/router/src/core/payments/flows/session_update_flow.rs  98% smaller
  crates/router/src/core/payments/flows/setup_mandate_flow.rs  98% smaller
  crates/router/src/core/payments/flows/update_metadata_flow.rs  98% smaller
  crates/hyperswitch_domain_models/src/router_data_v2.rs  86% smaller
  crates/router/src/types/api.rs  82% smaller
  crates/router/src/core/payments.rs  75% smaller
  crates/hyperswitch_domain_models/src/types.rs  72% smaller
  crates/hyperswitch_interfaces/src/api.rs  32% smaller
  crates/hyperswitch_interfaces/src/types.rs  30% smaller
  crates/hyperswitch_connectors/src/default_implementations.rs  29% smaller
  crates/router/src/types.rs  25% smaller
  crates/hyperswitch_interfaces/src/connector_integration_v2.rs  22% smaller
  crates/hyperswitch_connectors/src/connectors/nordea.rs  14% smaller
  crates/hyperswitch_connectors/src/connectors/nordea/transformers.rs  9% smaller
  crates/hyperswitch_connectors/src/default_implementations_v2.rs  8% smaller
  crates/router/src/core/payments/access_token.rs  5% smaller
  crates/hyperswitch_domain_models/src/router_request_types.rs  1% smaller
  crates/hyperswitch_interfaces/src/conversion_impls.rs  1% smaller
  Cargo.lock Unsupported file format
  api-reference/v1/openapi_spec_v1.json  0% smaller
  api-reference/v2/openapi_spec_v2.json  0% smaller
  config/config.example.toml Unsupported file format
  config/deployments/integration_test.toml Unsupported file format
  config/deployments/production.toml Unsupported file format
  config/deployments/sandbox.toml Unsupported file format
  config/development.toml Unsupported file format
  config/docker_compose.toml Unsupported file format
  crates/api_models/src/admin.rs  0% smaller
  crates/common_enums/src/connector_enums.rs  0% smaller
  crates/common_utils/src/lib.rs  0% smaller
  crates/connector_configs/src/connector.rs  0% smaller
  crates/connector_configs/toml/development.toml Unsupported file format
  crates/connector_configs/toml/production.toml Unsupported file format
  crates/connector_configs/toml/sandbox.toml Unsupported file format
  crates/hyperswitch_connectors/Cargo.toml Unsupported file format
  crates/hyperswitch_connectors/src/connectors/nordea/requests.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/nordea/responses.rs  0% smaller
  crates/hyperswitch_connectors/src/utils.rs  0% smaller
  crates/hyperswitch_domain_models/src/router_data.rs  0% smaller
  crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs  0% smaller
  crates/hyperswitch_domain_models/src/router_flow_types/access_token_auth.rs  0% smaller
  crates/hyperswitch_interfaces/src/connector_integration_interface.rs Unsupported file format
  crates/payment_methods/src/configs/payment_connector_required_fields.rs  0% smaller
  crates/router/src/core/connector_validation.rs  0% smaller
  crates/router/src/core/refunds.rs  0% smaller
  crates/router/src/core/refunds_v2.rs Unsupported file format
  crates/router/src/services/api.rs  0% smaller
  crates/router/src/types/api/connector_mapping.rs  0% smaller
  crates/router/src/types/connector_transformers.rs  0% smaller
  crates/router/tests/connectors/sample_auth.toml Unsupported file format
  crates/test_utils/src/connector_auth.rs  0% smaller
  loadtest/config/development.toml Unsupported file format

semanticdiff-com[bot] avatar May 25 '25 16:05 semanticdiff-com[bot]