Skip to content

feat(Connector): [checkout] l2l3 data #9446

Merged
likhinbopanna merged 2 commits intomainfrom
checkout-l2l3
Sep 19, 2025
Merged

feat(Connector): [checkout] l2l3 data #9446
likhinbopanna merged 2 commits intomainfrom
checkout-l2l3

Conversation

@Nithin1506200
Copy link
Contributor

@Nithin1506200 Nithin1506200 commented Sep 19, 2025

Type of Change

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

Description

  • Add l2l3 data for checkout
  • Note : checkout recommends some checks like line_items should sum up proper total and discount amount. But it doesn't throw any errors for this. Hence in this pr we are not adding any such validations .

Request

{
    "amount": 30000,
    "capture_method": "automatic",
    "currency": "USD",
    "confirm": true,
    "payment_method": "card",
    "payment_method_type": "credit",
    "billing": {
        "address": {
            "zip": "560095",
            "country": "AT",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "payment_method_data": {
        "card": {
            "card_number": "4000000000009995",
            "card_exp_month": "01",
            "card_exp_year": "2026",
            "card_holder_name": "John Smith",
            "card_cvc": "100"
        }
    },

    //l2l3 data
    "merchant_order_reference_id":"fasdfasfasf",
    "customer_id": "nithxxinn",
    "order_tax_amount": 10000,
    "shipping_cost": 21,
    "discount_amount": 1,
    "duty_amount": 2,
    "shipping_amount_tax":22,
    "order_details": [ //l2 l3data
        {
            "commodity_code": "8471",
            "unit_discount_amount": 1200,
            "product_name": "Laptop",
            "quantity": 1,
            "product_id":"fafasdfasdfdasdfsadfsadfrewfdscrwefdscerwfdasewfdsacxzfdsasdf",
            "total_tax_amount": 5000,
            "amount": 8000,
            "unit_of_measure": "EA",
            "unit_price": 8000
        },
            {
            "commodity_code": "471",
            "unit_discount_amount": 34,
            "product_name": "Laptop",
            "quantity": 1,
            "product_id":"fas22df",
            "total_tax_amount": 3000,
            "amount": 4000,
            "unit_of_measure": "EA",
            "unit_price": 8500
        }
        
    ]
}

Response

{
    "payment_id": "pay_v01RncbYqwx0ZtB6x7yV",
    "merchant_id": "merchant_1758258316",
    "status": "succeeded",
    "amount": 30000,
    "net_amount": 40021,
    "shipping_cost": 21,
    "amount_capturable": 0,
    "amount_received": 40021,
    "connector": "checkout",
    "client_secret": "pay_v01RncbYqwx0ZtB6x7yV_secret_iolJ5SxVFNsQljPaO42C",
    "created": "2025-09-19T06:18:02.547Z",
    "currency": "USD",
    "customer_id": "nithxxinn",
    "customer": {
        "id": "nithxxinn",
        "name": null,
        "email": null,
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "9995",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "01",
            "card_exp_year": "2026",
            "card_holder_name": "John Smith",
            "payment_checks": {
                "avs_result": "G",
                "card_validation_result": "Y"
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "AT",
            "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": [
        {
            "sku": null,
            "upc": null,
            "brand": null,
            "amount": 8000,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": "fafasdfasdfdasdfsadfsadfrewfdscrwefdscerwfdasewfdsacxzfdsasdf",
            "description": null,
            "product_name": "Laptop",
            "product_type": null,
            "sub_category": null,
            "total_amount": null,
            "commodity_code": "8471",
            "unit_of_measure": "EA",
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": 5000,
            "requires_shipping": null,
            "unit_discount_amount": 1200
        },
        {
            "sku": null,
            "upc": null,
            "brand": null,
            "amount": 4000,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": "fas22df",
            "description": null,
            "product_name": "Laptop",
            "product_type": null,
            "sub_category": null,
            "total_amount": null,
            "commodity_code": "471",
            "unit_of_measure": "EA",
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": 3000,
            "requires_shipping": null,
            "unit_discount_amount": 34
        }
    ],
    "email": null,
    "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": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "nithxxinn",
        "created_at": 1758262682,
        "expires": 1758266282,
        "secret": "epk_e62d911ac98c4ccea72189e40ad83af4"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "pay_2667htrzd3qu7bx4fk36nkiva4",
    "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": "pay_v01RncbYqwx0ZtB6x7yV_1",
    "payment_link": null,
    "profile_id": "pro_tqppxjNXH3TckLuEmhDJ",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_z4uydERX9Y3VqfGMXeuh",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-09-19T06:33:02.547Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": "716806996896398",
    "payment_method_status": null,
    "updated": "2025-09-19T06:18:04.255Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": "fasdfasfasf",
    "order_tax_amount": 10000,
    "connector_mandate_id": null,
    "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
}

connector mapping

{
  "source": {
    "type": "card",
    "number": "4000000000009995",
    "expiry_month": "01",
    "expiry_year": "2026",
    "cvv": "100"
  },
  "amount": 40021,
  "currency": "USD",
  "processing_channel_id": "pc_jx5lvimg4obe7nhoqnhptm6xoq",
  "3ds": {
    "enabled": false,
    "force_3ds": false,
    "eci": null,
    "cryptogram": null,
    "xid": null,
    "version": null,
    "challenge_indicator": "no_preference"
  },
  "success_url": "http://localhost:8080/payments/pay_v01RncbYqwx0ZtB6x7yV/merchant_1758258316/redirect/response/checkout?status=success",
  "failure_url": "http://localhost:8080/payments/pay_v01RncbYqwx0ZtB6x7yV/merchant_1758258316/redirect/response/checkout?status=failure",
  "capture": true,
  "reference": "pay_v01RncbYqwx0ZtB6x7yV_1",
  "payment_type": "Regular",
  "merchant_initiated": false,
  "customer": {
    "name": "nithxxinn"
  },
  "processing": {
    "order_id": "fasdfasfasf",
    "tax_amount": 10000,
    "discount_amount": 1,
    "duty_amount": 2,
    "shipping_amount": 21,
    "shipping_tax_amount": 22
  },
  "shipping": {
    "address": {}
  },
  "items": [
    {
      "commodity_code": "8471",
      "discount_amount": 1200,
      "name": "Laptop",
      "quantity": 1,
      "reference": "fafasdfasdfdasdfsadfsadfrewfdscrwefdscerwfdasewfdsacxzfdsasdf",
      "tax_amount": 5000,
      "unit_of_measure": "EA",
      "unit_price": 8000
    },
    {
      "commodity_code": "471",
      "discount_amount": 34,
      "name": "Laptop",
      "quantity": 1,
      "reference": "fas22df",
      "tax_amount": 3000,
      "unit_of_measure": "EA",
      "unit_price": 4000
    }
  ]
}

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

@semanticdiff-com
Copy link

semanticdiff-com bot commented Sep 19, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs  5% smaller

@Nithin1506200 Nithin1506200 changed the title feat(Connector): [NUVEI] l2l3 data feat(Connector): [checkout] l2l3 data Sep 19, 2025
@Nithin1506200 Nithin1506200 self-assigned this Sep 19, 2025
@Nithin1506200 Nithin1506200 linked an issue Sep 19, 2025 that may be closed by this pull request
2 tasks
@Nithin1506200 Nithin1506200 marked this pull request as ready for review September 19, 2025 07:04
@Nithin1506200 Nithin1506200 requested a review from a team as a code owner September 19, 2025 07:04
@likhinbopanna likhinbopanna added this pull request to the merge queue Sep 19, 2025
Merged via the queue into main with commit 744c828 Sep 19, 2025
39 of 45 checks passed
@likhinbopanna likhinbopanna deleted the checkout-l2l3 branch September 19, 2025 12:29
pixincreate added a commit that referenced this pull request Sep 23, 2025
…aysafe-apple-pay

* 'main' of github.com:juspay/hyperswitch:
  feat(connector): [Tokenex] add template code (#9416)
  fix(webhooks): add idempotent_event_id generation using URL-safe Base64 (no padding) and SHA256 digest (#9405)
  feat(core): add webhook setup event handler (#9420)
  chore(version): 2025.09.22.0
  fix(connectors): [Nexixpay] send cvv in nexixpay requests (#9459)
  feat(router): add flag to wait for post message in `threeDSMethodData` for `three_ds_invoke` next action in Payments Confirm (#9454)
  feat(connector): [Paysafe] add wasm changes (#9455)
  feat: Implement subscription create for Chargebee (#9303)
  fix(connector): [CYBERSOURCE] Pass transaction type for only wallet MITs (#9444)
  feat(Connector): [checkout] l2l3 data  (#9446)
  feat(nuvei): applepay decrypt at hyperswitch flow (#9431)
  fix(connectors): [Nuvei] payments, refunds and chargeback webhooks (#9378)
  fix(connector): [ADYEN] Add fallback parsing for refusal codes and messages (#9361)
  feat(connector): Add support for get plan prices for Chargebee (#9300)
  feat(core): Juspay 3DS Server via Payments API (#9433)
  fix(core): Add Validation Check for Amount in Capture Flow (#9434)
  chore(version): 2025.09.19.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] L2-l3 data for checkout

4 participants