Skip to content

feat(connector): [ADYEN] send platform_chargeback_logic in metadata#10175

Merged
Gnanasundari24 merged 3 commits intomainfrom
adyen_metadata
Nov 10, 2025
Merged

feat(connector): [ADYEN] send platform_chargeback_logic in metadata#10175
Gnanasundari24 merged 3 commits intomainfrom
adyen_metadata

Conversation

@Nithin1506200
Copy link
Contributor

@Nithin1506200 Nithin1506200 commented Nov 10, 2025

Type of Change

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

Description

  • Add adyen metadata platform_chargeback_logic for authorize calls,
  • remove the fields which we are using for payload from metadata which is also been passed to adyen

request

{
    "amount": 6500,
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 6500
        }
    ],
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4917610000000000",
            "card_exp_month": "03",
            "card_exp_year": "30",
            // "card_holder_name": "Joseph Doe .",
            "card_cvc": "737"
        }
    },
        "browser_info": {
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "language": "en-GB",
        "color_depth": 24,
        "screen_height": 1117,
        "screen_width": 1728,
        "time_zone": -330,
        "java_enabled": true,
        "java_script_enabled": true,
        "device_model": "Macintosh",
        "os_type": "macOS",
        "os_version": "10.15.7"
    },
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "authentication_type": "no_three_ds",
    "setup_future_usage": "on_session",
    "request_external_three_ds_authentication": false,
    "email": "user@gmail.com",
    "connector": ["adyen"],
    "description": "Hello this is description",
    "shipping": {
        "address": {
            "state": "California",
            "city": "Banglore",
            "country": "US",
            "line1": "sdsdfsdf",
            "line2": "hsgdbhd",
            "line3": "alsksoe",
            "zip": "571201"
            // "first_name": "John",
            // "last_name": "Doe"
        },
        "phone": {
            "number": "123456789",
            "country_code": "+1"
        }
    },
    "connector_metadata": {
        "noon": {
            "order_category": "applepay"
        }
    },
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z",
        "platform_chargeback_logic":{                                                    // pass the metadata
            "behavior":"deductFromOneBalanceAccount",
            "target_account":"BA32C623229D5N45S8QWD",
            "cost_allocation_account":"BA32C623229D5N45S8QWD"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US"
            // "first_name": "joseph",
            // "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },

    "customer_id": "hyperswitch_sdk_demo_id"
}

response

{
    "payment_id": "pay_WFvuKIHrgITyQ8581rX4",
    "merchant_id": "merchant_1762750329",
    "status": "succeeded",
    "amount": 6500,
    "net_amount": 6500,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6500,
    "connector": "adyen",
    "client_secret": "pay_WFvuKIHrgITyQ8581rX4_secret_r8F3zQJeSBt1grvYCDKq",
    "created": "2025-11-10T05:24:08.455Z",
    "currency": "USD",
    "customer_id": "hyperswitch_sdk_demo_id",
    "customer": {
        "id": "hyperswitch_sdk_demo_id",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0000",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "491761",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "30",
            "card_holder_name": null,
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "Banglore",
            "country": "US",
            "line1": "sdsdfsdf",
            "line2": "hsgdbhd",
            "line3": "alsksoe",
            "zip": "571201",
            "state": "California",
            "first_name": null,
            "last_name": null,
            "origin_zip": null
        },
        "phone": {
            "number": "123456789",
            "country_code": "+1"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": null,
            "last_name": null,
            "origin_zip": null
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": [
        {
            "sku": null,
            "upc": null,
            "brand": null,
            "amount": 6500,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "description": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "total_amount": null,
            "commodity_code": null,
            "unit_of_measure": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null,
            "unit_discount_amount": null
        }
    ],
    "email": "user@gmail.com",
    "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": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "hyperswitch_sdk_demo_id",
        "created_at": 1762752248,
        "expires": 1762755848,
        "secret": "epk_cd44ecc677544d6ba0ef9d7e1bcc1768"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "V9NVW86X7RLV3575",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true",
        "platform_chargeback_logic": {
            "behavior": "deductFromOneBalanceAccount",
            "target_account": "BA32C623229D5N45S8QWD",
            "cost_allocation_account": "BA32C623229D5N45S8QWD"
        }
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "applepay"
        },
        "braintree": null,
        "adyen": null
    },
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_WFvuKIHrgITyQ8581rX4_1",
    "payment_link": null,
    "profile_id": "pro_ldelP9YlYkEKRSwe54b0",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_aWndbVNiLHgdeGvy5DsC",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-11-10T05:39:08.455Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": "macOS",
        "language": "en-GB",
        "time_zone": -330,
        "os_version": "10.15.7",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
        "color_depth": 24,
        "device_model": "Macintosh",
        "java_enabled": true,
        "screen_width": 1728,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 1117,
        "java_script_enabled": true
    },
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": "293902151955963",
    "payment_method_status": null,
    "updated": "2025-11-10T05:24:11.211Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "extended_authorization_last_applied_at": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "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,
    "is_stored_credential": null,
    "mit_category": null
}

