hyperswitch
hyperswitch copied to clipboard
refactor: Add dynamic secure link
Type of Change
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Description
We need to refactor the flow of generating payments link. Instead of having two separate routes for generating simple payment link and secure payment link we will maintain single route which will generate payment links accordingly with certain checks.
Additional Changes
- [ ] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
Motivation and Context
How did you test it?
This can be tested by creating payment link using payment create curl. Single link will be provided in payment_link struct which can be used accordingly in secure or open environment.
- Curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_****' \
--data-raw '{
"amount": 100,
"currency": "EUR",
"payment_link": true,
"connector": [
"novalnet"
],
"session_expiry": 1000000,
"return_url": "https://google.com",
"payment_link_config": {
"theme": "#14356f",
"logo": "https://logosandtypes.com/wp-content/uploads/2020/08/zurich.svg",
"seller_name": "Zurich Inc."
},
"customer": {
"id": "cus_ZUT9N3LGGMVUkcxlC6xG",
"name": "John Doe",
"email": "[email protected]",
"phone": "9999999999",
"phone_country_code": "+1"
},
"customer_id": "cus_ZUT9N3LGGMVUkcxlC6xG"
}'
1) Open environment
2) Secure environment
Checklist
- [x] I formatted the code
cargo +nightly fmt --all - [x] I addressed lints thrown by
cargo clippy - [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
Changed Files
| File | Status |
|---|---|
This is not required any more