Skip to content

feat(connector): [NUVEI] Added support for AVC CVV checks, post confirm void and 0$ txns#8766

Merged
likhinbopanna merged 19 commits intomainfrom
nuvie
Aug 13, 2025
Merged

feat(connector): [NUVEI] Added support for AVC CVV checks, post confirm void and 0$ txns#8766
likhinbopanna merged 19 commits intomainfrom
nuvie

Conversation

@Nithin1506200
Copy link
Contributor

@Nithin1506200 Nithin1506200 commented Jul 28, 2025

Type of Change

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

Description

Added few Nuvie features

  • AVC,CVV : pass the response of AVC , CVV checks from Nuvie to Hypserswitch payment resonse (check in any below responses)
    "payment_checks": {
                "avs_description": null,
                "avs_result_code": "",
                "cvv_2_reply_code": "",
                "cvv_2_description": null,
                "merchant_advice_code": "",
                "merchant_advice_code_description": null
            },
  • Post Capture Void : After capture of successful amount we should be able to make void (typically before 24 hours)

  • 0$ transaction : Allow 0$ transaction // We are going to change this to setup mandate flow in upcomming pr rightnow its routing through AUTHORIZE flow itself . We can skip the test for this as of now.

zero dollar transaction

Get connector mandate id with 0 transaction initization `/payments`

Request

