Skip to content

feat(connector): [payload] introduce no-3ds cards #8545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 5, 2025

Conversation

pixincreate
Copy link
Member

@pixincreate pixincreate commented Jul 4, 2025

Type of Change

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

Description

This PR introduces the below given flows for Payload connector:

  • Cards (No 3DS)
  • PSync
  • Void
  • Refunds
  • AVS Checks
  • Cypress

Connector does not support 3DS transactions.

Additional Changes

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

Motivation and Context

New connector. Closes #8527

How did you test it?

Running Cypress will be a pain as the connector marks automatic capture payments as duplicate eventually failing the payment if done within 15 second time span.

Curls:

Authorize 3DS
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_ojBKSaGCsEr3lo3NumPRA8oytAaoUkFZBfbdQ2XJyzFqzYzbQFOgQqgBCOVqeTCB' \
--data-raw '{
    "amount": 10400,
    "currency": "USD",
    "confirm": false,
    "capture_method": "manual",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 10400,
    "customer_id": "customer",
    "email": "[email protected]",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://duck.com",
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US"
            ,
            "first_name": "PiX"
            ,
            "last_name": "THE"
        }
    },
    "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",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "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"
    }
    
}'
{
    "payment_id": "pay_dBN3ZKKNj7sCIjt0qYRH",
    "merchant_id": "postman_merchant_GHAction_1751615211",
    "status": "requires_payment_method",
    "amount": 10400,
    "net_amount": 10400,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_dBN3ZKKNj7sCIjt0qYRH_secret_9e4dJN8io2oIY6qNiNf5",
    "created": "2025-07-04T08:38:12.557Z",
    "currency": "USD",
    "customer_id": "customer",
    "customer": {
        "id": "customer",
        "name": null,
        "email": "[email protected]",
        "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": "manual",
    "payment_method": null,
    "payment_method_data": 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
        },
        "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": "THE"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": null,
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "authentication_type": "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": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "customer",
        "created_at": 1751618292,
        "expires": 1751621892,
        "secret": "epk_4f9fe3bf5dc94b57819620a7d3c0918a"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_GXv0G95IHPxJokca7ece",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-04T08:53:12.557Z",
    "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-04T08:38:12.568Z",
    "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
}
Confirm 3DS
curl --location 'http://Localhost:8080/payments/pay_dBN3ZKKNj7sCIjt0qYRH/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_852ccab463694df1a50337317c37c05c' \
--data '{
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "Joseph Doe",
            "card_cvc": "123"
        }
    },
    "client_secret": "pay_dBN3ZKKNj7sCIjt0qYRH_secret_9e4dJN8io2oIY6qNiNf5"
}'
{
    "error": {
        "type": "invalid_request",
        "message": "Payment method type not supported",
        "code": "IR_19",
        "reason": "Cards 3DS is not supported by Payload"
    }
}
Authorize No 3DS
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_ojBKSaGCsEr3lo3NumPRA8oytAaoUkFZBfbdQ2XJyzFqzYzbQFOgQqgBCOVqeTCB' \
--data-raw '{
    "amount": 10400,
    "currency": "USD",
    "confirm": false,
    "capture_method": "manual",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 10400,
    "customer_id": "customer",
    "email": "[email protected]",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://duck.com",
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US"
            ,
            "first_name": "PiX"
            ,
            "last_name": "THE"
        }
    },
    "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",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "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"
    }
    
}'
{
    "payment_id": "pay_oG45Z9ZE9KVNSlDE5kEU",
    "merchant_id": "postman_merchant_GHAction_1751615211",
    "status": "requires_payment_method",
    "amount": 10400,
    "net_amount": 10400,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_oG45Z9ZE9KVNSlDE5kEU_secret_FEs1MMwoHyFsb8L8joG3",
    "created": "2025-07-04T08:39:58.524Z",
    "currency": "USD",
    "customer_id": "customer",
    "customer": {
        "id": "customer",
        "name": null,
        "email": "[email protected]",
        "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": "manual",
    "payment_method": null,
    "payment_method_data": 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
        },
        "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": "THE"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": null,
    "phone": "999999999",
    "return_url": "https://duck.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": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "customer",
        "created_at": 1751618398,
        "expires": 1751621998,
        "secret": "epk_0f9fd59624604cfcae9b1340ad176710"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_GXv0G95IHPxJokca7ece",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-04T08:54:58.524Z",
    "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-04T08:39:58.537Z",
    "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
}
Confirm
curl --location 'http://Localhost:8080/payments/pay_oG45Z9ZE9KVNSlDE5kEU/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_852ccab463694df1a50337317c37c05c' \
--data '{
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "Joseph Doe",
            "card_cvc": "123"
        }
    },
    "client_secret": "pay_oG45Z9ZE9KVNSlDE5kEU_secret_FEs1MMwoHyFsb8L8joG3"
}'
{
    "payment_id": "pay_oG45Z9ZE9KVNSlDE5kEU",
    "merchant_id": "postman_merchant_GHAction_1751615211",
    "status": "requires_capture",
    "amount": 10400,
    "net_amount": 10400,
    "shipping_cost": null,
    "amount_capturable": 10400,
    "amount_received": null,
    "connector": "payload",
    "client_secret": "pay_oG45Z9ZE9KVNSlDE5kEU_secret_FEs1MMwoHyFsb8L8joG3",
    "created": "2025-07-04T08:39:58.524Z",
    "currency": "USD",
    "customer_id": "customer",
    "customer": {
        "id": "customer",
        "name": null,
        "email": "[email protected]",
        "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": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "4242",
            "card_type": "CREDIT",
            "card_network": "Visa",
            "card_issuer": "STRIPE PAYMENTS UK LIMITED",
            "card_issuing_country": "UNITEDKINGDOM",
            "card_isin": "424242",
            "card_extended_bin": null,
            "card_exp_month": "10",
            "card_exp_year": "25",
            "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
        },
        "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": "THE"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": null,
    "phone": "999999999",
    "return_url": "https://duck.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": "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": "txn_3epWFzMKsIMDjAdQApgOe",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "PL-LS0-6XQ-OCT",
    "payment_link": null,
    "profile_id": "pro_GXv0G95IHPxJokca7ece",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_QfDIuUKUfARzzR3l0Q4n",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-04T08:54:58.524Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": null,
        "language": null,
        "time_zone": null,
        "ip_address": "::1",
        "os_version": null,
        "user_agent": null,
        "color_depth": null,
        "device_model": null,
        "java_enabled": null,
        "screen_width": null,
        "accept_header": null,
        "screen_height": null,
        "accept_language": "en",
        "java_script_enabled": null
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-07-04T08:40:09.253Z",
    "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
}
Capture
curl --location 'http://Localhost:8080/payments/pay_oG45Z9ZE9KVNSlDE5kEU/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ojBKSaGCsEr3lo3NumPRA8oytAaoUkFZBfbdQ2XJyzFqzYzbQFOgQqgBCOVqeTCB' \
--data '{
    "amount_to_capture": 10400,
    "statement_descriptor_name": "Joseph",
    "statement_descriptor_suffix": "JS"
}'
{
    "payment_id": "pay_oG45Z9ZE9KVNSlDE5kEU",
    "merchant_id": "postman_merchant_GHAction_1751615211",
    "status": "succeeded",
    "amount": 10400,
    "net_amount": 10400,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 10400,
    "connector": "payload",
    "client_secret": "pay_oG45Z9ZE9KVNSlDE5kEU_secret_FEs1MMwoHyFsb8L8joG3",
    "created": "2025-07-04T08:39:58.524Z",
    "currency": "USD",
    "customer_id": "customer",
    "customer": {
        "id": "customer",
        "name": null,
        "email": "[email protected]",
        "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": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "4242",
            "card_type": "CREDIT",
            "card_network": "Visa",
            "card_issuer": "STRIPE PAYMENTS UK LIMITED",
            "card_issuing_country": "UNITEDKINGDOM",
            "card_isin": "424242",
            "card_extended_bin": null,
            "card_exp_month": "10",
            "card_exp_year": "25",
            "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
        },
        "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": "THE"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": null,
    "phone": "999999999",
    "return_url": "https://duck.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": "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": "txn_3epWFzMKsIMDjAdQApgOe",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "PL-LS0-6XQ-OCT",
    "payment_link": null,
    "profile_id": "pro_GXv0G95IHPxJokca7ece",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_QfDIuUKUfARzzR3l0Q4n",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-04T08:54:58.524Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": null,
        "language": null,
        "time_zone": null,
        "ip_address": "::1",
        "os_version": null,
        "user_agent": null,
        "color_depth": null,
        "device_model": null,
        "java_enabled": null,
        "screen_width": null,
        "accept_header": null,
        "screen_height": null,
        "accept_language": "en",
        "java_script_enabled": null
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-07-04T08:41:34.623Z",
    "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
}
PSync
curl --location 'http://Localhost:8080/payments/pay_oG45Z9ZE9KVNSlDE5kEU?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_ojBKSaGCsEr3lo3NumPRA8oytAaoUkFZBfbdQ2XJyzFqzYzbQFOgQqgBCOVqeTCB'
{
    "payment_id": "pay_oG45Z9ZE9KVNSlDE5kEU",
    "merchant_id": "postman_merchant_GHAction_1751615211",
    "status": "succeeded",
    "amount": 10400,
    "net_amount": 10400,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 10400,
    "connector": "payload",
    "client_secret": "pay_oG45Z9ZE9KVNSlDE5kEU_secret_FEs1MMwoHyFsb8L8joG3",
    "created": "2025-07-04T08:39:58.524Z",
    "currency": "USD",
    "customer_id": "customer",
    "customer": {
        "id": "customer",
        "name": null,
        "email": "[email protected]",
        "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": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "4242",
            "card_type": "CREDIT",
            "card_network": "Visa",
            "card_issuer": "STRIPE PAYMENTS UK LIMITED",
            "card_issuing_country": "UNITEDKINGDOM",
            "card_isin": "424242",
            "card_extended_bin": null,
            "card_exp_month": "10",
            "card_exp_year": "25",
            "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
        },
        "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": "THE"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": null,
    "phone": "999999999",
    "return_url": "https://duck.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": "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": "txn_3epWFzMKsIMDjAdQApgOe",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "PL-LS0-6XQ-OCT",
    "payment_link": null,
    "profile_id": "pro_GXv0G95IHPxJokca7ece",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_QfDIuUKUfARzzR3l0Q4n",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-04T08:54:58.524Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": null,
        "language": null,
        "time_zone": null,
        "ip_address": "::1",
        "os_version": null,
        "user_agent": null,
        "color_depth": null,
        "device_model": null,
        "java_enabled": null,
        "screen_width": null,
        "accept_header": null,
        "screen_height": null,
        "accept_language": "en",
        "java_script_enabled": null
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-07-04T08:41:34.623Z",
    "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
}
Refund
curl --location 'http://Localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ojBKSaGCsEr3lo3NumPRA8oytAaoUkFZBfbdQ2XJyzFqzYzbQFOgQqgBCOVqeTCB' \
--data '{
    "payment_id": "pay_oG45Z9ZE9KVNSlDE5kEU",
    "amount": 600,
    "reason": "Customer returned product",
    "refund_type": "instant",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
{
    "refund_id": "ref_zEyDe7aksCgcYsvZDivv",
    "payment_id": "pay_oG45Z9ZE9KVNSlDE5kEU",
    "amount": 600,
    "currency": "USD",
    "status": "succeeded",
    "reason": "Customer returned product",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "error_message": null,
    "error_code": null,
    "unified_code": null,
    "unified_message": null,
    "created_at": "2025-07-04T08:42:07.233Z",
    "updated_at": "2025-07-04T08:42:08.116Z",
    "connector": "payload",
    "profile_id": "pro_GXv0G95IHPxJokca7ece",
    "merchant_connector_id": "mca_QfDIuUKUfARzzR3l0Q4n",
    "split_refunds": null,
    "issuer_error_code": null,
    "issuer_error_message": null
}
Retrieve
curl --location 'http://Localhost:8080/refunds/ref_zEyDe7aksCgcYsvZDivv' \
--header 'Accept: application/json' \
--header 'api-key: dev_ojBKSaGCsEr3lo3NumPRA8oytAaoUkFZBfbdQ2XJyzFqzYzbQFOgQqgBCOVqeTCB'
{
    "refund_id": "ref_zEyDe7aksCgcYsvZDivv",
    "payment_id": "pay_oG45Z9ZE9KVNSlDE5kEU",
    "amount": 600,
    "currency": "USD",
    "status": "succeeded",
    "reason": "Customer returned product",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "error_message": null,
    "error_code": null,
    "unified_code": null,
    "unified_message": null,
    "created_at": "2025-07-04T08:42:07.233Z",
    "updated_at": "2025-07-04T08:42:08.116Z",
    "connector": "payload",
    "profile_id": "pro_GXv0G95IHPxJokca7ece",
    "merchant_connector_id": "mca_QfDIuUKUfARzzR3l0Q4n",
    "split_refunds": null,
    "issuer_error_code": null,
    "issuer_error_message": null
}
Merchant Payment Methods List
curl --location 'http://Localhost:8080/account/payment_methods?client_secret=pay_sTHSF5DAnYQbkieTlWLf_secret_tsJjXuEgleLsBp0Ku8NH' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_987a41163e3044679cd16d6293365850'
{
    "redirect_url": "https://duck.com/",
    "currency": "USD",
    "payment_methods": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "payment_experience": null,
                    "card_networks": [
                        {
                            "card_network": "Mastercard",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "DinersClub",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "Interac",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "AmericanExpress",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "Discover",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "UnionPay",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "Visa",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "JCB",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "RuPay",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        }
                    ],
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {
                        "email": {
                            "required_field": "email",
                            "display_name": "email",
                            "field_type": "user_email_address",
                            "value": "[email protected]"
                        },
                        "payment_method_data.card.card_cvc": {
                            "required_field": "payment_method_data.card.card_cvc",
                            "display_name": "card_cvc",
                            "field_type": "user_card_cvc",
                            "value": null
                        },
                        "billing.address.last_name": {
                            "required_field": "payment_method_data.billing.address.last_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "THE"
                        },
                        "payment_method_data.card.card_exp_year": {
                            "required_field": "payment_method_data.card.card_exp_year",
                            "display_name": "card_exp_year",
                            "field_type": "user_card_expiry_year",
                            "value": null
                        },
                        "billing.address.line1": {
                            "required_field": "payment_method_data.billing.address.line1",
                            "display_name": "line1",
                            "field_type": "user_address_line1",
                            "value": "1467"
                        },
                        "billing.address.city": {
                            "required_field": "payment_method_data.billing.address.city",
                            "display_name": "city",
                            "field_type": "user_address_city",
                            "value": "San Fransico"
                        },
                        "payment_method_data.card.card_exp_month": {
                            "required_field": "payment_method_data.card.card_exp_month",
                            "display_name": "card_exp_month",
                            "field_type": "user_card_expiry_month",
                            "value": null
                        },
                        "payment_method_data.card.card_number": {
                            "required_field": "payment_method_data.card.card_number",
                            "display_name": "card_number",
                            "field_type": "user_card_number",
                            "value": null
                        },
                        "billing.address.zip": {
                            "required_field": "payment_method_data.billing.address.zip",
                            "display_name": "zip",
                            "field_type": "user_address_pincode",
                            "value": "94122"
                        },
                        "billing.address.first_name": {
                            "required_field": "payment_method_data.billing.address.first_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "PiX"
                        },
                        "billing.address.country": {
                            "required_field": "payment_method_data.billing.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_address_country": {
                                    "options": [
                                        "ALL"
                                    ]
                                }
                            },
                            "value": "US"
                        },
                        "billing.address.state": {
                            "required_field": "payment_method_data.billing.address.state",
                            "display_name": "state",
                            "field_type": "user_address_state",
                            "value": "California"
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                },
                {
                    "payment_method_type": "debit",
                    "payment_experience": null,
                    "card_networks": [
                        {
                            "card_network": "UnionPay",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "DinersClub",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "Interac",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "AmericanExpress",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "RuPay",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "Visa",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "Mastercard",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "JCB",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        },
                        {
                            "card_network": "Discover",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "payload"
                            ]
                        }
                    ],
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {
                        "email": {
                            "required_field": "email",
                            "display_name": "email",
                            "field_type": "user_email_address",
                            "value": "[email protected]"
                        },
                        "payment_method_data.card.card_cvc": {
                            "required_field": "payment_method_data.card.card_cvc",
                            "display_name": "card_cvc",
                            "field_type": "user_card_cvc",
                            "value": null
                        },
                        "billing.address.last_name": {
                            "required_field": "payment_method_data.billing.address.last_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "THE"
                        },
                        "payment_method_data.card.card_exp_year": {
                            "required_field": "payment_method_data.card.card_exp_year",
                            "display_name": "card_exp_year",
                            "field_type": "user_card_expiry_year",
                            "value": null
                        },
                        "billing.address.line1": {
                            "required_field": "payment_method_data.billing.address.line1",
                            "display_name": "line1",
                            "field_type": "user_address_line1",
                            "value": "1467"
                        },
                        "billing.address.city": {
                            "required_field": "payment_method_data.billing.address.city",
                            "display_name": "city",
                            "field_type": "user_address_city",
                            "value": "San Fransico"
                        },
                        "payment_method_data.card.card_exp_month": {
                            "required_field": "payment_method_data.card.card_exp_month",
                            "display_name": "card_exp_month",
                            "field_type": "user_card_expiry_month",
                            "value": null
                        },
                        "payment_method_data.card.card_number": {
                            "required_field": "payment_method_data.card.card_number",
                            "display_name": "card_number",
                            "field_type": "user_card_number",
                            "value": null
                        },
                        "billing.address.zip": {
                            "required_field": "payment_method_data.billing.address.zip",
                            "display_name": "zip",
                            "field_type": "user_address_pincode",
                            "value": "94122"
                        },
                        "billing.address.first_name": {
                            "required_field": "payment_method_data.billing.address.first_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "PiX"
                        },
                        "billing.address.country": {
                            "required_field": "payment_method_data.billing.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_address_country": {
                                    "options": [
                                        "ALL"
                                    ]
                                }
                            },
                            "value": "US"
                        },
                        "billing.address.state": {
                            "required_field": "payment_method_data.billing.address.state",
                            "display_name": "state",
                            "field_type": "user_address_state",
                            "value": "California"
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        }
    ],
    "mandate_payment": null,
    "merchant_name": "NewAge Retailer",
    "show_surcharge_breakup_screen": false,
    "payment_type": "normal",
    "request_external_three_ds_authentication": false,
    "collect_shipping_details_from_wallets": false,
    "collect_billing_details_from_wallets": false,
    "is_tax_calculation_enabled": false
}

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by just clippy && just clippy_v2
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@pixincreate pixincreate self-assigned this Jul 4, 2025
@pixincreate pixincreate added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Jul 4, 2025
@pixincreate pixincreate added this to the June 2025 Release milestone Jul 4, 2025
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jul 4, 2025
@pixincreate pixincreate force-pushed the connector/payload-cards branch from e422972 to 86bb5e7 Compare July 4, 2025 07:57
@pixincreate pixincreate marked this pull request as ready for review July 4, 2025 08:45
@pixincreate pixincreate requested review from a team as code owners July 4, 2025 08:45
@pixincreate pixincreate requested a review from likhinbopanna July 4, 2025 08:45
@deepanshu-iiitu deepanshu-iiitu changed the title feat(connector): payload feat(connector):[PAYLOAD] Integrate Cards Non-3DS Jul 4, 2025
deepanshu-iiitu
deepanshu-iiitu previously approved these changes Jul 4, 2025
…ayload-cards

