Skip to content

Conversation

@Vani-1107
Copy link
Contributor

@Vani-1107 Vani-1107 commented Oct 16, 2025

Type of Change

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

Description

Providing additional data in the request to improve acceptance rate.
Screenshot 2025-10-16 at 10 28 21 PM

Also, updated the shipping_details and customer details in the L2L3 data.
for instance, earlier we were passing only customer name to the connector, now introduced email and phone field as well in L2L3 data.

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?

Request:


{
    "amount": 1000,
    "currency": "USD",
    "confirm": true,
    "return_url": "https://www.google.com",
    "capture_method": "manual",
    "payment_method": "card",
    "payment_method_type": "credit",
    "all_keys_required": true,
    "authentication_type": "no_three_ds",
    "description": "hellow world",
    "billing": {
        "address": {
            "zip": "560095",
            "country": "US",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "shipping": {
        "address": {
            "zip": "560095",
            "country": "US",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "customer": {
        "phone": "+9112345678911",
        "phone_country_code": "+91",
        "name": "test add",
        "id": "cus_123"
    },
    "browser_info": {
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "ip_address": "192.168.1.1",
        "java_enabled": false,
        "java_script_enabled": true,
        "language": "en-US",
        "color_depth": 24,
        "screen_height": 1080,
        "screen_width": 1920,
        "time_zone": 330,
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
    },
    "email": "[email protected]",
    "payment_method_data": {
        "card": {
            "card_number": "5518207720770101",
            "card_exp_month": "12",
            "card_exp_year": "2027",
            "card_holder_name": "CL-BRW2",
            "card_cvc": "152"
        }
    },
    "customer_acceptance": {
        "acceptance_type": "online",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "business_country": "US",
    "business_label": "default"
}

Response:


{
    "payment_id": "pay_JvOJtuwqiOlJ7yHVBTyy",
    "merchant_id": "merchant_1760633356",
    "status": "succeeded",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 1000,
    "connector": "checkout",
    "client_secret": "pay_JvOJtuwqiOlJ7yHVBTyy_secret_fhZIGS9bPgAtJGRfWLTX",
    "created": "2025-10-16T17:04:06.093Z",
    "currency": "USD",
    "customer_id": "cus_123",
    "customer": {
        "id": "cus_123",
        "name": "test add",
        "email": "[email protected]",
        "phone": "+9112345678911",
        "phone_country_code": "+91"
    },
    "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": "0101",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "551820",
            "card_extended_bin": null,
            "card_exp_month": "12",
            "card_exp_year": "2027",
            "card_holder_name": "CL-BRW2",
            "payment_checks": {
                "avs_result": "S",
                "card_validation_result": "Y"
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "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
    },
    "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": "test add",
    "phone": "+9112345678911",
    "return_url": "https://www.google.com/",
    "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": "checkout_US_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cus_123",
        "created_at": 1760634246,
        "expires": 1760637846,
        "secret": "epk_ea93fb55b25142b3ab26ab1fc7dd603d"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "pay_lv6667qejbaelcu6zfibyrejbu",
    "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_JvOJtuwqiOlJ7yHVBTyy_1",
    "payment_link": null,
    "profile_id": "pro_2PjumL41AY4HLBHK5Fo3",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HHn3Bqjc9tWPC1AXcanW",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-10-16T17:19:06.093Z",
    "fingerprint": null,
    "browser_info": {
        "language": "en-US",
        "time_zone": 330,
        "ip_address": "192.168.1.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
        "color_depth": 24,
        "java_enabled": false,
        "screen_width": 1920,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "screen_height": 1080,
        "java_script_enabled": true
    },
    "payment_channel": null,
    "payment_method_id": "pm_hmOlwS6gaiKgEfiBE7We",
    "network_transaction_id": "506117420731640",
    "payment_method_status": "active",
    "updated": "2025-10-16T17:04:12.532Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "src_4h43kdnzlgsuvorr5kdj2tzzle",
    "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": "{\"id\":\"pay_lv6667qejbaelcu6zfibyrejbu\",\"action_id\":\"act_wdmywknadsyuznn26xyoltwzvm\",\"amount\":1000,\"currency\":\"USD\",\"approved\":true,\"status\":\"Authorized\",\"auth_code\":\"124203\",\"response_code\":\"10000\",\"response_summary\":\"Approved\",\"balances\":{\"total_authorized\":1000,\"total_voided\":0,\"available_to_void\":1000,\"total_captured\":0,\"available_to_capture\":1000,\"total_refunded\":0,\"available_to_refund\":0},\"risk\":{\"flagged\":false},\"source\":{\"id\":\"src_4h43kdnzlgsuvorr5kdj2tzzle\",\"type\":\"card\",\"billing_address\":{\"address_line1\":\"Fasdf\",\"address_line2\":\"Fasdf\",\"city\":\"Fasdf\",\"zip\":\"560095\",\"country\":\"US\"},\"expiry_month\":12,\"expiry_year\":2027,\"scheme\":\"Mastercard\",\"scheme_local\":\"accel\",\"last4\":\"0101\",\"fingerprint\":\"C4DC259BAB2FFA8757C83AA41623A1BDB35A48EB5DBBA38B4423B9D058C77100\",\"bin\":\"55182077\",\"card_type\":\"DEBIT\",\"card_category\":\"CONSUMER\",\"issuer\":\"FISERV SOLUTIONS, LLC\",\"issuer_country\":\"US\",\"product_id\":\"MDS\",\"product_type\":\"Debit Mastercard®\",\"avs_check\":\"S\",\"cvv_check\":\"Y\",\"payment_account_reference\":\"\",\"local_schemes\":[\"accel\"],\"regulated_indicator\":false,\"is_combo_card\":false},\"customer\":{\"id\":\"cus_donkm4lfyaqubfgiur2sfgejti\",\"email\":\"[email protected]\",\"name\":\"test add\",\"phone\":{\"number\":\"+9112345678911\",\"country_code\":\"+91\"}},\"processed_on\":\"2025-10-16T17:04:10.5379905Z\",\"reference\":\"pay_JvOJtuwqiOlJ7yHVBTyy_1\",\"scheme_id\":\"506117420731640\",\"processing\":{\"acquirer_transaction_id\":\"349144378515918151805\",\"retrieval_reference_number\":\"870792115450\",\"merchant_category_code\":\"5815\",\"scheme_merchant_id\":\"75155\",\"scheme\":\"MASTERCARD\",\"partner_response_code\":\"00\",\"aft\":false,\"pan_type_processed\":\"fpan\",\"cko_network_token_available\":false,\"provision_network_token\":false},\"expires_on\":\"2025-11-15T17:04:10.5379905Z\",\"_links\":{\"self\":{\"href\":\"https://api.sandbox.checkout.com/payments/pay_lv6667qejbaelcu6zfibyrejbu\"},\"actions\":{\"href\":\"https://api.sandbox.checkout.com/payments/pay_lv6667qejbaelcu6zfibyrejbu/actions\"},\"capture\":{\"href\":\"https://api.sandbox.checkout.com/payments/pay_lv6667qejbaelcu6zfibyrejbu/captures\"},\"void\":{\"href\":\"https://api.sandbox.checkout.com/payments/pay_lv6667qejbaelcu6zfibyrejbu/voids\"}}}",
    "enable_partial_authorization": true,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}

Screenshot 2025-10-16 at 10 25 08 PM

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

@Vani-1107 Vani-1107 requested review from a team as code owners October 16, 2025 16:03
@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 16, 2025

@Vani-1107 Vani-1107 self-assigned this Oct 16, 2025
@Vani-1107 Vani-1107 added the enhancement New feature or request label Oct 16, 2025
@Vani-1107 Vani-1107 linked an issue Oct 16, 2025 that may be closed by this pull request
2 tasks
@Vani-1107 Vani-1107 force-pushed the checkout-add-additional-fields branch from af13e48 to 23c4948 Compare October 17, 2025 07:49
Comment on lines +137 to +141
pub customer_email: Option<common_utils::pii::Email>,
pub customer_name: Option<Secret<String>>,
pub customer_phone_number: Option<Secret<String>>,
pub customer_phone_country_code: Option<String>,
pub shipping_details: Option<AddressDetails>,
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 structure the L2L3Data to have different structs for customer_details, shipping_details etc instead of having all the fields as part of L2L3Data struct.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that would be better

Copy link
Contributor

Choose a reason for hiding this comment

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

We can take this change in the next PR

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case please create and issue and mention it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here's the issue for it : #9912

@likhinbopanna likhinbopanna added this pull request to the merge queue Oct 17, 2025
Merged via the queue into main with commit a75c890 Oct 17, 2025
23 of 25 checks passed
@likhinbopanna likhinbopanna deleted the checkout-add-additional-fields branch October 17, 2025 13:23
drdholu pushed a commit to drdholu/hyperswitch that referenced this pull request Oct 30, 2025
aadityaguptaa pushed a commit that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] [Checkout] Add additional fields in the request

6 participants