{
    "amount": 0,
    "currency": "EUR",
    "confirm": true,
    "customer_acceptance": {
        "acceptance_type": "online",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    // "order_tax_amount": 100,
    "setup_future_usage": "off_session",
    // "payment_type":"setup_mandate",
    "customer_id": "nithxxinn",
    "return_url": "https://www.google.com",
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_type": "credit",
    "authentication_type": "no_three_ds",
    "description": "hellow world",
    "billing": {
        "address": {
            "zip": "560095",
            "country": "US",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "browser_info": {
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "ip_address": "192.168.1.1",
        "java_enabled": false,
        "java_script_enabled": true,
        "language": "en-US",
        "color_depth": 24,
        "screen_height": 1080,
        "screen_width": 1920,
        "time_zone": 330,
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
    },
    "email": "hello@gmail.com",
    "payment_method_data": {
        "card": {
            "card_number": "4000000000009995",
            "card_exp_month": "01",
            "card_exp_year": "2026",
            "card_holder_name": "John Smith",
            "card_cvc": "100"
        }
    }
}

response

{
    "payment_id": "pay_bnO3yXpju09Ws8oBUR9w",
    "merchant_id": "merchant_1754498214",
    "status": "requires_capture",
    "amount": 0,
    "net_amount": 0,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "nuvei",
    "client_secret": "pay_bnO3yXpju09Ws8oBUR9w_secret_Y6WO2DC3Uidzbeb7WyWa",
    "created": "2025-08-06T17:23:41.192Z",
    "currency": "EUR",
    "customer_id": "nithxxinn",
    "customer": {
        "id": "nithxxinn",
        "name": null,
        "email": "hello@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "hellow world",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "9995",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "01",
            "card_exp_year": "2026",
            "card_holder_name": "John Smith",
            "payment_checks": {
                "avs_description": null,
                "avs_result_code": "",
                "cvv_2_reply_code": "",
                "cvv_2_description": null,
                "merchant_advice_code": "",
                "merchant_advice_code_description": null
            },
            "authentication_data": {
                "challengePreferenceReason": "12"
            }
        },
        "billing": null
    },
    "payment_token": "token_rO5qEPT5099xgR6E600V",
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "US",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "hello@gmail.com",
    "name": null,
    "phone": null,
    "return_url": "https://www.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": {
        "customer_id": "nithxxinn",
        "created_at": 1754501021,
        "expires": 1754504621,
        "secret": "epk_6fb49f9cdabd42dd9d33789fb584df66"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7110000000016293888",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "7657741111",
    "payment_link": null,
    "profile_id": "pro_Lm9uDS83De6QX5EHQNMy",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_BgWz2Uy3MgHlzzgy7W7H",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-08-06T17:38:41.192Z",
    "fingerprint": null,
    "browser_info": {
        "language": "en-US",
        "time_zone": 330,
        "ip_address": "192.168.1.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
        "color_depth": 24,
        "java_enabled": false,
        "screen_width": 1920,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "screen_height": 1080,
        "java_script_enabled": true
    },
    "payment_channel": null,
    "payment_method_id": "pm_Ku0TdAhmkKDiX9TqhomL",
    "network_transaction_id": null,
    "payment_method_status": "active",
    "updated": "2025-08-06T17:23:46.105Z",
    "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": "2073997111", // connector mandate id 
    "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
}
Mandates triggered using 0 transcation payment method id

Request

curl --location 'localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_gvwtxVj8XLUh0di5xt8yUkxS187Wlr733tSxZh7Aof45gYnrteTvmP2aJvFD8vdj' \
--data '{
    "amount": 333,
    "currency": "EUR",
    "customer_id": "nithxxinn",
    "confirm": true,
    "off_session": true,
    "recurring_details": {
        "type": "payment_method_id",
        "data": "pm_Ku0TdAhmkKDiX9TqhomL" 
    },
       "browser_info": {
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "ip_address": "192.168.1.1",
        "java_enabled": false,
        "java_script_enabled": true,
        "language": "en-US",
        "color_depth": 24,
        "screen_height": 1080,
        "screen_width": 1920,
        "time_zone": 330,
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
    }
}'

##response

{
    "payment_id": "pay_eW2XRbgGai3X3RpAVVGD",
    "merchant_id": "merchant_1754498214",
    "status": "succeeded",
    "amount": 333,
    "net_amount": 333,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 333,
    "connector": "nuvei",
    "client_secret": "pay_eW2XRbgGai3X3RpAVVGD_secret_H6pCfoxWHonNwkXzyHD2",
    "created": "2025-08-06T17:34:58.537Z",
    "currency": "EUR",
    "customer_id": "nithxxinn",
    "customer": {
        "id": "nithxxinn",
        "name": null,
        "email": "hello@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": true,
    "capture_on": null,
    "capture_method": null,
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "9995",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "01",
            "card_exp_year": "2026",
            "card_holder_name": "John Smith",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "hello@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "nithxxinn",
        "created_at": 1754501698,
        "expires": 1754505298,
        "secret": "epk_7e35c394cdc94bc59e5184173d3fa385"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7110000000016294501",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "7658013111",
    "payment_link": null,
    "profile_id": "pro_Lm9uDS83De6QX5EHQNMy",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_BgWz2Uy3MgHlzzgy7W7H",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-08-06T17:49:58.537Z",
    "fingerprint": null,
    "browser_info": {
        "language": "en-US",
        "time_zone": 330,
        "ip_address": "192.168.1.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
        "color_depth": 24,
        "java_enabled": false,
        "screen_width": 1920,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "screen_height": 1080,
        "java_script_enabled": true
    },
    "payment_channel": null,
    "payment_method_id": "pm_Ku0TdAhmkKDiX9TqhomL",
    "network_transaction_id": null,
    "payment_method_status": "active",
    "updated": "2025-08-06T17:35:01.823Z",
    "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": "2073997111",
    "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
}

Post capture cancel

  • original txn: 7110000000016291163
  • void: 7110000000016291191
/payments/:id/cancel_post_capture
curl --location 'localhost:8080/payments/pay_MyZex1y0W8JtlkJ4E8sX/cancel_post_capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_gvwtxVj8XLUh0di5xt8yUkxS187Wlr733tSxZh7Aof45gYnrteTvmP2aJvFD8vdj' \
--data '{
  "cancellation_reason": "requested_by_customer"
}'

Response

{
    "payment_id": "pay_MyZex1y0W8JtlkJ4E8sX",
    "merchant_id": "merchant_1754498214",
    "status": "partially_captured",
    "amount": 21,
    "net_amount": 21,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 21,
    "connector": "nuvei",
    "client_secret": "pay_MyZex1y0W8JtlkJ4E8sX_secret_Ih4q9iGVVaUNIM69pSHv",
    "created": "2025-08-06T16:45:05.230Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "hello@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "hellow world",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "9995",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "01",
            "card_exp_year": "2026",
            "card_holder_name": "John Smith",
            "payment_checks": {
                "avs_description": null,
                "avs_result_code": "",
                "cvv_2_reply_code": "",
                "cvv_2_description": null,
                "merchant_advice_code": "",
                "merchant_advice_code_description": null
            },
            "authentication_data": {
                "challengePreferenceReason": "12"
            }
        },
        "billing": null
    },
    "payment_token": "token_IpZOPBQT3Cr7UWNqtKFT",
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "US",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://www.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": "7110000000016291191",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "7656640111",
    "payment_link": null,
    "profile_id": "pro_Lm9uDS83De6QX5EHQNMy",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_BgWz2Uy3MgHlzzgy7W7H",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-08-06T17:00:05.230Z",
    "fingerprint": null,
    "browser_info": {
        "language": "en-US",
        "time_zone": 330,
        "ip_address": "192.168.1.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
        "color_depth": 24,
        "java_enabled": false,
        "screen_width": 1920,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "screen_height": 1080,
        "java_script_enabled": true
    },
    "payment_channel": null,
    "payment_method_id": "pm_IINXjPD3GBVwSFS5jrNS",
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-08-06T16:45:23.093Z",
    "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
}