* 'main' of github.com:juspay/hyperswitch:
  refactor: extract connector auth and metadata validation into separate module (#8501)
@pixincreate pixincreate changed the title feat(connector):[PAYLOAD] Integrate Cards Non-3DS feat(connector): [payload] introduce no-3ds cards Jul 4, 2025
@pixincreate pixincreate force-pushed the connector/payload-cards branch from 0cc9c55 to fe37ba3 Compare July 4, 2025 13:15
@pixincreate pixincreate added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jul 4, 2025
@pixincreate pixincreate force-pushed the connector/payload-cards branch from fe37ba3 to 047ce6c Compare July 4, 2025 13:25
Copy link
Contributor

@ShankarSinghC ShankarSinghC left a comment

Choose a reason for hiding this comment

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

Add merchant payment methods list response in the test case as it will contain the connector required fields.

@likhinbopanna likhinbopanna added this pull request to the merge queue Jul 5, 2025
Merged via the queue into main with commit baad3f6 Jul 5, 2025
25 of 28 checks passed
@likhinbopanna likhinbopanna deleted the connector/payload-cards branch July 5, 2025 15:10
@pixincreate pixincreate removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jul 5, 2025
pixincreate added a commit that referenced this pull request Jul 6, 2025
pixincreate added a commit that referenced this pull request Jul 6, 2025
pixincreate added a commit that referenced this pull request Jul 6, 2025
pixincreate added a commit that referenced this pull request Jul 6, 2025
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 M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] [CONNECTOR] Payload
4 participants