Skip to content

fix(connector): [finix] webhook handling | custom header#13308

Open
Nithin1506200 wants to merge 12 commits into
mainfrom
finix-fixes-jul14
Open

fix(connector): [finix] webhook handling | custom header#13308
Nithin1506200 wants to merge 12 commits into
mainfrom
finix-fixes-jul14

Conversation

@Nithin1506200

@Nithin1506200 Nithin1506200 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Type of Change

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

Description

  • add custom header "X-Finix-Referrer-Source" : "PLUGIN_HYPERSWITCH"
  • handle dispute webhooks issue
  • handle not supported webhooks

test

  • trigger disputes
{
    "amount": 888888,
    "customer_id":"test_disputes",
    "currency": "USD",
    "confirm": true,

    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_type": "credit",

    "connector":["finix"],
      "billing": {
        "address": {
            "zip": "560095",
            "country": "US",
            "state":"alabama",
            "first_name": "Sdakil",
            "last_name": "nit",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "feature_metadata": {
        "finix_additional_details":{
            "fraud_session_id":"test"
        }
    },
    "payment_method_data": {
        "card": {
            "card_number": "5200828282828210",
            "card_exp_month": "01",
            "card_exp_year": "2028",
            "card_holder_name": "John Smith",
            "card_cvc": "100",
            "card_network":"Mastercard"
        }
  
    }
}

recieve webhooks

{
  "id": "event_6eVp5LAFytb8QJjUD4TyDR",
  "system_generated_idempotency_id": "6eVp5LAFytb8QJjUD4TyDR",
  "type": "created",
  "entity": "dispute",
  "occurred_at": "2026-07-14T10:03:26.81419133",
  "_embedded": {
    "disputes": [
      {
        "id": "DI3PYhg4YWskwxg4SYgaMFGe",
        "created_at": "2026-07-14T10:03:25.97Z",
        "updated_at": "2026-07-14T10:03:25.97Z",
        "action": null,
        "amount": 888888,
        "application": "APcyh37CsWmmTdLY3yfbNUXT",
        "dispute_details": {
          "arn": "123"
        },
        "evidence_submitted": "NOT_SUPPORTED",
        "identity": "IDkZb7BTReteEzAc5rAbwmoq",
        "merchant": "MUmLXawMcqT58Ng3CDVu5bit",
        "message": null,
        "occurred_at": "2026-07-14T10:03:25.55Z",
        "reason": "FRAUD",
        "respond_by": "2026-07-21T10:03:25.95Z",
        "response_state": "NEEDS_RESPONSE",
        "state": "PENDING",
        "tags": {},
        "transfer": "TR93eNJrrdziZm9Uv24ByQ1z"
      }
    ]
  }
}

psync to get disputes

{
    "payment_id": "pay_pgB8y23ILMQLVHQcGuEy",
    "merchant_id": "merchant_1784022983",
    "status": "succeeded",
    "amount": 888888,
    "net_amount": 888888,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 888888,
    "processor_merchant_id": "merchant_1784022983",
    "initiator": null,
    "sdk_authorization": "cHJvZmlsZV9pZD1wcm9fSll3cEQ5dGt5OHVPeUtLSUVCMVMscHVibGlzaGFibGVfa2V5PXBrX2Rldl83ZTllNTBmYTI4NDY0Njc5OGQ1ZjQ2ZTJmMWNlZmJiMyxjbGllbnRfc2VjcmV0PXBheV9wZ0I4eTIzSUxNUUxWSFFjR3VFeV9zZWNyZXRfbktCaVlVUDZlRDNPNER4eFhtQ1MsY3VzdG9tZXJfaWQ9dGVzdF9jdXN0b21lcnh4LHBheW1lbnRfaWQ9cGF5X3BnQjh5MjNJTE1RTFZIUWNHdUV5",
    "connector": "finix",
    "state_metadata": null,
    "client_secret": "pay_pgB8y23ILMQLVHQcGuEy_secret_nKBiYUP6eD3O4DxxXmCS",
    "created": "2026-07-14T10:03:23.781Z",
    "modified_at": "2026-07-14T10:03:26.709Z",
    "connector_customer_id": "ID2cbBKdgcsfUTkfTtJr6c45",
    "currency": "USD",
    "customer_id": "test_customerxx",
    "customer": {
        "id": "test_customerxx",
        "name": null,
        "email": null,
        "phone": null,
        "phone_country_code": null,
        "customer_document_details": null
    },
    "description": null,
    "refunds": null,
    "disputes": [
        {
            "dispute_id": "dp_xpzAZSRLAMl0sThjKCbW",
            "amount": "888888",
            "dispute_stage": "dispute",
            "dispute_status": "dispute_opened",
            "connector_status": "PENDING",
            "connector_dispute_id": "DI3PYhg4YWskwxg4SYgaMFGe",
            "connector_reason": "FRAUD",
            "connector_reason_code": null,
            "challenge_required_by": "2026-07-21T10:03:25.950Z",
            "connector_created_at": "2026-07-14T10:03:25.970Z",
            "connector_updated_at": "2026-07-14T10:03:25.970Z",
            "created_at": "2026-07-14T10:03:27.192Z"
        }
    ],
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "8210",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "520082",
            "card_extended_bin": null,
            "card_exp_month": "01",
            "card_exp_year": "2028",
            "card_holder_name": "John Smith",
            "payment_checks": {
                "avs_result": "POSTAL_CODE_AND_STREET_MATCH"
            },
            "authentication_data": null,
            "auth_code": "676630"
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "US",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": "alabama",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },

    "authentication_type": "no_three_ds",
    "payment_method_type": "credit",
    "business_label": "default",
    "connector_transaction_id": "TR93eNJrrdziZm9Uv24ByQ1z",
    "feature_metadata": {
        "finix_additional_details": {
            "fraud_session_id": "test"
        }
    },

    "profile_id": "pro_JYwpD9tky8uOyKKIEB1S",

    "attempt_count": 1,

    "merchant_connector_id": "mca_p18Fqt8kBfYDz7VrB1bx",
    "incremental_authorization_allowed": false,

    "external_3ds_authentication_attempted": false,
    "expires_on": "2026-07-14T10:18:23.781Z",
    
    "updated": "2026-07-14T10:03:26.709Z",

}

handle intermittent webhooks

Screenshot 2026-07-14 at 5 06 15 PM

Additional Changes

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

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

@Nithin1506200 Nithin1506200 self-assigned this Jul 14, 2026
@Nithin1506200
Nithin1506200 requested a review from a team as a code owner July 14, 2026 11:38
@semanticdiff-com

semanticdiff-com Bot commented Jul 14, 2026

Copy link
Copy Markdown

@Nithin1506200 Nithin1506200 added the S-test-ready Status: This PR is ready for cypress-tests label Jul 14, 2026
@Nithin1506200
Nithin1506200 enabled auto-merge July 14, 2026 11:56
@github-actions github-actions Bot removed the S-test-ready Status: This PR is ready for cypress-tests label Jul 14, 2026
@Nithin1506200 Nithin1506200 added the S-test-ready Status: This PR is ready for cypress-tests label Jul 15, 2026
@github-actions github-actions Bot removed the S-test-ready Status: This PR is ready for cypress-tests label Jul 15, 2026
@Nithin1506200 Nithin1506200 added the S-test-ready Status: This PR is ready for cypress-tests label Jul 15, 2026
@github-actions github-actions Bot removed the S-test-ready Status: This PR is ready for cypress-tests label Jul 15, 2026
@GeorgePhili7 GeorgePhili7 added the S-test-ready Status: This PR is ready for cypress-tests label Jul 16, 2026
@github-actions github-actions Bot removed the S-test-ready Status: This PR is ready for cypress-tests label Jul 16, 2026
@Nithin1506200 Nithin1506200 added the S-test-ready Status: This PR is ready for cypress-tests label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-test-ready Status: This PR is ready for cypress-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants