Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(router): add outgoing payment webhooks for v2 #6613

Open
wants to merge 68 commits into
base: main
Choose a base branch
from

Conversation

sai-harsha-vardhan
Copy link
Contributor

Type of Change

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

Description

add outgoing payment webhooks for v2

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?

Tested Manually
Setup incoming webhooks and trigger a successful payment, to receive an outgoing webhook
Outgoing Payload Response

{
  "merchant_id": "cloth_seller1_CqRqRX8T1Jy1QzaqVrBj",
  "event_id": "evt_01934471d1db77b3b6f719f1610e266d",
  "event_type": "payment_succeeded",
  "content": {
    "type": "payment_details",
    "object": {
      "id": "12345_pay_0193447120ac7750bcf168915d6a6a27",
      "status": "succeeded",
      "amount": {
        "order_amount": 100,
        "currency": "USD",
        "shipping_cost": null,
        "order_tax_amount": null,
        "skip_external_tax_calculation": "Skip",
        "skip_surcharge_calculation": "Skip",
        "surcharge_amount": null,
        "tax_on_surcharge": null,
        "net_amount": 100,
        "amount_to_capture": null,
        "amount_capturable": 0,
        "amount_captured": null
      },
      "connector": "checkout",
      "client_secret": "12345_pay_0193447120ac7750bcf168915d6a6a27_secret_0193447120ad7c53a7dfcc03cb39cbc3",
      "created": "2024-11-19T12:41:24.909Z",
      "payment_method_data": null,
      "payment_method_type": "card",
      "payment_method_subtype": "credit",
      "connector_transaction_id": "pay_ll4mzsjdkkouzfmepbopl3cbuu",
      "connector_reference_id": null,
      "merchant_connector_id": "mca_e7GcpKgzDyhD2l8811xl",
      "browser_info": null,
      "error": null
    }
  },
  "timestamp": "2024-11-19T12:42:10.267Z"
}

image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

Narayanbhat166 and others added 30 commits October 29, 2024 15:18
@sai-harsha-vardhan sai-harsha-vardhan added A-core Area: Core flows C-feature Category: Feature request or enhancement api-v2 labels Nov 19, 2024
@sai-harsha-vardhan sai-harsha-vardhan self-assigned this Nov 19, 2024
Copy link

semanticdiff-com bot commented Nov 19, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/events/outgoing_webhook_logs.rs  8% smaller
  crates/diesel_models/src/events.rs  0% smaller
  crates/router/src/core/webhooks.rs  0% smaller
  crates/router/src/core/webhooks/incoming_v2.rs  0% smaller
  crates/router/src/core/webhooks/outgoing_v2.rs  0% smaller
  crates/router/src/db/events.rs  0% smaller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows api-v2 C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants