Skip to content

Conversation

Nithin1506200
Copy link
Contributor

@Nithin1506200 Nithin1506200 commented May 8, 2025

Type of Change

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

Description

Update metadata gives 500 error for other connectors than stripe
Change this to 400

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?

  • Make a successful payment using any connector other than stripe
  • make update metadata request
curl --location 'http://localhost:8080/payments/pay_X77ffJsUvEW94JadFVpw/update_metadata' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_bTSpZN98PGIduROqZNoagEkN7XUxd7dof6cgl8K061T2Vvw6rRaplOVejfRiYUI9' \
--data '{
    "metadata": {
        "order_id": "999999897989",
        "dbehcb": "2324",
        "abb": "efe"
    }
}'

Response should be 400

{
    "error": {
        "type": "connector",
        "message": "IR_20: Flow is not implemented for this connector",
        "code": "CE_00",
        "connector": "cybersource"
    }
}
  • update metadata for successful payment created via stripe should give success response
{
    "payment_id": "pay_fvWhpXtZwWZSE1JfTUI4",
    "metadata": {
        "abb": "efe",
        "dbehcb": "2324",
        "order_id": "999999897989"
    }
}

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

Copy link

semanticdiff-com bot commented May 8, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payments/flows/update_metadata_flow.rs  91% smaller
  crates/router/src/core/payments/transformers.rs  0% smaller

@Nithin1506200 Nithin1506200 self-assigned this May 8, 2025
@Nithin1506200 Nithin1506200 added A-connector-integration Area: Connector integration C-bug Category: Bug labels May 8, 2025
@Nithin1506200 Nithin1506200 marked this pull request as ready for review May 8, 2025 09:00
@Nithin1506200 Nithin1506200 requested a review from a team as a code owner May 8, 2025 09:00
@Nithin1506200 Nithin1506200 linked an issue May 8, 2025 that may be closed by this pull request
2 tasks
@Nithin1506200 Nithin1506200 changed the title Update Metadata bug(update_metadata): Update Metadata for any connectors other than stripe gives 500 error May 8, 2025
@Nithin1506200 Nithin1506200 changed the title bug(update_metadata): Update Metadata for any connectors other than stripe gives 500 error fix(update_metadata): Update Metadata for any connectors other than stripe gives 500 error May 8, 2025
code: "IR_29".to_string(),
message: "Update metadata is not implemented for this connector".to_string(),
reason: None,
status_code: http::StatusCode::UNPROCESSABLE_ENTITY.as_u16(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we throw BadRequest instead?

@bernard-eugine bernard-eugine merged commit fafe4d9 into juspay:main May 8, 2025
19 of 23 checks passed
pixincreate added a commit that referenced this pull request May 12, 2025
…adyen-ideal

* 'main' of github.com:juspay/hyperswitch: (62 commits)
  fix(core): language consumption from locale in payment and payout links (#7993)
  feat(refunds_v2): Add refunds list flow in v2 apis (#7966)
  refactor(connector): [Noon] auth header (#7977)
  fix(connector): [Novalnet] send decoded token for apple pay payment (#7973)
  feat(business_profile): add business_profile config to enable external vault (#7876)
  feat(vsaas): integrate onboarding flow for vertical saas (#7884)
  feat(connector): Introduce connector template code for WorldpayXML  (#7968)
  feat(connector): [ADYEN, CHECKOUT] Added In Feature Matrix API (#7914)
  feat(core): add psync support for recovery external payments (#7855)
  refactor(open_router): call elimination routing of open router if enabled instead of dynamo (#7961)
  feat(payment_methods): add v2 api for fetching token data (#7629)
  ci(cypress): Fix Bank Redirects for stripe test (#8004)
  chore(version): 2025.05.12.0
  refactor(authentication): moved cavv storing from table to temp locker (#7978)
  chore(version): 2025.05.09.0
  feat(connector): [paypal, trustpay] add in feature matrix (#7911)
  fix(update_metadata): Update Metadata for any connectors other than stripe gives 500 error (#7984)
  fix(router): Fixed stack over flow for session call in authentication connectors (#7983)
  chore(version): 2025.05.08.0
  fix(payment): disable payment update via client config (#7970)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Update Metadata for connectors other than stripe throws 500
4 participants