Skip to content

Conversation

@Nithin1506200
Copy link
Contributor

@Nithin1506200 Nithin1506200 commented Sep 28, 2025

Type of Change

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

Description

  • Refunds via authorizedot net are getting into pending state where no connector call is made
  • This happens when connector_metadata is empty in attempt table
  • In usual cases connector_metadata is not empty but this happened via ucs.

solution

  • connector_metadata contains last4 digits which can be fetched form payment_method_data

how did i test

  • make payment from old code , delete connector metadata in attempt table and make refund
  1. make payment
{
    "amount": 689,
    "customer_id": "hello_world",
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_type": "debit",
    "authentication_type": "no_three_ds",

    "setup_future_usage": "off_session",
    "customer_acceptance": {
        "acceptance_type": "online",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "127.0.0.1",
            "user_agent": "amet irure esse"
        }
    },
    "email": "[email protected]",
    "description": "hellow world",
    "connector": [
        "authorizedotnet"
    ],
    "billing": {
        "address": {
            "zip": "560095",
            "country": "US",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "payment_method_data": {
        "card": {
            "card_number": "4111111111111111",
            "card_exp_month": "12",
            "card_exp_year": "2029",
            "card_holder_name": "John Doe",
            "card_cvc": "123",
            "card_network": "Visa"
        }
    }
}
{
    "payment_id": "pay_n4mGvzhDDxV8ontN4pNa",
    "merchant_id": "merchant_1759037295",
    "status": "succeeded",
    "amount": 689,
    "net_amount": 689,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 689,
    "connector": "authorizedotnet",
    "client_secret": "pay_n4mGvzhDDxV8ontN4pNa_secret_nJprHzvgyCnAQQxGeSD9",
    "created": "2025-09-28T07:38:56.792Z",
    "currency": "USD",
    "customer_id": "hello_world",
    "customer": {
        "id": "hello_world",
        "name": null,
        "email": "[email protected]",
        "phone": null,
        "phone_country_code": null
    },
    "description": "hellow world",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "411111",
            "card_extended_bin": null,
            "card_exp_month": "12",
            "card_exp_year": "2029",
            "card_holder_name": "John Doe",
            "payment_checks": {
                "description": "The street address and postal code matched.",
                "avs_result_code": "Y"
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "US",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "debit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "hello_world",
        "created_at": 1759045136,
        "expires": 1759048736,
        "secret": "epk_d109625edc44483a9a0d6e034153633f"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "120071750406",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "120071750406",
    "payment_link": null,
    "profile_id": "pro_KP1SMsZKdiOrioYnjKO2",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_Ym77o958MRzqZWCyOQXt",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-09-28T07:53:56.792Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": "pm_BS4qjY5VS1ARCBexzcfb",
    "network_transaction_id": "ZKS4CMGOARXYQR4IVKIRAOE",
    "payment_method_status": "active",
    "updated": "2025-09-28T07:38:59.120Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "932841928-932130361",
    "card_discovery": "manual",
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null
}

Delete connector metadata

Screenshot 2025-09-28 at 1 12 00 PM Screenshot 2025-09-28 at 1 12 22 PM
  • manual update refund status into failed
curl --location --request PUT 'localhost:8080/refunds/ref_Ut6eGBd4ZUKJXMhn3NZz/manual-update' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
    "status": "failed",
    "merchant_id": "merchant_1759037295"
}'
  • retrigger refund with new code
curl --location 'localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_IbxeUnL1qB3Fre0mdogERYiA4O4rQttdcxtzqzMjzWpVR6zafoOzCYvIdRz9X5bu' \
--data '{
    "payment_id": "pay_n4mGvzhDDxV8ontN4pNa",
    "amount":689,
    "reason":"pause"
}'

NOTE THAT in sbx we cannot make successful refund , its skipped in cypress too. Now the api call is goign

{
    "refund_id": "ref_KlllCvhIs4k7Twk6teXh",
    "payment_id": "pay_n4mGvzhDDxV8ontN4pNa",
    "amount": 689,
    "currency": "USD",
    "status": "failed",
    "reason": "pause",
    "metadata": null,
    "error_message": "The referenced transaction does not meet the criteria for issuing a credit.",
    "error_code": "54",
    "unified_code": "UE_9000",
    "unified_message": "Something went wrong",
    "created_at": "2025-09-28T07:46:51.621Z",
    "updated_at": "2025-09-28T07:46:53.144Z",
    "connector": "authorizedotnet",
    "profile_id": "pro_KP1SMsZKdiOrioYnjKO2",
    "merchant_connector_id": "mca_Ym77o958MRzqZWCyOQXt",
    "split_refunds": null,
    "issuer_error_code": null,
    "issuer_error_message": null
}

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?

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 requested a review from a team as a code owner September 28, 2025 07:29
@semanticdiff-com
Copy link

semanticdiff-com bot commented Sep 28, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs  20% smaller

@Nithin1506200 Nithin1506200 linked an issue Sep 29, 2025 that may be closed by this pull request
2 tasks
@likhinbopanna likhinbopanna added this pull request to the merge queue Sep 29, 2025
Merged via the queue into main with commit ff06ae4 Sep 29, 2025
37 of 47 checks passed
@likhinbopanna likhinbopanna deleted the authorizedotnet-refund branch September 29, 2025 18:26
pixincreate added a commit that referenced this pull request Sep 30, 2025
…pay-new-field

* 'main' of github.com:juspay/hyperswitch: (21 commits)
  feat(payments): add tokenization action handling to payment flow for braintree (#9506)
  feat(connector): [Loonio] Add template code (#9586)
  fix(connector): [paysafe] make `eci_indicator` field optional (#9591)
  fix(core): add should_call_connector_customer function to connector specification (#9569)
  feat(ucs): Add profile ID to lineage tracking in Unified Connector Service (#9559)
  feat(core): Add support for partial auth in proxy payments [V2] (#9503)
  chore(version): 2025.09.30.0
  fix(authorizedotnet): refund via ucs missing connector_metadata (#9581)
  feat(auth): add new authentication to communicate between microservices (#9547)
  Fix: Ideal Giropay Country Currency Config (#9552)
  feat(connector): [ACI] cypress added (#9502)
  feat(connector): Add Peachpayments Cypress (#9573)
  chore(version): 2025.09.29.0
  feat(finix): template code (#9557)
  feat(cypress): add cypress test-cases for manual retry (#9505)
  feat(core): update additional payment method data in psync response (#9519)
  feat(connector): [Checkout] Add Google Pay Predecrypt Flow (#9130)
  feat(framework): Added smithy, smithy-core and smithy-generator crates (#9249)
  fix(core): add request_extended_authorization in the payment attempt and populate it in the payment response (#9492)
  chore(version): 2025.09.26.0
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-connector-compatibility Area: Connector compatibility Hotfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] refund via ucs missing connector_metadata

5 participants