Skip to content

feat(connector): Add VGS connector impls#7942

Merged
likhinbopanna merged 13 commits intomainfrom
vgs-external-vault
Aug 25, 2025
Merged

feat(connector): Add VGS connector impls#7942
likhinbopanna merged 13 commits intomainfrom
vgs-external-vault

Conversation

@AnuthaDev
Copy link
Contributor

@AnuthaDev AnuthaDev commented Apr 30, 2025

Type of Change

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

Description

  • Added Connector changes for VGS
  • Implemented ExternalVaultInsertFlow and ExternalVaultRetrieveFlow for VGS
  • This allows Payment methods to be vaulted in VGS when is_external_vault_enabled is set to true in profile
  • Updated VGS URL in TOML files

Additional Changes

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

Motivation and Context

Closes #9023

How did you test it?

Confirm Request:

curl --location 'http://localhost:8080/v2/payments/12345_pay_0198d09ccd8a77729274a5c3858e13f3/confirm-intent' \
--header 'x-profile-id: pro_TVu6gSPZXAVEa2h0JCRe' \
--header 'x-client-secret: cs_0198d09cce0774338628683873a2db9d' \
--header 'Authorization: publishable-key=pk_dev_17e15cb3538d4bd99af971ee2d4d081f,client-secret=cs_0198d09cce0774338628683873a2db9d' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_17e15cb3538d4bd99af971ee2d4d081f' \
--data '{
    "payment_method_data": {
        "card": {
            "card_cvc": "123",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_number": "4242424242424242",
            "card_holder_name": "joseph Doe"
        }
    },
    "payment_method_type": "card",
    "payment_method_subtype": "card",
    "browser_info": {
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
        "accept_header": "text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,*\\/*;q=0.8",
        "language": "en-GB",
        "color_depth": 24,
        "screen_height": 1440,
        "screen_width": 2560,
        "time_zone": -330,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "0.0.0.0"
    },
    "customer_acceptance": {
        "acceptance_type": "online",
        "accepted_at": "2022-09-10T10:11:12Z",
        "online": {
            "ip_address": "123.32.25.123",
            "user_agent": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36"
        }
    }
    
}'

Insert Request:
image

Insert Response:
image

Confirm Request:

curl --location 'http://localhost:8080/v2/payments/12345_pay_0198d09ccd8a77729274a5c3858e13f3/confirm-intent' \
--header 'x-profile-id: pro_TVu6gSPZXAVEa2h0JCRe' \
--header 'x-client-secret: cs_0198d09cce0774338628683873a2db9d' \
--header 'Authorization: publishable-key=pk_dev_17e15cb3538d4bd99af971ee2d4d081f,client-secret=cs_0198d09cce0774338628683873a2db9d' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_17e15cb3538d4bd99af971ee2d4d081f' \
--data '{
    "payment_method_data": {
        "card_token": {
            "card_cvc": "123"
        }
    },
    "payment_method_type": "card",
    "payment_method_subtype": "card",
    "payment_token": "token_UBCgOA3daIE4CP4pugXW"
}'

Retrieve Request:
image

Retrieve Response:
image

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

@AnuthaDev AnuthaDev added this to the May 2025 Release milestone Apr 30, 2025
@AnuthaDev AnuthaDev self-assigned this Apr 30, 2025
@semanticdiff-com
Copy link

semanticdiff-com bot commented Apr 30, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payment_methods.rs  85% smaller
  crates/router/src/types/api/connector_mapping.rs  79% smaller
  crates/router/src/types/api/feature_matrix.rs  79% smaller
  crates/router/tests/connectors/vgs.rs  45% smaller
  crates/hyperswitch_connectors/src/default_implementations.rs  23% smaller
  crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs  20% smaller
  crates/hyperswitch_connectors/src/connectors/vgs.rs  9% smaller
  config/config.example.toml Unsupported file format
  config/deployments/integration_test.toml Unsupported file format
  config/deployments/production.toml Unsupported file format
  config/deployments/sandbox.toml Unsupported file format
  config/development.toml Unsupported file format
  config/docker_compose.toml Unsupported file format
  loadtest/config/development.toml Unsupported file format

@hyperswitch-bot hyperswitch-bot bot added M-api-contract-changes Metadata: This PR involves API contract changes and removed M-api-contract-changes Metadata: This PR involves API contract changes labels Apr 30, 2025
@AnuthaDev AnuthaDev force-pushed the vgs-external-vault branch from b1d9005 to cad5c24 Compare May 2, 2025 05:06
@hyperswitch-bot hyperswitch-bot bot added the M-database-changes Metadata: This PR involves database schema changes label May 2, 2025
@AnuthaDev AnuthaDev marked this pull request as ready for review May 8, 2025 06:26
@AnuthaDev AnuthaDev requested review from a team as code owners May 8, 2025 06:26
Base automatically changed from vault_connector_service to main May 21, 2025 12:16
@likhinbopanna likhinbopanna requested a review from a team as a code owner May 21, 2025 12:16
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label May 21, 2025
@hyperswitch-bot hyperswitch-bot bot removed the M-api-contract-changes Metadata: This PR involves API contract changes label Jun 18, 2025
@AnuthaDev AnuthaDev requested review from a team as code owners July 16, 2025 09:29
@hyperswitch-bot hyperswitch-bot bot removed the M-database-changes Metadata: This PR involves database schema changes label Jul 16, 2025
@AnuthaDev AnuthaDev force-pushed the vgs-external-vault branch from 3b0a3ba to 9a44df6 Compare July 30, 2025 06:23
@AnuthaDev AnuthaDev removed request for a team July 30, 2025 06:24
@AnuthaDev AnuthaDev removed the request for review from a team July 30, 2025 06:24
@AnuthaDev AnuthaDev changed the title Add VGS as external vault connector feat(connector): Add VGS connector impls Aug 22, 2025
@AnuthaDev AnuthaDev requested review from a team and removed request for a team August 22, 2025 13:24
fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> {
match auth_type {
ConnectorAuthType::SignatureKey { api_key, key1, .. } => Ok(Self {
ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Handle for signature key as well

@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 25, 2025
Merged via the queue into main with commit ddf1a6a Aug 25, 2025
33 of 43 checks passed
@likhinbopanna likhinbopanna deleted the vgs-external-vault branch August 25, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vault connector changes

5 participants