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_2 (already cloned)
- Base commit: 3bd78ac5c1ff120d6afd46e02df498a16ece6f5f
- Task ID: juspay__hyperswitch-9055
- Version: v1.117.0
TASK DESCRIPTION: Bug: Get Estimate for a plan price
Request to Subscription Povider to get estimate curl --location '/api/v2/estimates/create_subscription_for_items'
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Authorization: Basic ='
--data-urlencode 'billing_address%5Bline1%5D=PO Box 9999'
--data-urlencode 'billing_address%5Bcity%5D=Walnut'
--data-urlencode 'billing_address%5Bzip%5D=91789'
--data-urlencode 'billing_address%5Bcountry%5D=US'
--data-urlencode 'subscription_items%5Bitem_price_id%5D%5B0%5D=cbdemo_enterprise-suite-monthly'Response from Subscription Provider
{ "estimate": { "created_at": 1756113388, "object": "estimate", "subscription_estimate": { "status": "active", "next_billing_at": 1758791788, "object": "subscription_estimate", "currency_code": "INR" }, "invoice_estimate": { "recurring": true, "date": 1756113388, "price_type": "tax_exclusive", "sub_total": 14100, "total": 14100, "credits_applied": 0, "amount_paid": 0, "amount_due": 14100, "object": "invoice_estimate", "customer_id": "16BaasUusKoPc107J", "line_items": [ { "id": "li_16BaasUusKoQ8107O", "date_from": 1756113388, "date_to": 1758791788, "unit_amount": 14100, "quantity": 1, "amount": 14100, "pricing_model": "flat_fee", "is_taxed": false, "tax_amount": 0, "object": "line_item", "customer_id": "16BaasUusKoPc107J", "description": "Enterprise Suite Monthly", "entity_type": "plan_item_price", "entity_id": "cbdemo_enterprise-suite-monthly", "discount_amount": 0, "item_level_discount_amount": 0 } ], "taxes": [], "line_item_taxes": [], "line_item_credits": [], "currency_code": "INR", "round_off_amount": 0, "line_item_discounts": [] } } }DETAILED CONTEXT & HINTS:
Type of Change
Assistant
I'll help you implement the subscription estimate feature for the hyperswitch repository. Let me start by understanding the codebase structure and locating the relevant files for subscription functionality.
First, I'll explore the repository structure to find where subscription-related code is located.
Assistant
(no content)
Assistant
Let me examine the current subscription implementation in more detail, especially looking for the specific estimate functionality that needs to be added.
Assistant
Let me check the chargebee connector to understand the current implementation:
Assistant
Let me look at the specific chargebee transformers to understand the current implementation:
Assistant
Let me also check the API models for subscriptions to understand the current structure:
Assistant
Now let me check the subscription interfaces to understand the structure better:
Assistant
Let me also check the V2 subscription interface to understand if there's a different structure:
Assistant
Let me check what's in the domain models for subscription related structures:
Assistant
Now, let me look at the current subscription routes to understand how the API is structured:
Assistant
Let me also check the request types for subscriptions to understand the expected structure:
Assistant
Now, let me check if there are any existing estimates related endpoints or structures:
Assistant
Let me check the GitHub issue or pull request mentioned in the task to understand exactly what needs to be implemented:
Assistant
Let me examine the chargebee connector to understand what needs to be added for the estimate functionality. Based on the curl request and response provided in the task, I need to implement subscription estimate functionality for Chargebee.
Let me create a plan for implementing this feature:
Assistant
Let me start by checking what the API endpoint for estimates should look like based on the curl example. I can see from the curl request that it's calling
/api/v2/estimates/create_subscription_for_items. Let me examine the codebase to see if there's already a v2 route structure:Assistant
(no content)
Assistant
(no content)
Assistant
I'll continue working on implementing the subscription estimate feature. Based on the information I've gathered, I need to add an estimate endpoint for Chargebee subscriptions. Let me proceed with implementing the solution step by step.
First, let me update the domain model to include the estimate response structure:
Assistant
I'll continue implementing the subscription estimate feature by working directly with the files in the repository. Let me take a more direct approach to implement the required changes.
First, let me create a detailed plan of what needs to be implemented and then proceed with the actual file changes.
Assistant
Let me look more closely at the existing chargebee connector to understand exactly what needs to be modified. I'll check if there's a v2 version of subscription interfaces or how the new estimate endpoint should fit into the current structure.
Assistant
Let me look more closely at the structure to understand how to implement the estimate functionality. First, let me check the current structure of the connectors:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.