Skip to content

feat(coingate): Add Crypto Pay Flow#7247

Merged
Gnanasundari24 merged 4 commits intomainfrom
coingate-dev
Feb 17, 2025
Merged

feat(coingate): Add Crypto Pay Flow#7247
Gnanasundari24 merged 4 commits intomainfrom
coingate-dev

Conversation

@awasthi21
Copy link
Contributor

@awasthi21 awasthi21 commented Feb 12, 2025

Type of Change

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

Description

Added CryptoPay Flow
Only Two flows Payments Create and Sync

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?

Connector Create Curl

curl --location 'http://localhost:8080/account/merchant_1739268599/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
  "connector_type": "payment_processor",
  "connector_name": "coingate",
  "connector_account_details": {
    "auth_type": "HeaderKey",
    "api_key": ""
  },
  "test_mode": false,
  "disabled": false,
  "payment_methods_enabled": [
    {
            "payment_method": "crypto",
            "payment_method_types": [
                {
                    "payment_method_type": "crypto_currency",
                    "payment_experience": "redirect_to_url",
                    "card_networks": null,
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 0,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": false
                }
            ]
        }
  ],
  "business_country": "US",
  "business_label": "default"
}'

Request

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_isF11oplPFfEvTVcAICY47B3W9N7Xip4UF5ppPhM7g9N5lvDrcZUSB2hxUPxisHN' \
--data-raw '{
    "amount": 300,
    "currency": "EUR",
    "confirm": true,
    "email": "guest@example.com",
    "return_url": "https://google.com",
    "payment_method": "crypto",
    "payment_method_type": "crypto_currency",
    "payment_experience": "redirect_to_url",
    "payment_method_data": {
        "crypto": {
        }
    }
}'

Response

{
    "payment_id": "pay_dmsfeC8clkLz2kTJ8Qs4",
    "merchant_id": "merchant_1739268599",
    "status": "requires_customer_action",
    "amount": 300,
    "net_amount": 300,
    "shipping_cost": null,
    "amount_capturable": 300,
    "amount_received": null,
    "connector": "coingate",
    "client_secret": "pay_dmsfeC8clkLz2kTJ8Qs4_secret_8mweYn4Gu9YxNPaSzz2f",
    "created": "2025-02-12T06:20:09.284Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.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": null,
    "capture_on": null,
    "capture_method": null,
    "payment_method": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": null,
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_dmsfeC8clkLz2kTJ8Qs4/merchant_1739268599/pay_dmsfeC8clkLz2kTJ8Qs4_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "206246",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "",
    "payment_link": null,
    "profile_id": "pro_CTnbxCVt74LIw4DF8QKg",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_3UnJt6gF5ysJgXcsRl8o",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-12T06:35:09.284Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-12T06:20:10.730Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}

Psync

{
    "payment_id": "pay_dmsfeC8clkLz2kTJ8Qs4",
    "merchant_id": "merchant_1739268599",
    "status": "succeeded",
    "amount": 300,
    "net_amount": 300,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 300,
    "connector": "coingate",
    "client_secret": "pay_dmsfeC8clkLz2kTJ8Qs4_secret_8mweYn4Gu9YxNPaSzz2f",
    "created": "2025-02-12T06:20:09.284Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.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": null,
    "capture_on": null,
    "capture_method": null,
    "payment_method": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": null,
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "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": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "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": "206246",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "",
    "payment_link": null,
    "profile_id": "pro_CTnbxCVt74LIw4DF8QKg",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_3UnJt6gF5ysJgXcsRl8o",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-12T06:35:09.284Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-12T06:21:04.392Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}
Screenshot 2025-02-12 at 11 50 54 AM

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

@awasthi21 awasthi21 requested review from a team as code owners February 12, 2025 06:23
@semanticdiff-com
Copy link

semanticdiff-com bot commented Feb 12, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs  22% smaller
  crates/hyperswitch_connectors/src/connectors/coingate.rs  1% smaller
  api-reference-v2/openapi_spec.json  0% smaller
  api-reference/openapi_spec.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/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/router/src/core/admin.rs  0% smaller
  crates/router/src/types/api.rs  0% smaller
  crates/router/src/types/transformers.rs  0% smaller
  loadtest/config/development.toml Unsupported file format

@awasthi21 awasthi21 self-assigned this Feb 12, 2025
@awasthi21 awasthi21 added the A-connector-integration Area: Connector integration label Feb 12, 2025
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Feb 12, 2025
@awasthi21 awasthi21 changed the title [FEATURE]: [Coingate] add Crypto Pay Flow feat(coingate): Add Crypto Pay Flow Feb 12, 2025
@hyperswitch-bot hyperswitch-bot bot removed the M-api-contract-changes Metadata: This PR involves API contract changes label Feb 12, 2025
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Feb 12, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 17, 2025
Merged via the queue into main with commit c868ff3 Feb 17, 2025
21 of 24 checks passed
@Gnanasundari24 Gnanasundari24 deleted the coingate-dev branch February 17, 2025 11:06
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 M-api-contract-changes Metadata: This PR involves API contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants