juspay / juspay/hyperswitch

todo: Optimise encode process for signature based requests

Open
#370 1 comment 0 reactions 0 assignees View on GitHub
A-connector-integration C-feature S-awaiting-triage
Dominant language
Rust
Stars
43.7k
Forks
5.1k
Avg merge
2d 20h
Merged PRs (30d)
205

Description

### Feature Description

For a connector call, `get_request_body` is being called twice, Once in `get_headers`, other in `build_request`.

This is an expensive operation to call the same encoding function twice.

### Possible Implementation

Need to optimise it to a state from where it can be further implemented into the methods.

### 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/contrib/CONTRIBUTING.md)

### Are you willing to submit a PR?

None

Contributor guide

Open the contributing guide

Research direction

Start by tracing the connector request flow around get_request_body, get_headers, and build_request to confirm where the encoding work is repeated. Determine a state or shared result that supports both methods without encoding twice; done means the request path performs one encoding operation and existing connector behavior remains covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, payments, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.