Looking at the codebase structure and the issue requirements, I need to determine the…
- User
Looking at the codebase structure and the issue requirements, I need to determine the exact files and changes required to implement invoice_created webhook support for Chargebee. Based on the code I've explored, I need to understand:
- How to add a new event type to the IncomingWebhookEvent enum in api_models
- How to modify the Chargebee connector to handle invoice_generated events
- Where to add the process tracker integration for subscription workflow management
Let me look at how other webhook events are handled and where the process tracker functionality is integrated.
Assistant
I'll help you implement invoice_created webhook support for Chargebee by examining the codebase structure and understanding how to add the necessary changes. Let me start by exploring the relevant files and understanding the current implementation.
First, let me look for the IncomingWebhookEvent enum and related webhook handling code:
Assistant
Now let me look specifically for the IncomingWebhookEvent enum and webhook event handling:
Assistant
Let me check the webhook events definition in api_models:
Assistant
Now let me look at the Chargebee connector implementation to understand how it currently handles webhooks:
Assistant
Now let me check the Chargebee transformers to understand how webhooks are currently processed:
Assistant
Now, let me check how the webhook handling works in general to understand how to add a new event type. Let me also check for any existing process tracker references:
Assistant
Let me look at the connector_enums.rs file to understand the event enum structure:
Assistant
Now, let me check if there are any references to process tracker or subscription workflows to understand how integration with subscription flows works:
Assistant
Let me look at the subscription core module to understand how subscriptions are handled:
Assistant
Now let me examine the recovery incoming webhooks file to understand how they're handled:
Assistant
Now let me check the process tracker integration in the subscription module to see how it's connected:
Assistant
Let me search for the specific Chargebee event types and understand how invoice events are defined:
Assistant
Let me check the specific structure around the Chargebee invoice webhook event definitions in the transformers file:
Assistant
Let me also look at the api_models/webhooks.rs to check the existing event types more carefully:
Assistant
Based on my exploration of the codebase, I now understand how to implement the invoice_created webhook support for Chargebee. Here's my analysis:
Current State Analysis
- Webhook Event Enum: The
IncomingWebhookEventenum inapi_models/src/webhooks.rsdefines all supported webhook event types - Chargebee Connector: The Chargebee connector in
hyperswitch_connectors/src/connectors/chargebee.rsimplements webhook handling - Chargebee Transformers: The transformer file
hyperswitch_connectors/src/connectors/chargebee/transformers.rshandles the parsing and conversion of webhook data - Revenue Recovery Integration: There's already revenue recovery support for Chargebee with existing event mappings
Required Changes
To add support for
invoice_createdwebhook events for Chargebee, I need to:- Add new enum variant to
IncomingWebhookEventinapi_models/src/webhooks.rs - Add corresponding Chargebee event type mapping in the transformers file
- Update the Chargebee connector's webhook handler to support the new event
- Add process tracker integration for subscription workflow
Implementation Plan
Step 1: Update the IncomingWebhookEvent enum
I need to add a new variant to the enum in
api_models/src/webhooks.rsto support the invoice_created event.Step 2: Update Chargebee transformer logic
The
ChargebeeEventTypeenum needs to be extended to supportinvoice_createdevents, and the mapping from Chargebee event types toIncomingWebhookEventneeds to be updated.Step 3: Update Chargebee connector
The connector's webhook processing methods (
get_webhook_event_type,get_webhook_object_reference_id, etc.) need to handle the new event.Step 4: Integration with Process Tracker
For subscription workflow management, the implementation should properly route these events through the process tracker system.
Let me check if there are any specific instructions or examples of how the process tracker integration works for subscription flows by looking at existing webhook implementations.
- Webhook Event Enum: The
Assistant
I'll now implement the invoice_created webhook support for Chargebee by modifying the required files. Let me start by examining the current structure of the IncomingWebhookEvent enum and then make the necessary changes.
Assistant
Now I'll look at the current Chargebee webhook event handling to understand how to add the new invoice_created event:
Assistant
Let me look for the ChargebeeEventType to enum conversion logic that I need to modify:
Assistant
Now I'll update the IncomingWebhookEvent enum to add the invoice_created variant. Based on the pattern of other recovery events, I should add it alongside the other revenue recovery events.
Assistant
I need to add the invoice_created event to the enum. Based on the pattern in the code, it should be added with a similar naming convention to the existing recovery events. Let me add it right after the existing recovery events:
Assistant
Let me implement the changes one by one. First, I'll update the IncomingWebhookEvent enum to add the invoice_created variant:
Assistant
Now I'll update the IncomingWebhookEvent enum to add the invoice_created event:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-haiku-4-5-20251001Compare side by side →
claude-haiku-4-5-20251001Compare side by side →
claude-haiku-4-5-20251001Compare side by side →
claude-haiku-4-5-20251001Compare side by side →
claude-haiku-4-5-20251001Compare side by side →
claude-haiku-4-5-20251001Compare side by side →
claude-haiku-4-5-20251001Compare side by side →
claude-haiku-4-5-20251001Compare side by side →
claude-haiku-4-5-20251001Compare side by side →
claude-haiku-4-5-20251001Compare side by side →
claude-haiku-4-5-20251001Compare side by side →