For AVS , cvv and MAC you can check in the above payment resopnses

json
           "payment_checks": {
                "avs_description": null,
                "avs_result_code": "",
                "cvv_2_reply_code": "", 
                "cvv_2_description": null,
                "merchant_advice_code": "",
                "merchant_advice_code_description": null
            },
Screenshot 2025-08-08 at 7 37 41 PM Screenshot 2025-08-08 at 7 38 07 PM Screenshot 2025-08-08 at 7 38 22 PM
  • 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

@Nithin1506200 Nithin1506200 requested a review from awasthi21 July 28, 2025 08:38
@Nithin1506200 Nithin1506200 self-assigned this Jul 28, 2025
@semanticdiff-com
Copy link

semanticdiff-com bot commented Jul 28, 2025

@Nithin1506200 Nithin1506200 added the A-connector-integration Area: Connector integration label Jul 28, 2025
@Nithin1506200 Nithin1506200 marked this pull request as ready for review August 8, 2025 14:11
@Nithin1506200 Nithin1506200 requested review from a team as code owners August 8, 2025 14:11
@Nithin1506200 Nithin1506200 changed the title feat(Nuvie): Avs,cvv check response feat(Nuvie): Avs,cvv check, postConfirmVoid,0$ txn Aug 11, 2025
@Nithin1506200 Nithin1506200 linked an issue Aug 11, 2025 that may be closed by this pull request
2 tasks
@deepanshu-iiitu deepanshu-iiitu changed the title feat(Nuvie): Avs,cvv check, postConfirmVoid,0$ txn feat(connector): [NUVEI] Added AVC CVV checks, post confirm void and 0$ txns Aug 11, 2025
@deepanshu-iiitu deepanshu-iiitu added the C-feature Category: Feature request or enhancement label Aug 11, 2025
@Nithin1506200 Nithin1506200 changed the title feat(connector): [NUVEI] Added AVC CVV checks, post confirm void and 0$ txns feat(connector): [NUVEI] Added support for AVC CVV checks, post confirm void and 0$ txns for Mit flows for Nuvei connector Aug 11, 2025
@deepanshu-iiitu deepanshu-iiitu changed the title feat(connector): [NUVEI] Added support for AVC CVV checks, post confirm void and 0$ txns for Mit flows for Nuvei connector feat(connector): [NUVEI] Added support for AVC CVV checks, post confirm void and 0$ txns Aug 11, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 12, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 12, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 13, 2025
Merged via the queue into main with commit a132cb5 Aug 13, 2025
17 of 22 checks passed
@likhinbopanna likhinbopanna deleted the nuvie branch August 13, 2025 10:27
@Nithin1506200
Copy link
Contributor Author

CHANGE REQUIRED FOR 0$ transaction : We are going to change this to setup mandate flow in upcomming pr rightnow its routing through AUTHORIZE flow itself . We can skip the test for this as of now.

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] nuvie : Avs,cvv check, postConfirmVoid,0$ txn

4 participants