hyperswitch
hyperswitch copied to clipboard
refactor(Connector): [signifyd,threedsecureio,wellsfargopayout,wise] move from routers to hyperswitch_connectors
Type of Change
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Description
Move the following connectors from crates/router to crates/hyperswitch_connectors
- signifyd
- threedsecureio
- wellsfargopayout
- wise
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?
WISE
curl --location 'http://localhost:8080/account/merchant_1746603147/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-feature: integ-custom' \
--header 'api-key: dev_vE5MxDUUu9eQJ7AMwI4vD9nVj3IlxZy1qdpct9JB7Mt3j2mbYF7jLyjMz8KvAq94' \
--data '{
"connector_type": "payout_processor",
"connector_name": "wise",
"connector_account_details": {
"api_key": "***",
"auth_type": "BodyKey",
"key1": "2***3"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"payment_method_type": "klarna",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "affirm",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"city": "NY",
"unit": "245"
},
"connector_webhook_details": {
"merchant_secret": "MyWebhookSecret"
},
"business_country": "US",
"business_label": "default"
}'
Response
{
"connector_type": "payout_processor",
"connector_name": "wise",
"connector_label": "wise_US_default",
"merchant_connector_id": "mca_w92QHyUrQYCIrMmO4Lzp",
"profile_id": "pro_SRkbVeuCZykOW6G2bCTL",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "Be***************************************d4",
"key1": "28****33"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"payment_method_type": "klarna",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "affirm",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"connector_webhook_details": {
"merchant_secret": "MyWebhookSecret",
"additional_secret": null
},
"metadata": {
"city": "NY",
"unit": "245"
},
"test_mode": false,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null
}
Create payout
curl --location 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-feature: integ-custom' \
--header 'api-key: dev_vE5MxDUUu9eQJ7AMwI4vD9nVj3IlxZy1qdpct9JB7Mt3j2mbYF7jLyjMz8KvAq94' \
--data-raw '{
"amount": 100,
"currency": "EUR",
"customer": {
"id": "new_id",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65"
},
"connector": [
"wise"
],
"description": "Its my first payout request",
"payout_type": "card",
"payout_method_data": {
"card": {
"card_number": "4000000000002503",
"expiry_month": "08",
"expiry_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "999"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"city": "San Fransico",
"zip": "94122",
"country": "CH",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"entity_type": "Individual",
"recurring": true,
"metadata": {
"city": "NY",
"unit": "245",
"source_balance_account": "BA32CNH223227G5KQKQDJ48HB"
},
"confirm": true,
"auto_fulfill": true
}'
response -- LOOKS like card payment
{
"error": {
"type": "invalid_request",
"message": "Payout Eligibility for Wise is not implemented",
"code": "IR_00"
}
}
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