Skip to content

UCS <-> HS | Connector throwing 4xx / 5xx , errors are not propogated properly #1126

@Nithin1506200

Description

@Nithin1506200
  • When ever Connector throws 4xx Hyperswitch is throwing 5xx

Expected Behaviour

  • Propogate the error properly to Hyperswitch
  • Hyperswitch to show proper Error code and message and set Payment Status properly
  • In some cases like rate limiting or particular error code we just keep the previous status.

Example

{
    "amount": 0,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "fasdfasffdsdaafdaerwqsffsafdsa",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "customer_acceptance": {
        "acceptance_type": "offline"
    },
    "setup_future_usage": "off_session",
    "payment_method_data": {
        "card": {
            "card_number": "4000000000001091",
            "card_exp_month": "12",
            "card_exp_year": "2028",
            "card_holder_name": "",
            "card_cvc": "123"
        }
    },
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US"
            // "first_name": "joseph",
            // "last_name": "JS"
        },
        // "email": "test@novalnet.de",
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    }
}

the connector gives 4xx and we expect to propogate proper error reason

 b"{\"gatewayResponse\":{\"transactionType\":\"CHARGE_SALE\",\"transactionState\":\"FAILED\",\"transactionProcessingDetails\":{\"orderId\":\"02003bead83121ec4740af7fd6b3da2bf8b2\",\"transactionTimestamp\":\"2026-04-16T11:08:21.334316574Z\",\"apiTraceId\":\"3bead83121ec4740af7fd6b3da2bf8b2\",\"clientRequestId\":\"b25a5b18-b1ed-47ec-8bb8-0727c6e9d622\",\"transactionId\":\"02003bead83121ec4740af7fd6b3da2bf8b2\",\"apiKey\":\"7JCzjbpjFR0cer9uG3ppn5lB84PfCUTCsyY4M0n3WOW7XjGB\"}},\"error\":[{\"type\":\"GATEWAY\",\"field\":\"amount.total\",\"code\":\"836\",\"message\":\"Amount must be >$0\"}]}", status_code: 400 }))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions