hyperswitch
hyperswitch copied to clipboard
chore(configs): [Zsl] Add configs for wasm
Type of Change
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Test Case
- Create a merchant
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: "" ' \
--data-raw '{
"merchant_id": "merchant_1712909275",
"merchant_name": "NewAge Retailer",
"return_url": "https://chrome.google.com/",
"enable_payment_response_hash": false,
"payment_response_hash_key": null,
"redirect_to_merchant_with_http_post": false,
"merchant_details": {
"primary_contact_person": "joseph Test",
"primary_phone": "veniam aute officia ullamco esse",
"primary_email": "[email protected]",
"secondary_contact_person": "joseph Test2",
"secondary_phone": "proident adipisicing officia nulla",
"secondary_email": "[email protected]",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"city": "San Fransico",
"country": null,
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": null,
"last_name": null
}
},
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "",
"webhook_url": "",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "",
"metadata": {
"city": "NY",
"unit": "245"
},
"locker_id": "m0010",
"primary_business_details": [
{
"country": "CN",
"business": "default"
}
],
"organization_id": null
}'
- Create a MCA
curl --location 'http://localhost:8080/account/merchant_1712909051/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: "" ' \
--data '{
"connector_type": "fiz_operations",
"connector_name": "zsl",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "Key",
"key1": "MER_ID"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "bank_transfer",
"payment_method_types": [
{
"payment_method_type": "local_bank_transfer",
"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
}
]
}
],
"metadata": {
"city": "NY",
"unit": "245",
"account_name": "transaction_processing"
},
"business_country": "CN",
"business_label": "default",
"business_sub_label": null,
"frm_configs": null,
"connector_webhook_details": {
"merchant_secret": ""
}
}'
- API create
curl --location 'http://localhost:8080/api_keys/merchant_1712909051' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ""' \
--data '{
"name": "API Key 1",
"description": null,
"expiration": "2025-09-23T01:02:03.000Z"
}'
- List payment method
curl --location 'http://localhost:8080/account/payment_methods' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:""' \
--data ''
Response
{
"redirect_url": "https://chrome.google.com/",
"currency": null,
"payment_methods": [
{
"payment_method": "bank_transfer",
"payment_method_types": [
{
"payment_method_type": "local_bank_transfer",
"payment_experience": [
{
"payment_experience_type": "redirect_to_url",
"eligible_connectors": [
"zsl"
]
}
],
"card_networks": null,
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": null,
"surcharge_details": null,
"pm_auth_connector": null
}
]
},
{
"payment_method": "bank_transfer",
"payment_method_types": [
{
"payment_method_type": "local_bank_transfer",
"payment_experience": null,
"card_networks": null,
"bank_names": null,
"bank_debits": null,
"bank_transfers": {
"eligible_connectors": [
"zsl"
]
},
"required_fields": null,
"surcharge_details": null,
"pm_auth_connector": null
}
]
}
],
"mandate_payment": null,
"merchant_name": "NewAge Retailer",
"show_surcharge_breakup_screen": false,
"payment_type": null
}
Checklist
- [x] I formatted the code
cargo +nightly fmt --all - [x] I addressed lints thrown by
cargo clippy - [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a CHANGELOG entry if applicable