hyperswitch-funcdiff / prs /pr_10108.json
SirajRLX's picture
Add files using upload-large-folder tool
a8cf596 verified
{
"number": 10108,
"title": "feat(store): store id for adyen",
"description": "## Type of Change\r\n<!-- Put an `x` in the boxes that apply -->\r\n\r\n- [ ] Bugfix\r\n- [x] New feature\r\n- [ ] Enhancement\r\n- [ ] Refactoring\r\n- [ ] Dependency updates\r\n- [ ] Documentation\r\n- [ ] CI/CD\r\n\r\n## Description\r\n<!-- Describe your changes in detail -->\r\n We need an arbitary field named store (`metadata.store`) to be passed in adyen payment request and refund request \r\n- create store by menu>in-person payments> store\r\nNOTE 1: SPLIT-payment cannot be tested we will get error as adyen needs to enable this ([related pr](https://github.com/juspay/hyperswitch/issues/6952))\r\nNOTE 2: for split payments we are taking this field from `split_payments.adyen_split_payment.store`, for normal payments we will take from metadata.store\r\n\r\n## TEST CASES\r\n\r\n<details>\r\n<summary> Normal Payments (`metadata.store`) </summary>\r\n\r\n## request\r\n\r\n```json\r\n{\r\n \"amount\": 1000,\r\n \"customer_id\": \"hello_world\",\r\n \"currency\": \"EUR\",\r\n \"connector\": [\r\n \"adyen\"\r\n ],\r\n \"confirm\": true,\r\n \"capture_method\": \"automatic\",\r\n \"payment_method\": \"card\",\r\n \"payment_method_type\": \"credit\",\r\n \"description\": \"hellow world\",\r\n \"billing\": {\r\n \"address\": {\r\n \"zip\": \"560095\",\r\n \"country\": \"US\",\r\n \"first_name\": \"Sakil\",\r\n \"last_name\": \"Mostak\",\r\n \"line1\": \"Fasdf\",\r\n \"line2\": \"Fasdf\",\r\n \"city\": \"Fasdf\"\r\n }\r\n },\r\n \"payment_method_data\": {\r\n \"card\": {\r\n \"card_number\": \"4111111111111111\",\r\n \"card_exp_month\": \"03\",\r\n \"card_exp_year\": \"30\",\r\n \"card_holder_name\": \"John Doe\",\r\n \"card_cvc\": \"737\"\r\n }\r\n },\r\n \"metadata\": {\r\n \"store\":\"ST3298F22322955NDWVDWCWG6\"\r\n },\r\n \"browser_info\": {\r\n \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\",\r\n \"ip_address\": \"192.168.1.1\",\r\n \"java_enabled\": false,\r\n \"java_script_enabled\": true,\r\n \"language\": \"en-US\",\r\n \"color_depth\": 24,\r\n \"screen_height\": 1080,\r\n \"screen_width\": 1920,\r\n \"time_zone\": 330,\r\n \"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\"\r\n }\r\n}\r\n```\r\n\r\n## connector request\r\n\r\n```json\r\n raw_connector_request: Object {\"amount\": Object {\"currency\": String(\"EUR\"), \"value\": Number(1000)}, \"merchantAccount\": String(\"*** alloc::string::String ***\"), \"paymentMethod\": Object {\"type\": String(\"scheme\"), \"number\": String(\"411111**********\"), \"expiryMonth\": String(\"*** alloc::string::String ***\"), \"expiryYear\": String(\"*** alloc::string::String ***\"), \"cvc\": String(\"*** alloc::string::String ***\"), \"holderName\": String(\"*** alloc::string::String ***\"), \"brand\": String(\"visa\")}, \"reference\": String(\"pay_ZfCNj8uPeJmEcoVfswf5_1\"), \"returnUrl\": String(\"http://localhost:8080/payments/pay_ZfCNj8uPeJmEcoVfswf5/merchant_1762169799/redirect/response/adyen\"), \"browserInfo\": Object {\"userAgent\": String(\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"), \"acceptHeader\": String(\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\"), \"language\": String(\"en-US\"), \"colorDepth\": Number(24), \"screenHeight\": Number(1080), \"screenWidth\": Number(1920), \"timeZoneOffset\": Number(330), \"javaEnabled\": Bool(false)}, \"shopperInteraction\": String(\"Ecommerce\"), \"additionalData\": Object {\"executeThreeD\": String(\"false\")}, \"shopperReference\": String(\"merchant_1762169799_hello_world\"), \"shopperName\": Object {\"firstName\": String(\"*** alloc::string::String ***\"), \"lastName\": String(\"*** alloc::string::String ***\")}, \"shopperIP\": String(\"192.**.**.**\"), \"shopperLocale\": String(\"en\"), \"billingAddress\": Object {\"city\": String(\"Fasdf\"), \"country\": String(\"US\"), \"houseNumberOrName\": String(\"*** alloc::string::String ***\"), \"postalCode\": String(\"*** alloc::string::String ***\"), \"street\": String(\"*** alloc::string::String ***\")}, \"countryCode\": String(\"US\"), \"splits\": Array [Object {\"amount\": Object {\"currency\": String(\"EUR\"), \"value\": Number(500)}, \"type\": String(\"BalanceAccount\"), \"account\": String(\"BA32CKZ223228H5LRZSTV7DB7\"), \"reference\": String(\"0.2980249078510626_1\"), \"description\": Null}, Object {\"amount\": Object {\"currency\": String(\"EUR\"), \"value\": Number(500)}, \"type\": String(\"Commission\"), \"account\": Null, \"reference\": String(\"0.2980249078510626_2\"), \"description\": Null}, Object {\"amount\": Object {\"currency\": String(\"EUR\"), \"value\": Number(0)}, \"type\": String(\"PaymentFee\"), \"account\": String(\"BA32272223222H5HRD2MBBFSM\"), \"reference\": String(\"0.2980249078510626_3\"), \"description\": String(\"Payment fees\")}], \"store\": String(\"ST3298F22322955NDWVDWCWG6\")}\r\n\r\n// store being passed\r\n```\r\n\r\n### response\r\n\r\n```json\r\n{\r\n \"payment_id\": \"pay_mytXqc3EST2PFIwevvPG\",\r\n \"merchant_id\": \"merchant_1762169799\",\r\n \"status\": \"succeeded\",\r\n \"amount\": 1000,\r\n \"net_amount\": 1000,\r\n \"shipping_cost\": null,\r\n \"amount_capturable\": 0,\r\n \"amount_received\": 1000,\r\n \"connector\": \"adyen\",\r\n \"client_secret\": \"pay_mytXqc3EST2PFIwevvPG_secret_RZSsPgQoALaB8peBKRcf\",\r\n \"created\": \"2025-11-03T12:14:36.762Z\",\r\n \"currency\": \"EUR\",\r\n \"customer_id\": \"hello_world\",\r\n \"customer\": {\r\n \"id\": \"hello_world\",\r\n \"name\": null,\r\n \"email\": null,\r\n \"phone\": null,\r\n \"phone_country_code\": null\r\n },\r\n \"description\": \"hellow world\",\r\n \"refunds\": null,\r\n \"disputes\": null,\r\n \"mandate_id\": null,\r\n \"mandate_data\": null,\r\n \"setup_future_usage\": null,\r\n \"off_session\": null,\r\n \"capture_on\": null,\r\n \"capture_method\": \"automatic\",\r\n \"payment_method\": \"card\",\r\n \"payment_method_data\": {\r\n \"card\": {\r\n \"last4\": \"1111\",\r\n \"card_type\": \"CREDIT\",\r\n \"card_network\": \"Visa\",\r\n \"card_issuer\": \"JP Morgan\",\r\n \"card_issuing_country\": \"INDIA\",\r\n \"card_isin\": \"411111\",\r\n \"card_extended_bin\": null,\r\n \"card_exp_month\": \"03\",\r\n \"card_exp_year\": \"30\",\r\n \"card_holder_name\": \"John Doe\",\r\n \"payment_checks\": null,\r\n \"authentication_data\": null\r\n },\r\n \"billing\": null\r\n },\r\n \"payment_token\": null,\r\n \"shipping\": null,\r\n \"billing\": {\r\n \"address\": {\r\n \"city\": \"Fasdf\",\r\n \"country\": \"US\",\r\n \"line1\": \"Fasdf\",\r\n \"line2\": \"Fasdf\",\r\n \"line3\": null,\r\n \"zip\": \"560095\",\r\n \"state\": null,\r\n \"first_name\": \"Sakil\",\r\n \"last_name\": \"Mostak\",\r\n \"origin_zip\": null\r\n },\r\n \"phone\": null,\r\n \"email\": null\r\n },\r\n \"order_details\": null,\r\n \"email\": null,\r\n \"name\": null,\r\n \"phone\": null,\r\n \"return_url\": null,\r\n \"authentication_type\": \"no_three_ds\",\r\n \"statement_descriptor_name\": null,\r\n \"statement_descriptor_suffix\": null,\r\n \"next_action\": null,\r\n \"cancellation_reason\": null,\r\n \"error_code\": null,\r\n \"error_message\": null,\r\n \"unified_code\": null,\r\n \"unified_message\": null,\r\n \"payment_experience\": null,\r\n \"payment_method_type\": \"credit\",\r\n \"connector_label\": null,\r\n \"business_country\": null,\r\n \"business_label\": \"default\",\r\n \"business_sub_label\": null,\r\n \"allowed_payment_method_types\": null,\r\n \"ephemeral_key\": {\r\n \"customer_id\": \"hello_world\",\r\n \"created_at\": 1762172076,\r\n \"expires\": 1762175676,\r\n \"secret\": \"epk_20f76d2ca16949529f36ab961c7b9996\"\r\n },\r\n \"manual_retry_allowed\": null,\r\n \"connector_transaction_id\": \"H6WPZRHWSJBH3275\",\r\n \"frm_message\": null,\r\n \"metadata\": {\r\n \"store\": \"ST3298F22322955NDWVDWCWG6\"\r\n },\r\n \"connector_metadata\": null,\r\n \"feature_metadata\": {\r\n \"redirect_response\": null,\r\n \"search_tags\": null,\r\n \"apple_pay_recurring_details\": null,\r\n \"gateway_system\": \"direct\"\r\n },\r\n \"reference_id\": \"pay_mytXqc3EST2PFIwevvPG_1\",\r\n \"payment_link\": null,\r\n \"profile_id\": \"pro_AlrOEedUTS0P12YvfA3M\",\r\n \"surcharge_details\": null,\r\n \"attempt_count\": 1,\r\n \"merchant_decision\": null,\r\n \"merchant_connector_id\": \"mca_nLzFD4WPAIZMbssaiHQf\",\r\n \"incremental_authorization_allowed\": false,\r\n \"authorization_count\": null,\r\n \"incremental_authorizations\": null,\r\n \"external_authentication_details\": null,\r\n \"external_3ds_authentication_attempted\": false,\r\n \"expires_on\": \"2025-11-03T12:29:36.762Z\",\r\n \"fingerprint\": null,\r\n \"browser_info\": {\r\n \"language\": \"en-US\",\r\n \"time_zone\": 330,\r\n \"ip_address\": \"192.168.1.1\",\r\n \"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\",\r\n \"color_depth\": 24,\r\n \"java_enabled\": false,\r\n \"screen_width\": 1920,\r\n \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\",\r\n \"screen_height\": 1080,\r\n \"java_script_enabled\": true\r\n },\r\n \"payment_channel\": null,\r\n \"payment_method_id\": null,\r\n \"network_transaction_id\": \"366589793729776\",\r\n \"payment_method_status\": null,\r\n \"updated\": \"2025-11-03T12:14:39.495Z\",\r\n \"split_payments\": null,\r\n \"frm_metadata\": null,\r\n \"extended_authorization_applied\": null,\r\n \"request_extended_authorization\": null,\r\n \"capture_before\": null,\r\n \"merchant_order_reference_id\": null,\r\n \"order_tax_amount\": null,\r\n \"connector_mandate_id\": null,\r\n \"card_discovery\": \"manual\",\r\n \"force_3ds_challenge\": false,\r\n \"force_3ds_challenge_trigger\": false,\r\n \"issuer_error_code\": null,\r\n \"issuer_error_message\": null,\r\n \"is_iframe_redirection_enabled\": null,\r\n \"whole_connector_response\": null,\r\n \"enable_partial_authorization\": null,\r\n \"enable_overcapture\": null,\r\n \"is_overcapture_enabled\": null,\r\n \"network_details\": null,\r\n \"is_stored_credential\": null,\r\n \"mit_category\": null\r\n}\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n<summary> Split payment (`split_payments.adyen_split_payment.store`) </summary>\r\n\r\n## request\r\n\r\n```json\r\n{\r\n \"amount\": 1000,\r\n \"customer_id\": \"hello_world\",\r\n \"currency\": \"EUR\",\r\n \"connector\": [\r\n \"adyen\"\r\n ],\r\n \"confirm\": true,\r\n \"capture_method\": \"automatic\",\r\n \"payment_method\": \"card\",\r\n \"payment_method_type\": \"credit\",\r\n \"description\": \"hellow world\",\r\n \"billing\": {\r\n \"address\": {\r\n \"zip\": \"560095\",\r\n \"country\": \"US\",\r\n \"first_name\": \"Sakil\",\r\n \"last_name\": \"Mostak\",\r\n \"line1\": \"Fasdf\",\r\n \"line2\": \"Fasdf\",\r\n \"city\": \"Fasdf\"\r\n }\r\n },\r\n \"payment_method_data\": {\r\n \"card\": {\r\n \"card_number\": \"4111111111111111\",\r\n \"card_exp_month\": \"03\",\r\n \"card_exp_year\": \"30\",\r\n \"card_holder_name\": \"John Doe\",\r\n \"card_cvc\": \"737\"\r\n }\r\n },\r\n \"split_payments\": {\r\n \"adyen_split_payment\": {\r\n \"store\": \"ST3298F22322955NDWVDWCWG6\",\r\n \"split_items\": [\r\n {\r\n \"amount\": 500,\r\n \"split_type\": \"BalanceAccount\",\r\n \"account\": \"BA32CKZ223228H5LRZSTV7DB7\",\r\n \"reference\": \"0.2980249078510626_1\"\r\n },\r\n {\r\n \"amount\": 500,\r\n \"split_type\": \"Commission\",\r\n \"reference\": \"0.2980249078510626_2\"\r\n },\r\n {\r\n \"amount\": 0,\r\n \"split_type\": \"PaymentFee\",\r\n \"account\": \"BA32272223222H5HRD2MBBFSM\",\r\n \"reference\": \"0.2980249078510626_3\",\r\n \"description\": \"Payment fees\"\r\n }\r\n ]\r\n }\r\n },\r\n // \"metadata\": {\r\n // \"store\":\"4935y84385736\"\r\n // },\r\n \"browser_info\": {\r\n \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\",\r\n \"ip_address\": \"192.168.1.1\",\r\n \"java_enabled\": false,\r\n \"java_script_enabled\": true,\r\n \"language\": \"en-US\",\r\n \"color_depth\": 24,\r\n \"screen_height\": 1080,\r\n \"screen_width\": 1920,\r\n \"time_zone\": 330,\r\n \"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\"\r\n }\r\n}\r\n```\r\n\r\n## connector request\r\n\r\n```json\r\nINFO hyperswitch_interfaces::api_client: raw_connector_request: Object {\"amount\": Object {\"currency\": String(\"EUR\"), \"value\": Number(1000)}, \"merchantAccount\": String(\"*** alloc::string::String ***\"), \"paymentMethod\": Object {\"type\": String(\"scheme\"), \"number\": String(\"411111**********\"), \"expiryMonth\": String(\"*** alloc::string::String ***\"), \"expiryYear\": String(\"*** alloc::string::String ***\"), \"cvc\": String(\"*** alloc::string::String ***\"), \"holderName\": String(\"*** alloc::string::String ***\"), \"brand\": String(\"visa\")}, \"reference\": String(\"pay_k7CUtTkbOFDpxPC2bs2m_1\"), \"returnUrl\": String(\"http://localhost:8080/payments/pay_k7CUtTkbOFDpxPC2bs2m/merchant_1762169799/redirect/response/adyen\"), \"browserInfo\": Object {\"userAgent\": String(\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"), \"acceptHeader\": String(\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\"), \"language\": String(\"en-US\"), \"colorDepth\": Number(24), \"screenHeight\": Number(1080), \"screenWidth\": Number(1920), \"timeZoneOffset\": Number(330), \"javaEnabled\": Bool(false)}, \"shopperInteraction\": String(\"Ecommerce\"), \"additionalData\": Object {\"executeThreeD\": String(\"false\")}, \"shopperReference\": String(\"merchant_1762169799_hello_world\"), \"shopperName\": Object {\"firstName\": String(\"*** alloc::string::String ***\"), \"lastName\": String(\"*** alloc::string::String ***\")}, \"shopperIP\": String(\"192.**.**.**\"), \"shopperLocale\": String(\"en\"), \"billingAddress\": Object {\"city\": String(\"Fasdf\"), \"country\": String(\"US\"), \"houseNumberOrName\": String(\"*** alloc::string::String ***\"), \"postalCode\": String(\"*** alloc::string::String ***\"), \"street\": String(\"*** alloc::string::String ***\")}, \"countryCode\": String(\"US\"), \"splits\": Array [Object {\"amount\": Object {\"currency\": String(\"EUR\"), \"value\": Number(500)}, \"type\": String(\"BalanceAccount\"), \"account\": String(\"BA32CKZ223228H5LRZSTV7DB7\"), \"reference\": String(\"0.2980249078510626_1\"), \"description\": Null}, Object {\"amount\": Object {\"currency\": String(\"EUR\"), \"value\": Number(500)}, \"type\": String(\"Commission\"), \"account\": Null, \"reference\": String(\"0.2980249078510626_2\"), \"description\": Null}, Object {\"amount\": Object {\"currency\": String(\"EUR\"), \"value\": Number(0)}, \"type\": String(\"PaymentFee\"), \"account\": String(\"BA32272223222H5HRD2MBBFSM\"), \"reference\": String(\"0.2980249078510626_3\"), \"description\": String(\"Payment fees\")}], \"store\": String(\"xxxxxxddddddddd\")}\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n<summary> REFUND (metadata.store)</summary>\r\n\r\n## request \r\n\r\n```json\r\n{\r\n \"payment_id\": \"{{payment_id}}\",\r\n \"amount\":200,\r\n \"metadata\":{\"store\":\"ST3298F22322955NDWVDWCWG6\"}\r\n}\r\n```\r\n## connector request\r\n\r\n```json\r\n Object {\"merchantAccount\": String(\"*** alloc::string::String ***\"), \"amount\": Object {\"currency\": String(\"EUR\"), \"value\": Number(200)}, \"reference\": String(\"ref_3uMyyahlpMDkl1gkEqOV\"), \"store\": String(\"ST3298F22322955NDWVDWCWG6\")}\r\n```\r\n\r\n## response\r\n\r\n```json\r\n{\r\n \"refund_id\": \"ref_3uMyyahlpMDkl1gkEqOV\",\r\n \"payment_id\": \"pay_IveyzhbBIzF58qDDlbmK\",\r\n \"amount\": 200,\r\n \"currency\": \"EUR\",\r\n \"status\": \"succeeded\",\r\n \"reason\": null,\r\n \"metadata\": {\r\n \"store\": \"ST3298F22322955NDWVDWCWG6\"\r\n },\r\n \"error_message\": null,\r\n \"error_code\": null,\r\n \"unified_code\": null,\r\n \"unified_message\": null,\r\n \"created_at\": \"2025-11-03T12:26:44.581Z\",\r\n \"updated_at\": \"2025-11-03T12:26:45.157Z\",\r\n \"connector\": \"adyen\",\r\n \"profile_id\": \"pro_AlrOEedUTS0P12YvfA3M\",\r\n \"merchant_connector_id\": \"mca_nLzFD4WPAIZMbssaiHQf\",\r\n \"split_refunds\": null,\r\n \"issuer_error_code\": null,\r\n \"issuer_error_message\": null\r\n}\r\n```\r\n\r\n## a\r\n\r\n\r\n</details>\r\n\r\n### Additional Changes\r\n\r\n- [ ] This PR modifies the API contract\r\n- [ ] This PR modifies the database schema\r\n- [ ] This PR modifies application configuration/environment variables\r\n\r\n<!--\r\nProvide links to the files with corresponding changes.\r\n\r\nFollowing are the paths where you can find config files:\r\n1. `config`\r\n2. `crates/router/src/configs`\r\n3. `loadtest/config`\r\n-->\r\n\r\n\r\n## Motivation and Context\r\n<!--\r\nWhy is this change required? What problem does it solve?\r\nIf it fixes an open issue, please link to the issue here.\r\n\r\nIf you don't have an issue, we'd recommend starting with one first so the PR\r\ncan focus on the implementation (unless it is an obvious bug or documentation fix\r\nthat will have little conversation).\r\n-->\r\n\r\n\r\n## How did you test it?\r\n<!--\r\nDid you write an integration/unit/API test to verify the code changes?\r\nOr did you test this change manually (provide relevant screenshots)?\r\n-->\r\n\r\n\r\n## Checklist\r\n<!-- Put an `x` in the boxes that apply -->\r\n\r\n- [x] I formatted the code `cargo +nightly fmt --all`\r\n- [ ] I addressed lints thrown by `cargo clippy`\r\n- [ ] I reviewed the submitted code\r\n- [ ] I added unit tests for my changes where possible\r\n",
"author": "Nithin1506200",
"created_at": "2025-11-03T11:56:33+00:00",
"merged_at": "2025-11-04T07:20:56+00:00",
"base_branch": "main",
"labels": [
"A-connector-integration"
],
"url": "https://github.com/juspay/hyperswitch/pull/10108",
"commits": [
{
"sha": "3ce43ce77bc118bdd36d0ff36684f89feed932bd",
"message": "feat(store): store id for adyen",
"author": "nihtin",
"date": "2025-11-03T11:48:11+00:00",
"url": "https://github.com/juspay/hyperswitch/commit/3ce43ce77bc118bdd36d0ff36684f89feed932bd"
}
]
}