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_4 (already cloned)
- Base commit: 20b37bdb7a25ec053e7671332d4837a0ad743983
- Task ID: juspay__hyperswitch-8325
- Version: v1.115.0
TASK DESCRIPTION: Bug: feat(recovery-events): add revenue recovery topic and vector config to push these events to s3
Add new event for revenue recovery and write vector config to send data to aws s3.
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
This new Kafka Event consume the revenue recovery related events which will be constructed from both
RecoveryPaymentIntentandRecoveryPaymentAttemptin revenue recovery flow. The events form Kafka will be picked up by vector and this be eventually batched and pushed to s3 based on the set config. They file path will look like thismerchant_id/Year/month/timestamp.csv.The events will be recorded at two places.
Webhook Flow(External Payments done by billing processor) andInternal Proxy Flow(Internal Done by Hyperswitch as a part of retrying). The event structure is mentioned in the kafka message in code.The estimated size of each event is around 1000bytes. We want to keep the config at 1000 batches and one day(86400s) timeout in vector. So that vector collects all the events till the end of the time out or till it hits 1000 events and push them to s3 file in the designated file path in a csv format in the order mentioned in the config. Based on the above config vector needs 10mb size buffer to support this. S3 auth will be done using the IAM Instance profile which will be taken care off at the time of the deployment.
Additional Changes
- This PR modifies the API contract
- This PR modifies the database schema
Assistant
I'll help you implement the revenue recovery topic and vector config for pushing events to S3. Let me start by creating a plan and exploring the repository structure to understand where changes need to be made.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.