connector request

{
  "amount": {
    "currency": "USD",
    "value": 6500
  },
  "merchantAccount": "*** alloc::string::String ***",
  "paymentMethod": {
    "type": "scheme",
    "number": "491761**********",
    "expiryMonth": "*** alloc::string::String ***",
    "expiryYear": "*** alloc::string::String ***",
    "cvc": "*** alloc::string::String ***"
  },
  "reference": "pay_nMUrsqTnQNxutbnNyz5H_1",
  "returnUrl": "http://localhost:8080/payments/pay_nMUrsqTnQNxutbnNyz5H/merchant_1762750329/redirect/response/adyen",
  "browserInfo": {
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
    "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "language": "en-GB",
    "colorDepth": 24,
    "screenHeight": 1117,
    "screenWidth": 1728,
    "timeZoneOffset": -330,
    "javaEnabled": true
  },
  "shopperInteraction": "Ecommerce",
  "additionalData": {
    "executeThreeD": "false"
  },
  "shopperReference": "merchant_1762750329_hyperswitch_sdk_demo_id",
  "shopperName": {},
  "shopperLocale": "en",
  "telephoneNumber": "*** alloc::string::String ***",
  "billingAddress": {
    "city": "San Fransico",
    "country": "US",
    "houseNumberOrName": "*** alloc::string::String ***",
    "postalCode": "*** alloc::string::String ***",
    "stateOrProvince": "*** alloc::string::String ***",
    "street": "*** alloc::string::String ***"
  },
  "deliveryAddress": {
    "city": "Banglore",
    "country": "US",
    "houseNumberOrName": "*** alloc::string::String ***",
    "postalCode": "*** alloc::string::String ***",
    "stateOrProvince": "*** alloc::string::String ***",
    "street": "*** alloc::string::String ***"
  },
  "countryCode": "US",
  "metadata": {
    "udf1": "value1",
    "login_date": "2019-09-10T10:11:12Z",
    "new_customer": "true"
  },
  "platformChargebackLogic": {
    "behavior": "deductFromOneBalanceAccount",
    "targetAccount": "*** alloc::string::String ***",
    "costAllocationAccount": "*** alloc::string::String ***"
  }
}

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 Nov 10, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs  27% smaller

@Nithin1506200 Nithin1506200 changed the title updare feat(connector): send platform_chargeback_logic in metada for adyen Nov 10, 2025
@Nithin1506200 Nithin1506200 self-assigned this Nov 10, 2025
@Nithin1506200 Nithin1506200 marked this pull request as ready for review November 10, 2025 05:38
@Nithin1506200 Nithin1506200 requested a review from a team as a code owner November 10, 2025 05:38
@Nithin1506200 Nithin1506200 linked an issue Nov 10, 2025 that may be closed by this pull request
2 tasks
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 0% with 80 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@0b0c6e9). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ch_connectors/src/connectors/adyen/transformers.rs 0.00% 80 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10175   +/-   ##
=======================================
  Coverage        ?    4.05%           
=======================================
  Files           ?     1227           
  Lines           ?   304652           
  Branches        ?        0           
=======================================
  Hits            ?    12368           
  Misses          ?   292284           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@deepanshu-iiitu deepanshu-iiitu changed the title feat(connector): send platform_chargeback_logic in metada for adyen feat(connector): [ADYEN] send platform_chargeback_logic in metadata Nov 10, 2025
pixincreate
pixincreate previously approved these changes Nov 10, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Nov 10, 2025
Merged via the queue into main with commit 484305e Nov 10, 2025
27 of 32 checks passed
@Gnanasundari24 Gnanasundari24 deleted the adyen_metadata branch November 10, 2025 13:35
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] send platform_chargeback_logic in metada for adyen

4 participants