Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): add validation to check if routable connector supports network tokenization in CIT repeat flow #6749

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

prasunna09
Copy link
Contributor

@prasunna09 prasunna09 commented Dec 4, 2024

Type of Change

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

Description

Currently we always fetch network token for the connector that does not support network tokenization.

Fix: we ll only fetch network token if the connector supports network tokenization else fetch card details to make CIT repeat.

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?

test cases -
Create two MCA ex - Cybersource(network tokenization supported conn), Adyen
enable network tokenization for business profile
Make saved card flow transaction.
when routable connector list - [Cybersource, Adyen] -> payment should happen with Network token + cryptogram
when routable connector list - [ Adyen, Cybersource] -> payment should happen with card+cvc

CIT -

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api-key' \
--data-raw '{
    "amount": 10,
    "amount_to_capture": 10,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "customer1733733309",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "setup_future_usage": "off_session",
    "return_url": "http://127.0.0.1:4040/",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "card_number",
            "card_exp_month": "card_exp_month",
            "card_exp_year": "card_exp_year",
            "card_holder_name": "joseph Doe",
            "card_cvc": "947"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US"
        },
        "email": "[email protected]"
    },
    "browser_info": {
        "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
        "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "125.0.0.1"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'

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

@prasunna09 prasunna09 added C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Dec 4, 2024
@prasunna09 prasunna09 self-assigned this Dec 4, 2024
@prasunna09 prasunna09 requested review from a team as code owners December 4, 2024 22:09
Copy link

semanticdiff-com bot commented Dec 4, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payments/helpers.rs  14% smaller
  crates/router/src/core/payment_methods.rs  0% smaller

ShankarSinghC
ShankarSinghC previously approved these changes Dec 6, 2024
@prasunna09 prasunna09 changed the title fix(core): fix network token data fetch implementation in CIT repeat flow fix(core): add validation to check if routable connector supports network tokenization in CIT repeat flow Dec 9, 2024
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Dec 10, 2024
Merged via the queue into main with commit 9f0d8ef Dec 10, 2024
24 of 26 checks passed
@Gnanasundari24 Gnanasundari24 deleted the fix-nt-in-payments-flow branch December 10, 2024 12:40
kashif-m pushed a commit that referenced this pull request Dec 12, 2024
…work tokenization in CIT repeat flow (#6749)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Network token data is being fetched in CIT repeat irrespective of connector
5 participants