You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_3 (already cloned)
- Base commit: 54e910582fac9bd6fe300a9a96926adf5123403e
- Task ID: juspay__hyperswitch-7910
- Version: v1.114.0
TASK DESCRIPTION: Bug: refactor(connector): [stripebilling] Change BillingConnectorPaymentSync from charges api to payment intents api.
Change the url from charge api to stripes payment intent api.
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
This PR changes the url of billing connector payment sync flow from using stripe charge api to stripe payment intents api. Because in Recovery Flow there is a chance to call stripe's psync flow to update the error codes and other details for an attempt. And psync flow accepts payment intent id rather than the charge id. To reuse the existing flow we need payment_intent id to propogate.
Additional Changes
- This PR modifies the API contract
- This PR modifies the database schema
- This PR modifies application configuration/environment variables
Motivation and Context
How did you test it?
To test this You can follow the steps of this PR: #7461 Tested it locally. And the logs are as following.
Checklist
- I formatted the code
cargo +nightly fmt --all - I addressed lints thrown by
cargo clippy - I reviewed the submitted code
Assistant
I'll work on this task to refactor the Stripe billing connector to use the Payment Intents API instead of the Charges API for the BillingConnectorPaymentSync functionality. Let me start by exploring the codebase to understand the current implementation.
Assistant
I need to explore the codebase to find the Stripe billing connector implementation and understand how it currently uses the charges API versus how it should use the payment intents API.
Let me start by looking for the relevant files in the connectors directory.
Assistant
Now let me examine the main stripe billing connector implementation:
Assistant
Now I need to examine the transformers module to understand how the URL is currently constructed and what changes are needed. Let me read the transformers file:
Assistant
Now I need to look at the specific part where the BillingConnectorPaymentSync is implemented. Looking at the main connector file, I found the relevant section around lines 596-605 where the URL is constructed using the charges API. According to the task, I need to change this from using
/v1/charges/{charge_id}to/v1/payment_intents/{payment_intent_id}.Let me also search for any related patterns in the codebase to make sure I understand the full context:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.