hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

feat(payouts): add kafka events

Open kashif-m opened this issue 11 months ago • 0 comments

Type of Change

  • [ ] Bugfix
  • [x] New feature
  • [ ] Enhancement
  • [ ] Refactoring
  • [ ] Dependency updates
  • [ ] Documentation
  • [ ] CI/CD

Description

Additional Changes

  • [ ] This PR modifies the API contract
  • [ ] This PR modifies the database schema
  • [ ] This PR modifies application configuration/environment variables

Motivation and Context

This helps in viewing payout analytics on HyperSwitch dashboard. Closes a subtask of #3652

How did you test it?

Env - local

Steps for testing

  • Make sure events are set to kafka
  • Creating a payout transaction should send these events to kafka producer
  • In local env, this can be verified from console logs

Payout create + confirm + auto fulfill

curl --location 'http://localhost:8080/payouts/create' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_wmZ4BwC6pXMpBZs3kHlEHAbAxQevfCfJvEESnNmpm7eGlRlNH3yqWCjH58Q87Vfm' \ --data-raw '{ "amount": 1, "currency": "EUR", "customer_id": "cus_NOWPAviaOF3z7Ynbi5MQ", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payout request", "payout_type": "card", "payout_method_data": { "card": { "card_number": "4111111111111111", "expiry_month": "3", "expiry_year": "2030", "card_holder_name": "John Doe" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "CA", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "entity_type": "Individual", "recurring": true, "metadata": { "ref": "123" }, "confirm": true, "auto_fulfill": true }' image

Checklist

  • [x] I formatted the code cargo +nightly fmt --all
  • [x] I addressed lints thrown by cargo clippy
  • [x] I reviewed the submitted code
  • [ ] I added unit tests for my changes where possible
  • [ ] I added a CHANGELOG entry if applicable

kashif-m avatar Apr 01 '24 11:04 kashif-m