Skip to content

fix(connector): [CYBERSOURCE] Passing pares_status for MasterCard & Visa and transaction_type field#8518

Merged
Gnanasundari24 merged 2 commits intomainfrom
flowbird/gpay/fix
Jul 3, 2025
Merged

fix(connector): [CYBERSOURCE] Passing pares_status for MasterCard & Visa and transaction_type field#8518
Gnanasundari24 merged 2 commits intomainfrom
flowbird/gpay/fix

Conversation

@bsayak03
Copy link
Contributor

@bsayak03 bsayak03 commented Jul 2, 2025

Type of Change

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

Description

Passing a field transaction_type as 3 if its an MIT. For all others, we should be passing 1.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Ref Doc : https://developer.cybersource.com/api-reference-assets/index.html#payments
https://docs.cybersource.com/content/dam/new-documentation/documentation/en/reference/api-fields/api-fields-so.pdf
Page : 1127

How did you test it?

  1. Payments Create - Cards (No3DS)

cURL:

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_0CBr33MgzjRaqH4yI6Y6DGxzptpf3M54jmkfo3lEk4hHuQ3k1QNvtqZOh7ULkhRY' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
    "amount": 700,
    "currency": "EUR",
    "connector": ["cybersource"],
    "confirm": true,
    "payment_link": false,
    "capture_on": "2029-09-10T10:11:12Z",
    "amount_to_capture": 700,
    "name": "John Doe",
    "email": "dg@example.com",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method_data": {
        "card": {
            "card_number": "4111111111111111",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "737",
            "card_network": "VISA"
        },
        "billing": {
            "address": {
                "line1": "1467",
                "line2": "CA",
                "city": "Thise",
                "state": "Alsace",
                "zip": "94122",
                "country": "FR",
                "first_name": "Henry",
                "last_name": "Henry"
            }
        }
    },
    "payment_method": "card",
    "payment_method_type": "credit",
    "browser_info": {
        "color_depth": 24,
        "java_enabled": true,
        "java_script_enabled": true,
        "language": "en-GB",
        "screen_height": 720,
        "screen_width": 1280,
        "time_zone": -330,
        "ip_address": "208.127.127.193",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0"
    },
    "metadata": {
        "disable_avs": true,
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "order_details": [
        {
            "product_name": "Tea",
            "quantity": 1,
            "amount": 110,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
        },
        {
            "product_name": "Tea",
            "quantity": 1,
            "amount": 110,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
        },
        {
            "product_name": "Tea",
            "quantity": 1,
            "amount": 110,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
        }
    ]
}'

Response:

{
    "payment_id": "pay_rh1sY8fgwzktQ9zOM2tA",
    "merchant_id": "merchant_1751445775",
    "status": "succeeded",
    "amount": 700,
    "net_amount": 700,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 700,
    "connector": "cybersource",
    "client_secret": "pay_rh1sY8fgwzktQ9zOM2tA_secret_rZDNCoAO6rZIx3nash1P",
    "created": "2025-07-02T09:08:34.095Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": "John Doe",
        "email": "dg@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": null,
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "411111",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": {
            "address": {
                "city": "Thise",
                "country": "FR",
                "line1": "1467",
                "line2": "CA",
                "line3": null,
                "zip": "94122",
                "state": "Alsace",
                "first_name": "Henry",
                "last_name": "Henry"
            },
            "phone": null,
            "email": null
        }
    },
    "payment_token": "token_ZCtYEfGsQUNKjmTx2OY2",
    "shipping": null,
    "billing": null,
    "order_details": [
        {
            "brand": null,
            "amount": 110,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Tea",
            "product_type": null,
            "sub_category": null,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg",
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        },
        {
            "brand": null,
            "amount": 110,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Tea",
            "product_type": null,
            "sub_category": null,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg",
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        },
        {
            "brand": null,
            "amount": 110,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Tea",
            "product_type": null,
            "sub_category": null,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg",
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://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": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "7514473165356444603814",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "disable_avs": true,
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_rh1sY8fgwzktQ9zOM2tA_1",
    "payment_link": null,
    "profile_id": "pro_1FbCCLIMKSjSmhmaMQlX",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_YJ9hAq1kQMV5R69nEjbx",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-02T09:23:34.095Z",
    "fingerprint": null,
    "browser_info": {
        "language": "en-GB",
        "time_zone": -330,
        "ip_address": "208.127.127.193",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1280,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 720,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-07-02T09:08:37.410Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
  1. Payments Create - Cards (3DS)

cURL :

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_0CBr33MgzjRaqH4yI6Y6DGxzptpf3M54jmkfo3lEk4hHuQ3k1QNvtqZOh7ULkhRY' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
    "amount": 700,
    "all_keys_required": true,
    "currency": "EUR",
    "connector": ["cybersource"],
    "confirm": true,
    "payment_link": false,
    "capture_on": "2029-09-10T10:11:12Z",
    "amount_to_capture": 700,
    "name": "John Doe",
    "email": "dg@example.com",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://google.com",
    "payment_method_data": {
        "card": {
            "card_number": "4111111111111111",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "737",
            "card_network": "VISA"
        },
        "billing": {
            "address": {
                "line1": "1467",
                "line2": "CA",
                "city": "Thise",
                "state": "Alsace",
                "zip": "94122",
                "country": "FR",
                "first_name": "Henry",
                "last_name": "Henry"
            },
            "email": "dg@example.com"
        }
    },
    "payment_method": "card",
    "payment_method_type": "credit",
    "browser_info": {
        "color_depth": 24,
        "java_enabled": true,
        "java_script_enabled": true,
        "language": "en-GB",
        "screen_height": 720,
        "screen_width": 1280,
        "time_zone": -330,
        "ip_address": "208.127.127.193",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0"
    },
    "metadata": {
        "disable_avs": true,
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "order_details": [
        {
            "product_name": "Tea",
            "quantity": 1,
            "amount": 110,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
        },
        {
            "product_name": "Tea",
            "quantity": 1,
            "amount": 110,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
        },
        {
            "product_name": "Tea",
            "quantity": 1,
            "amount": 110,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
        }
    ]
}'

Response:

{
    "payment_id": "pay_3S7sbyK7jVYKhebf46st",
    "merchant_id": "merchant_1751445775",
    "status": "requires_customer_action",
    "amount": 700,
    "net_amount": 700,
    "shipping_cost": null,
    "amount_capturable": 700,
    "amount_received": null,
    "connector": "cybersource",
    "client_secret": "pay_3S7sbyK7jVYKhebf46st_secret_sQTGhIQOjbSSsm6pvrsX",
    "created": "2025-07-02T10:15:06.478Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": "John Doe",
        "email": "dg@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": null,
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "411111",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": {
                "city": "Thise",
                "country": "FR",
                "line1": "1467",
                "line2": "CA",
                "line3": null,
                "zip": "94122",
                "state": "Alsace",
                "first_name": "Henry",
                "last_name": "Henry"
            },
            "phone": null,
            "email": "dg@example.com"
        }
    },
    "payment_token": "token_gG1QXJu61AKGMj6hm8VE",
    "shipping": null,
    "billing": null,
    "order_details": [
        {
            "brand": null,
            "amount": 110,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Tea",
            "product_type": null,
            "sub_category": null,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg",
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        },
        {
            "brand": null,
            "amount": 110,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Tea",
            "product_type": null,
            "sub_category": null,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg",
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        },
        {
            "brand": null,
            "amount": 110,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Tea",
            "product_type": null,
            "sub_category": null,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg",
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_3S7sbyK7jVYKhebf46st/merchant_1751445775/pay_3S7sbyK7jVYKhebf46st_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": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "disable_avs": true,
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_3S7sbyK7jVYKhebf46st_1",
    "payment_link": null,
    "profile_id": "pro_1FbCCLIMKSjSmhmaMQlX",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_YJ9hAq1kQMV5R69nEjbx",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-02T10:30:06.478Z",
    "fingerprint": null,
    "browser_info": {
        "language": "en-GB",
        "time_zone": -330,
        "ip_address": "208.127.127.193",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1280,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 720,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-07-02T10:15:08.432Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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": "{\"clientReferenceInformation\":{\"code\":\"pay_3S7sbyK7jVYKhebf46st_1\"},\"consumerAuthenticationInformation\":{\"accessToken\":\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyYmY2ZDAxMi1iZmFlLTQyNDktOTk3NC02MDIzOTRjMjQwMTgiLCJpYXQiOjE3NTE0NTEzMDgsImlzcyI6IjVkZDgzYmYwMGU0MjNkMTQ5OGRjYmFjYSIsImV4cCI6MTc1MTQ1NDkwOCwiT3JnVW5pdElkIjoiNjU1MmIzMGEwOTE4ZTE1MzYwNDc3ODI3IiwiUmVmZXJlbmNlSWQiOiI0NzFkZTVlNy00ZjllLTRjNTYtYmMyYi02NmNlMmViMzJkOTEifQ.TW6DK0wgy_j0AcX7ZSh0UdB1u4U75iCWEK7J3pqJxVA\",\"deviceDataCollectionUrl\":\"https://centinelapistag.cardinalcommerce.com/V1/Cruise/Collect\",\"referenceId\":\"471de5e7-4f9e-4c56-bc2b-66ce2eb32d91\",\"token\":\"AxizbwSTl1zRaWWyjoiEABsBT35lpinAAofwyaSZejGB8p2AmAAAlQtd\"},\"id\":\"7514513080806917703812\",\"status\":\"COMPLETED\",\"submitTimeUtc\":\"2025-07-02T10:15:08Z\"}"
}

PSync :

cURL :

curl --location 'http://localhost:8080/payments/pay_eVx6DvluTIQV9nMovfQ0?force_sync=true&expand_captures=true&expand_attempts=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_0CBr33MgzjRaqH4yI6Y6DGxzptpf3M54jmkfo3lEk4hHuQ3k1QNvtqZOh7ULkhRY' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7'

Response:

{
    "payment_id": "pay_eVx6DvluTIQV9nMovfQ0",
    "merchant_id": "merchant_1751445775",
    "status": "succeeded",
    "amount": 700,
    "net_amount": 700,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 700,
    "connector": "cybersource",
    "client_secret": "pay_eVx6DvluTIQV9nMovfQ0_secret_B00V3JAIxUIrm0Y8M1tn",
    "created": "2025-07-02T10:09:11.212Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": "John Doe",
        "email": "dg@example.com",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_eVx6DvluTIQV9nMovfQ0_1",
            "status": "charged",
            "amount": 700,
            "order_tax_amount": null,
            "currency": "EUR",
            "connector": "cybersource",
            "error_message": null,
            "payment_method": "card",
            "connector_transaction_id": "7514509619876883203813",
            "capture_method": null,
            "authentication_type": "three_ds",
            "created_at": "2025-07-02T10:09:11.213Z",
            "modified_at": "2025-07-02T10:09:23.026Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": "token_sc41ktlbdzim67t6PPyr",
            "connector_metadata": null,
            "payment_experience": null,
            "payment_method_type": "credit",
            "reference_id": "pay_eVx6DvluTIQV9nMovfQ0_1",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": null,
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "411111",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": {
            "address": {
                "city": "Thise",
                "country": "FR",
                "line1": "1467",
                "line2": "CA",
                "line3": null,
                "zip": "94122",
                "state": "Alsace",
                "first_name": "Henry",
                "last_name": "Henry"
            },
            "phone": null,
            "email": "dg@example.com"
        }
    },
    "payment_token": "token_sc41ktlbdzim67t6PPyr",
    "shipping": null,
    "billing": null,
    "order_details": [
        {
            "brand": null,
            "amount": 110,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Tea",
            "product_type": null,
            "sub_category": null,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg",
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        },
        {
            "brand": null,
            "amount": 110,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Tea",
            "product_type": null,
            "sub_category": null,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg",
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        },
        {
            "brand": null,
            "amount": 110,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Tea",
            "product_type": null,
            "sub_category": null,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg",
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "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": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "7514509619876883203813",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "disable_avs": true,
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_eVx6DvluTIQV9nMovfQ0_1",
    "payment_link": null,
    "profile_id": "pro_1FbCCLIMKSjSmhmaMQlX",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_YJ9hAq1kQMV5R69nEjbx",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-02T10:24:11.212Z",
    "fingerprint": null,
    "browser_info": {
        "language": "en-GB",
        "time_zone": -330,
        "ip_address": "208.127.127.193",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1280,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 720,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-07-02T10:09:23.026Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
  1. Payments Create - GooglePay

cURL:

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_JAMmatXF7VNM8fgezapmgfZIE5FSlvPisx75j8mEuqm0kE4VnFZdMGEhLBCPekd6' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
    "amount": 100,
    "currency": "EUR",
    "connector": ["cybersource"],
    "confirm": true,
    "payment_link": false,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 100,
    "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://google.com",
    "payment_method": "wallet",
    "payment_method_type": "google_pay",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "description": "Visa •••• 1111",
                "tokenization_data": {
                    "type": "PAYMENT_GATEWAY",
                    "token": "{\"signature\":\"MEUCIQDQhvIMyvNSQs46o9JXIxytVd+6bcIwD5jU1mXUKiRZhAIgZCax0GeGpgPPnXDiklUamrSm9xIoCOtEGps4lEVVMfw\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"bDx3u5NQf0Ubsl9NAyvfUi85Id7xRJogaTCMRZQOnkwD9G+bpg0UF68is8+I31ZYB1cUvn/CJb8y9Os5dDEwKf+nPaPhfn9inKFJhCnKoCPNa8QhzGSYbSzTAcV/hhaI+ki9NaoMwbWAXtNduLQ0gmcdhSWQ6G5+B8Q/tNeKOt0jzjlGijWlXhKJJE+Sa/xBV4SWeJBFvoPc2YIAmJVwJlPPnMGrdbzWQ9IyH7ZiQqGVbVqWO4nLXY0IMeBGVnvSHko48XVtK8Z0rEw/GYLB3OI5vYEBic+kFzaOvt9YkpnnGW8oaa+tVGdXi+JwL+GsaavObWRuAoElijKqoN9dAL4rzqn0FQhh0TXtsPuxu6zCsy9kndYfOaPrGk4boR9jvgCPTmaAiWAeR9k0kJjXcun/pB9GlsoJhkk00dSO3y0eBuDvARo\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BAZatfZVQBO7lmKGEG/aVTxFsEqbq7Lrl4EMSvblvqhH6SghZ4C0k/3PgOK8/M8hPvAI5J9Ixp9LMSuiOeuVkKY\\\\u003d\\\",\\\"tag\\\":\\\"0eaHGyQWU4qmIunldLkdrx8273t3vouY1W+uxcOhEVY\\\\u003d\\\"}\"}"
                },
                "type": "CARD",
                "info": {
                    "card_network": "VISA",
                    "card_details": "1111"
                }
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "city": "Musterhausen",
            "state": "California",
            "zip": "12345",
            "country": "DE",
            "first_name": "Max",
            "last_name": "Mustermann"
        },
        "email": "test@novalnet.de",
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "Musterstr",
            "line2": "CA",
            "line3": "CA",
            "city": "Musterhausen",
            "state": "California",
            "zip": "94122",
            "country": "DE",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "browser_info": {
        "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
        "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "ip_address": "103.77.139.95",
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'

Response:

{
    "payment_id": "pay_bsw3kJyfXOv4paDccXrk",
    "merchant_id": "merchant_1751453606",
    "status": "processing",
    "amount": 100,
    "net_amount": 100,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "cybersource",
    "client_secret": "pay_bsw3kJyfXOv4paDccXrk_secret_RrzXE0UPrdRKtR4nc2N3",
    "created": "2025-07-02T10:56:15.842Z",
    "currency": "EUR",
    "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": "wallet",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "last4": "1111",
                "card_network": "VISA",
                "type": "CARD"
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "Musterhausen",
            "country": "DE",
            "line1": "Musterstr",
            "line2": "CA",
            "line3": "CA",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "Musterhausen",
            "country": "DE",
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "zip": "12345",
            "state": "California",
            "first_name": "Max",
            "last_name": "Mustermann"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "test@novalnet.de"
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "google_pay",
    "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": 1751453775,
        "expires": 1751457375,
        "secret": "epk_81bcb3dcfc1f4909bb2aab6990466844"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7514537773666449003814",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "7514537773666449003814",
    "payment_link": null,
    "profile_id": "pro_NRhRxj7ZaBOkzqcNbCjf",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_kEAotiJ5vlMWqEYUsPp8",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-02T11:11:15.842Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "103.77.139.95",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-07-02T10:56:17.858Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "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
}

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

@bsayak03 bsayak03 requested a review from a team as a code owner July 2, 2025 04:49
@semanticdiff-com
Copy link

semanticdiff-com bot commented Jul 2, 2025

Review changes with  SemanticDiff

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

@bsayak03 bsayak03 self-assigned this Jul 2, 2025
deepanshu-iiitu
deepanshu-iiitu previously approved these changes Jul 2, 2025
AkshayaFoiger
AkshayaFoiger previously approved these changes Jul 2, 2025
@bsayak03 bsayak03 changed the title fix(connector): [CYBERSOURCE] Passing transaction_type field in Wallet Payments fix(connector): [CYBERSOURCE] Passing pares_status for MasterCard & Visa and transaction_type field Jul 2, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jul 3, 2025
Merged via the queue into main with commit 721f780 Jul 3, 2025
29 of 32 checks passed
@Gnanasundari24 Gnanasundari24 deleted the flowbird/gpay/fix branch July 3, 2025 07:01
bsayak03 added a commit that referenced this pull request Jul 3, 2025
…isa and transaction_type field (#8518)

Co-authored-by: Sayak Bhattacharya <sayak.b@Sayak-Bhattacharya-G092THXJ34.local>
bsayak03 added a commit that referenced this pull request Jul 3, 2025
…isa and transaction_type field (#8518)

Co-authored-by: Sayak Bhattacharya <sayak.b@Sayak-Bhattacharya-G092THXJ34.local>
bsayak03 added a commit that referenced this pull request Jul 4, 2025
…isa and transaction_type field (#8518)

Co-authored-by: Sayak Bhattacharya <sayak.b@Sayak-Bhattacharya-G092THXJ34.local>
bsayak03 added a commit that referenced this pull request Jul 8, 2025
…isa and transaction_type field (#8518)

Co-authored-by: Sayak Bhattacharya <sayak.b@Sayak-Bhattacharya-G092THXJ34.local>
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.

5 participants