Skip to content

fix(core): [CARD TESTING GUARD] Added Card Testing Guard Config response in case of NULL#7478

Merged
Gnanasundari24 merged 12 commits intomainfrom
fix/card-testing
Apr 21, 2025
Merged

fix(core): [CARD TESTING GUARD] Added Card Testing Guard Config response in case of NULL#7478
Gnanasundari24 merged 12 commits intomainfrom
fix/card-testing

Conversation

@Debarshi-Gupta
Copy link
Contributor

@Debarshi-Gupta Debarshi-Gupta commented Mar 11, 2025

Type of Change

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

Description

In our current implementation of Card Testing Guard, the card_testing_guard_config can be NULL
for existing profiles. That has been fixed in this PR to return the default values for card_testing_guard_config in case the underlying data is 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

Issue Link: #7598

How did you test it?

Postman Tests

Business Profile Retrieve

-Request

curl --location 'http://localhost:8080/account/postman_merchant_GHAction_28c1525e-4f97-4f53-82a2-7ea63214a26a/business_profile/pro_N8dPPL3N4soUk236Rbq2' \
--header 'api-key: test_admin'

-Response

{
    "merchant_id": "postman_merchant_GHAction_28c1525e-4f97-4f53-82a2-7ea63214a26a",
    "profile_id": "pro_N8dPPL3N4soUk236Rbq2",
    "profile_name": "US_default",
    "return_url": "https://duck.com/success",
    "enable_payment_response_hash": true,
    "payment_response_hash_key": "M59W9wzwjThfjmSUuTqagO3k9SaN74rA8BFa4NMGBTRCgzwl7Y9gBNgAAKl0FqHe",
    "redirect_to_merchant_with_http_post": false,
    "webhook_details": {
        "webhook_version": "1.0.1",
        "webhook_username": "ekart_retail",
        "webhook_password": "password_ekart@123",
        "webhook_url": null,
        "payment_created_enabled": true,
        "payment_succeeded_enabled": true,
        "payment_failed_enabled": true
    },
    "metadata": null,
    "routing_algorithm": null,
    "intent_fulfillment_time": 900,
    "frm_routing_algorithm": null,
    "payout_routing_algorithm": null,
    "applepay_verified_domains": null,
    "session_expiry": 900,
    "payment_link_config": null,
    "authentication_connector_details": null,
    "use_billing_as_payment_method_billing": true,
    "extended_card_info_config": null,
    "collect_shipping_details_from_wallet_connector": false,
    "collect_billing_details_from_wallet_connector": false,
    "always_collect_shipping_details_from_wallet_connector": false,
    "always_collect_billing_details_from_wallet_connector": false,
    "is_connector_agnostic_mit_enabled": false,
    "payout_link_config": null,
    "outgoing_webhook_custom_http_headers": null,
    "tax_connector_id": null,
    "is_tax_connector_enabled": false,
    "is_network_tokenization_enabled": false,
    "is_auto_retries_enabled": false,
    "max_auto_retries_enabled": null,
    "always_request_extended_authorization": null,
    "is_click_to_pay_enabled": false,
    "authentication_product_ids": null,
    "card_testing_guard_config": {
        "card_ip_blocking_status": "disabled",
        "card_ip_blocking_threshold": 3,
        "guest_user_card_blocking_status": "disabled",
        "guest_user_card_blocking_threshold": 10,
        "customer_id_blocking_status": "disabled",
        "customer_id_blocking_threshold": 5,
        "card_testing_guard_expiry": 3600
    },
    "is_clear_pan_retries_enabled": false,
    "force_3ds_challenge": false
}

Cypress Tests

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

@Debarshi-Gupta Debarshi-Gupta added the A-core Area: Core flows label Mar 11, 2025
@Debarshi-Gupta Debarshi-Gupta self-assigned this Mar 11, 2025
@Debarshi-Gupta Debarshi-Gupta requested a review from a team as a code owner March 11, 2025 11:10
@semanticdiff-com
Copy link

semanticdiff-com bot commented Mar 11, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/types/api/admin.rs  35% smaller
  crates/router/src/core/admin.rs  22% smaller
  crates/diesel_models/src/business_profile.rs  0% smaller

@Debarshi-Gupta Debarshi-Gupta requested a review from a team as a code owner March 22, 2025 18:27
@Debarshi-Gupta Debarshi-Gupta added the C-bug Category: Bug label Mar 22, 2025
let masked_outgoing_webhook_custom_http_headers =
outgoing_webhook_custom_http_headers.map(MaskedHeaders::from_headers);

let card_testing_guard_config = item.card_testing_guard_config.or({
Copy link
Member

Choose a reason for hiding this comment

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

make this a impl based function, so that we reuse in below and other places too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have resolved it, thanks

@Debarshi-Gupta Debarshi-Gupta requested a review from jarnura March 27, 2025 12:34
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Apr 21, 2025
Merged via the queue into main with commit 73eb467 Apr 21, 2025
16 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the fix/card-testing branch April 21, 2025 08:49
pixincreate added a commit that referenced this pull request Apr 22, 2025
…acilitapay-pix-pmt

* 'main' of github.com:juspay/hyperswitch:
  fix(connector): revert noon-paypal (#7864)
  refactor(cypress): do not update `card_expiry` while updating card info (#7834)
  feat(vsaas): add processor_merchant_id and created_by column in payment_intents and payments_attempts for v1 (#7768)
  chore(dynamic-fields): remove billing details as required fields for Worldpay connector (#7853)
  feat(dynamic_routing): integration of elimination routing for core flows (#6816)
  chore(version): 2025.04.22.0
  revert: fix(connector): [noon] address `next_action_url` being `null` for cards in 3ds payment (#7859)
  feat(dynamic_routing): add open router integration for success based routing (#7795)
  feat(refunds_v2): Add refund create core flow (#7619)
  fix(core): [CARD TESTING GUARD] Added Card Testing Guard Config response in case of NULL (#7478)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-core Area: Core flows C-bug Category: Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] [CARD TESTING GUARD] Card Testing Guard Config null value fix for existing profiles

4 participants