Skip to content

feat(connector): [BLUECODE] Added Bluecode Wallet QR Code Redirect Payment Method#8762

Merged
likhinbopanna merged 20 commits intomainfrom
bluecode/qr-code
Aug 1, 2025
Merged

feat(connector): [BLUECODE] Added Bluecode Wallet QR Code Redirect Payment Method#8762
likhinbopanna merged 20 commits intomainfrom
bluecode/qr-code

Conversation

@bsayak03
Copy link
Contributor

@bsayak03 bsayak03 commented Jul 25, 2025

Type of Change

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

Description

Added Bluecode as a new wallet.

Additional Changes

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

Motivation and Context

How did you test it?

MCA Create :

cURL :

curl --location 'http://localhost:8080/account/merchant_1753970617/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_LzO61A2VmE4jUsf5v7QlOyKaTNzNhPOJj2zDIfrKWeHsYKj2d3ozLjOIDcICBayB' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data '{
    "connector_type": "payment_processor",
    "connector_name": "bluecode",
    "connector_account_details": {
        "auth_type": "HeaderKey",
        "api_key": ""
    },
    "test_mode": true,
    "disabled": false,
    "payment_methods_enabled": [
        {
            "payment_method": "wallet",
            "payment_method_types": [
                {
                    "payment_method_type": "bluecode",
                    "payment_experience": "redirect_to_url",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "metadata": {
        "shop_name": "c2c_bluecode"
    },
    "connector_webhook_details": {
        "merchant_secret": ""
    },
    "business_country": "US",
    "business_label": "default"
}'

Payments Create :

cURL :

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_LzO61A2VmE4jUsf5v7QlOyKaTNzNhPOJj2zDIfrKWeHsYKj2d3ozLjOIDcICBayB' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data '{
    "amount": 1,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "return_url": "https://duck.com",
    "payment_method": "wallet",
    "payment_method_type": "bluecode",
    "payment_method_data": {
        "wallet": {
            "bluecode_redirect": {
            }
        }
    },
    "billing": {
        "address": {
            "first_name": "joseph",
            "last_name": "Doe",
            "line1": "1467",
            "city": "San Fransico",
            "country": "AT",
            "zip": "94122"
        }
    }
}'

Response :

{
    "payment_id": "pay_YmwRq8euCR1d3Z06bTiu",
    "merchant_id": "merchant_1753892574",
    "status": "requires_customer_action",
    "amount": 1,
    "net_amount": 1,
    "shipping_cost": null,
    "amount_capturable": 1,
    "amount_received": null,
    "connector": "bluecode",
    "client_secret": "pay_YmwRq8euCR1d3Z06bTiu_secret_n5DdoJwxuRfffBMeR2Ga",
    "created": "2025-07-30T16:25:43.534Z",
    "currency": "EUR",
    "customer_id": "abcdef",
    "customer": {
        "id": "abcdef",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "AT",
            "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": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_YmwRq8euCR1d3Z06bTiu/merchant_1753892574/pay_YmwRq8euCR1d3Z06bTiu_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "bluecode",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "abcdef",
        "created_at": 1753892743,
        "expires": 1753896343,
        "secret": "epk_bcd87058f1be45978789842956e9576d"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "FKT853GDY38FBD2GRALY",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "PPJ5MAEF8E7IS82BVOR4FVXZ7A",
    "payment_link": null,
    "profile_id": "pro_s1Di7VlqnUOmVqC6kE7L",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_v0GMYlanQEagnKHVQewV",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-30T16:40:43.534Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-07-30T16:25:45.094Z",
    "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
}

PSync (Post getting a webhook) - Happy case ( To test failed cases - cancel the QR code payment at the time of redirection from BC Sbx app)

cURL :

curl --location 'http://localhost:8080/payments/pay_YmwRq8euCR1d3Z06bTiu' \
--header 'Accept: application/json' \
--header 'api-key: dev_S3rn2ILcmEt0evQlJyhx97LTeTeEULjqqolFMHdzaKgzEvw34OsK8A86OSYWfIl4' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data ''

Response :

{
    "payment_id": "pay_YmwRq8euCR1d3Z06bTiu",
    "merchant_id": "merchant_1753892574",
    "status": "succeeded",
    "amount": 1,
    "net_amount": 1,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 1,
    "connector": "bluecode",
    "client_secret": "pay_YmwRq8euCR1d3Z06bTiu_secret_n5DdoJwxuRfffBMeR2Ga",
    "created": "2025-07-30T16:25:43.534Z",
    "currency": "EUR",
    "customer_id": "abcdef",
    "customer": {
        "id": "abcdef",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "AT",
            "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": "guest@example.com",
    "name": "John Doe",
    "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": "bluecode",
    "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": "FKT853GDY38FBD2GRALY",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "PPJ5MAEF8E7IS82BVOR4FVXZ7A",
    "payment_link": null,
    "profile_id": "pro_s1Di7VlqnUOmVqC6kE7L",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_v0GMYlanQEagnKHVQewV",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-30T16:40:43.534Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-07-30T16:26:21.164Z",
    "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
}

Note: The Status will be updated only after getting a webhook

Redirect tab
Screenshot 2025-07-25 at 11 29 35 PM

Webhooks:
Screenshot 2025-08-01 at 1 48 12 PM

Checklist

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

@bsayak03 bsayak03 requested review from a team as code owners July 25, 2025 17:54
@semanticdiff-com
Copy link

semanticdiff-com bot commented Jul 25, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/types/transformers.rs  81% smaller
  crates/hyperswitch_connectors/src/connectors/adyen.rs  81% smaller
  crates/hyperswitch_connectors/src/connectors/noon/transformers.rs  46% smaller
  crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs  42% smaller
  crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs  42% smaller
  crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs  42% smaller
  crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs  42% smaller
  crates/hyperswitch_connectors/src/connectors/klarna.rs  39% smaller
  crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs  39% smaller
  crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs  37% smaller
  crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs  37% smaller
  crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs  37% smaller
  crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs  37% smaller
  crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs  37% smaller
  crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs  37% smaller
  crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs  37% smaller
  crates/hyperswitch_connectors/src/connectors/payme/transformers.rs  37% smaller
  crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs  32% smaller
  crates/hyperswitch_connectors/src/connectors/aci/transformers.rs  32% smaller
  crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs  32% smaller
  crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs  32% smaller
  crates/hyperswitch_connectors/src/connectors/square/transformers.rs  32% smaller
  crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs  32% smaller
  crates/hyperswitch_connectors/src/connectors/zen/transformers.rs  32% smaller
  crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs  31% smaller
  crates/api_models/src/payments.rs  31% smaller
  crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs  29% smaller
  crates/payment_methods/src/helpers.rs  28% smaller
  crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs  25% smaller
  crates/hyperswitch_connectors/src/connectors/boku/transformers.rs  25% smaller
  crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs  25% smaller
  crates/hyperswitch_connectors/src/connectors/bluecode.rs  14% smaller
  crates/hyperswitch_connectors/src/connectors/bluecode/transformers.rs  7% smaller
  api-reference/v1/openapi_spec_v1.json  0% smaller
  api-reference/v2/openapi_spec_v2.json  0% 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
  crates/common_enums/src/connector_enums.rs  0% smaller
  crates/common_enums/src/enums.rs  0% smaller
  crates/common_enums/src/transformers.rs  0% smaller
  crates/connector_configs/src/connector.rs  0% smaller
  crates/connector_configs/toml/development.toml Unsupported file format
  crates/connector_configs/toml/production.toml Unsupported file format
  crates/connector_configs/toml/sandbox.toml Unsupported file format
  crates/euclid/src/frontend/dir/enums.rs  0% smaller
  crates/euclid/src/frontend/dir/lowering.rs  0% smaller
  crates/euclid/src/frontend/dir/transformers.rs  0% smaller
  crates/hyperswitch_connectors/src/utils.rs  0% smaller
  crates/hyperswitch_domain_models/src/payment_method_data.rs  0% smaller
  crates/kgraph_utils/src/mca.rs  0% smaller
  crates/kgraph_utils/src/transformers.rs  0% smaller
  crates/payment_methods/src/configs/payment_connector_required_fields.rs  0% smaller
  crates/router/src/connector/utils.rs  0% smaller
  crates/router/src/core/connector_validation.rs  0% smaller
  crates/router/src/types/api/connector_mapping.rs  0% smaller
  crates/router/src/types/connector_transformers.rs  0% smaller
  loadtest/config/development.toml Unsupported file format

@bsayak03 bsayak03 self-assigned this Jul 25, 2025
@bsayak03 bsayak03 removed request for a team July 27, 2025 11:08
@bsayak03 bsayak03 requested a review from deepanshu-iiitu July 28, 2025 06:04
@juspay juspay deleted a comment from frederickraymond78 Jul 28, 2025
@juspay juspay deleted a comment from frederickraymond78 Jul 28, 2025
@juspay juspay deleted a comment from frederickraymond78 Jul 28, 2025
@juspay juspay deleted a comment from frederickraymond78 Jul 28, 2025
@juspay juspay deleted a comment from frederickraymond78 Jul 28, 2025
@juspay juspay deleted a comment from frederickraymond78 Jul 28, 2025
@juspay juspay deleted a comment from frederickraymond78 Jul 28, 2025
Base automatically changed from bluecode/template to main July 29, 2025 08:13
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jul 29, 2025
@bsayak03 bsayak03 added A-connector-integration Area: Connector integration A-payment-methods Area: Payment Methods labels Jul 29, 2025
Copy link
Contributor

@hrithikesh026 hrithikesh026 left a comment

Choose a reason for hiding this comment

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

Core changes Look good to me

Copy link
Contributor

@Sarthak1799 Sarthak1799 left a comment

Choose a reason for hiding this comment

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

LGTM.
But we need to add this new wallet type in configs in the Decision Engine Repo as well.
Raise a PR for this as well @bsayak03
https://github.com/juspay/decision-engine/blob/main/config/development.toml

@bsayak03
Copy link
Contributor Author

bsayak03 commented Aug 1, 2025

LGTM. But we need to add this new wallet type in configs in the Decision Engine Repo as well. Raise a PR for this as well @bsayak03 juspay/decision-engine@main/config/development.toml

Cool

@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 1, 2025
Merged via the queue into main with commit c749bd9 Aug 1, 2025
19 of 24 checks passed
@likhinbopanna likhinbopanna deleted the bluecode/qr-code branch August 1, 2025 12:54
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 A-payment-methods Area: Payment Methods M-api-contract-changes Metadata: This PR involves API contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants