Skip to content

feat(connector): [WORLDPAYVANTIV] Populate Network Decline Error Code & Message #8856

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 4 commits into from
Aug 6, 2025

Conversation

bsayak03
Copy link
Contributor

@bsayak03 bsayak03 commented Aug 6, 2025

Type of Change

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

Description

Populated Network Decline Error code and Error Message with EnhancedAuthResponse getting from connector.

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: http://support.worldpay.com/support/CNP-API/content/authresp.htm
Ref: http://support.worldpay.com/support/CNP-API/content/saleresp1.htm

How did you test it?

Payments Create (Failed case to see the issuer_error_code and issuer_error_message) :

cURL :

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_xMNIZBeTXsGRgGNBdW8jJsqfJg7yFIoUXdtDgAPWf6PLWq9my1HkfKQsTPc7VKuf' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data '{
    "amount": 65,
    "currency": "USD",
    "connector": ["worldpayvantiv"],
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "First_Customer",
    "name": "John Doe",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4457010100000008",
            "card_exp_month": "06",
            "card_exp_year": "52",
            "card_holder_name": "joseph Doe",
            "card_cvc": "992"
        }
    },
    
    
    
    
    
    
    
    
    
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "9123456789",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "9123456789",
            "country_code": "+91"
        }
    }
}'

Response :

{
    "payment_id": "pay_nDIWwY1FN6RUooVbl2TN",
    "merchant_id": "merchant_1754472094",
    "status": "failed",
    "amount": 65,
    "net_amount": 65,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "worldpayvantiv",
    "client_secret": "pay_nDIWwY1FN6RUooVbl2TN_secret_WSxBelwY9VXi1sAkmhT7",
    "created": "2025-08-06T12:45:40.372Z",
    "currency": "USD",
    "customer_id": "First_Customer",
    "customer": {
        "id": "First_Customer",
        "name": "John Doe",
        "email": null,
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0008",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "445701",
            "card_extended_bin": null,
            "card_exp_month": "06",
            "card_exp_year": "52",
            "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": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "9123456789",
            "country_code": "+91"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "9123456789",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": "John Doe",
    "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": "110",
    "error_message": "Insufficient Funds",
    "unified_code": "UE_9000",
    "unified_message": "Something went wrong",
    "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": "First_Customer",
        "created_at": 1754484340,
        "expires": 1754487940,
        "secret": "epk_353f5708ca694e4596e9aa09dd9198b9"
    },
    "manual_retry_allowed": true,
    "connector_transaction_id": "pay_nDIWwY1FN6RUooVbl2TN_1",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_DWXrygWVghiYH2Q2tp6n",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_fKaZeQpALEJZCnUCsVFE",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-08-06T13:00:40.372Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-08-06T12:45:43.692Z",
    "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": "51",
    "issuer_error_message": "Insufficient Funds",
    "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 self-assigned this Aug 6, 2025
@bsayak03 bsayak03 requested a review from a team as a code owner August 6, 2025 12:50
Copy link

semanticdiff-com bot commented Aug 6, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs  37% smaller

deepanshu-iiitu
deepanshu-iiitu previously approved these changes Aug 6, 2025
AkshayaFoiger
AkshayaFoiger previously approved these changes Aug 6, 2025
Anurag-05-prog
Anurag-05-prog previously approved these changes Aug 6, 2025
@likhinbopanna likhinbopanna enabled auto-merge August 6, 2025 13:50
@bsayak03 bsayak03 dismissed stale reviews from Anurag-05-prog and AkshayaFoiger via 5513318 August 6, 2025 15:08
@bsayak03 bsayak03 requested review from a team as code owners August 6, 2025 15:08
@hyperswitch-bot hyperswitch-bot bot added M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Aug 6, 2025
@hyperswitch-bot hyperswitch-bot bot removed M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Aug 6, 2025
@bsayak03 bsayak03 removed request for a team August 6, 2025 15:12
@bsayak03 bsayak03 removed request for a team August 6, 2025 15:12
@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 6, 2025
Merged via the queue into main with commit e2bfce8 Aug 6, 2025
17 of 22 checks passed
@likhinbopanna likhinbopanna deleted the vantiv/mac/code branch August 6, 2025 16:36
pixincreate added a commit that referenced this pull request Aug 7, 2025
…ordea-sepa

* 'main' of github.com:juspay/hyperswitch:
  fix(router): [worldpayvantiv] dispute validations and statuses (#8862)
  chore(version): 2025.08.07.0
  feat(connector): [WORLDPAYVANTIV] Populate Network Decline Error Code & Message (#8856)
  feat(router): add support for partial authorization (#8833)
  feat(gRPC): build gRPC client interface to initiate communication with recovery-decider service (#8178)
  fix(connector): [CYBERSOURCE] fix response field for netcetera authentication response (#8850)
  chore(events): making events nanosecond level precision (#8759)
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