Skip to content
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

refactor(connector): Move cashtocode,coinbase,cryptopay to crate hyperswitch_connectors #5983

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

deepanshu-iiitu
Copy link
Contributor

@deepanshu-iiitu deepanshu-iiitu commented Sep 20, 2024

Type of Change

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

Description

Additional Changes

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

Motivation and Context

#5629

How did you test it?

Cryptopay:
Request:

 curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_23PxPwqBujt8VbpD0hwiNIqNHY5HNa82ZKPJEfN2Ex2y9CE2RcPNiNCeBMIMBifB' \
--data-raw '{
    "amount": 300,
    "currency": "USD",
    "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": {
            "pay_currency": "LTC",
            "network": "litecoin"
        }
    }
}'

Response:

{
    "payment_id": "pay_D91HEOHsNOK0OJhfM4yo",
    "merchant_id": "merchant_1727096693",
    "status": "requires_customer_action",
    "amount": 300,
    "net_amount": 300,
    "amount_capturable": 300,
    "amount_received": 300,
    "connector": "cryptopay",
    "client_secret": "pay_D91HEOHsNOK0OJhfM4yo_secret_5vTYDEJXX4cI83WnlJ4N",
    "created": "2024-09-23T13:19:07.696Z",
    "currency": "USD",
    "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": "LTC",
            "network": "litecoin"
        },
        "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_D91HEOHsNOK0OJhfM4yo/merchant_1727096693/pay_D91HEOHsNOK0OJhfM4yo_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": "63f933ba-aadb-446b-b80a-58f70abb38e1",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_D91HEOHsNOK0OJhfM4yo_1",
    "payment_link": null,
    "profile_id": "pro_1pHVbwpinQ6kPONiCARj",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_RsWL9yopYx8fWkdxALEU",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-23T13:34:07.695Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-09-23T13:19:09.657Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null
}

Note: Local testing not available for coinbase and cashtocode due to unavailability of credentials.

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

@deepanshu-iiitu deepanshu-iiitu added A-connector-integration Area: Connector integration C-refactor Category: Refactor labels Sep 20, 2024
@deepanshu-iiitu deepanshu-iiitu self-assigned this Sep 20, 2024
@deepanshu-iiitu deepanshu-iiitu linked an issue Sep 20, 2024 that may be closed by this pull request
2 tasks
@deepanshu-iiitu deepanshu-iiitu changed the title refactor(connector): Move coinbase to crate hyperswitch_connectors refactor(connector): Move cashtocode,coinbase,cryptopay to crate hyperswitch_connectors Sep 23, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Sep 24, 2024
Merged via the queue into main with commit 371ed5d Sep 24, 2024
30 checks passed
@likhinbopanna likhinbopanna deleted the move-connector-c branch September 24, 2024 08:45
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-refactor Category: Refactor
Projects
None yet
5 participants