Skip to content

feat(connector): add support of passing metadata in adyen payment request#8871

Merged
likhinbopanna merged 1 commit intomainfrom
adyen-metadata
Aug 11, 2025
Merged

feat(connector): add support of passing metadata in adyen payment request#8871
likhinbopanna merged 1 commit intomainfrom
adyen-metadata

Conversation

@swangi-kumari
Copy link
Contributor

@swangi-kumari swangi-kumari commented Aug 8, 2025

Type of Change

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

Description

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?

Make a adyen payment request by passing metadata

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_gfSvA66FtTOYRAET2roFlwpZII7Im5qV58tVCQ8nmgfvCGW34H7KOatZrmImGpJi' \
--data-raw '{
    "amount": 1000,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 1000,
    "customer_id": "StripeCustomer",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://duck.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4917610000000000",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "737"
        }
    },
    "metadata": {
        "order_id": "ORD-12345",
        "customer_segment": "premium",
        "purchase_platform": "web_store"
    },
    "routing": {
        "type": "single",
        "data": "adyen"
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "merchant_order_reference_id" : "order_narvar12",
     "browser_info": {
    "os_type": "macOS",
    "language": "en-GB",
    "time_zone": -330,
    "ip_address": "103.159.11.202",
    "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/132.0.0.0 Safari/537.36",
    "color_depth": 24,
    "device_model": "Macintosh",
    "java_enabled": true,
    "screen_width": 1920,
    "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "screen_height": 1080,
    "accept_language": "en",
    "java_script_enabled": true
  },
    "profile_id": "pro_16j8JOCurimvr2XXG9EE"
}'

Response

{
    "payment_id": "pay_hzlcxXX8nyJI66W4kWqV",
    "merchant_id": "merchant_1754636642",
    "status": "requires_customer_action",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 1000,
    "amount_received": null,
    "connector": "adyen",
    "client_secret": "pay_hzlcxXX8nyJI66W4kWqV_secret_nCpTSGcFPShUZCI00wx1",
    "created": "2025-08-08T07:04:25.612Z",
    "currency": "USD",
    "customer_id": "StripeCustomer",
    "customer": {
        "id": "StripeCustomer",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "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": "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": "2030",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null,
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null,
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_hzlcxXX8nyJI66W4kWqV/merchant_1754636642/pay_hzlcxXX8nyJI66W4kWqV_1"
    },
    "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": "StripeCustomer",
        "created_at": 1754636665,
        "expires": 1754640265,
        "secret": "epk_4fc117f853654c8289fb1024aa8dbeed"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "SPD59ZTRRZ9TPM75",
    "frm_message": null,
    "metadata": {
        "order_id": "ORD-12345",
        "customer_segment": "premium",
        "purchase_platform": "web_store"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "SPD59ZTRRZ9TPM75",
    "payment_link": null,
    "profile_id": "pro_BkMsi4kLNDDn7Occ4u2v",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_hwPRKWHa1C2kQQ9Y86sr",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-08-08T07:19:25.612Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": "macOS",
        "language": "en-GB",
        "time_zone": -330,
        "ip_address": "103.159.11.202",
        "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/132.0.0.0 Safari/537.36",
        "color_depth": 24,
        "device_model": "Macintosh",
        "java_enabled": true,
        "screen_width": 1920,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 1080,
        "accept_language": "en",
        "java_script_enabled": true
    },
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-08-08T07:04:26.048Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": "order_narvar12",
    "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
}

In adyen dashboard it should show up like this:
Screenshot 2025-08-08 at 12 50 13 PM

Cypress test
Screenshot 2025-08-08 at 8 36 49 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

@swangi-kumari swangi-kumari self-assigned this Aug 8, 2025
@swangi-kumari swangi-kumari added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Aug 8, 2025
@swangi-kumari swangi-kumari requested a review from a team as a code owner August 8, 2025 07:20
@semanticdiff-com
Copy link

semanticdiff-com bot commented Aug 8, 2025

Review changes with  SemanticDiff

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

@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 11, 2025
Merged via the queue into main with commit 4434bf1 Aug 11, 2025
23 of 29 checks passed
@likhinbopanna likhinbopanna deleted the adyen-metadata branch August 11, 2025 10:19
pixincreate added a commit that referenced this pull request Aug 12, 2025
… into feat/mockserver-creds

* 'feat/mockserver-creds' of github.com:juspay/hyperswitch:
  fix(connector): [NETCETERA] add fixes for authentication response fields (#8907)
  feat(payouts): add payout webhooks for Paypal and Wise (#8888)
  feat(ucs): add gateway system {Direct | UnifiedConnectorSystem} in feature metadata for v1 (#8854)
  feat(router): Add new api for delete tokenization record (#8361)
  feat(connector): add support of passing metadata in adyen payment request (#8871)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: add support of passing metadata in adyen payment request

4 participants