hyperswitch
hyperswitch copied to clipboard
feat(connector): [Nexixpay] add mandates flow for cards
Type of Change
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Description
Integrate mandates flow for card payments. https://developer.nexi.it/en/funzionalita-/pagamenti-ricorrenti
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?
Create Call
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_VyjzlxA4qJnZUAalRRpB8MGDRzw6moojPrhbHThoGwxrZiyCvNnuIdVKoWvumalE' \
--data '{
"amount": 3545,
"currency": "EUR",
"confirm": false,
"customer_id": "tester799",
"setup_future_usage": "off_session"
}'
Confirm Call
curl --location 'http://localhost:8080/payments/pay_sFK1K3juhPteyDXgEH8X/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_VyjzlxA4qJnZUAalRRpB8MGDRzw6moojPrhbHThoGwxrZiyCvNnuIdVKoWvumalE' \
--data-raw '{
"payment_method": "card",
"return_url": "https://google.com",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4349940199004549",
"card_exp_month": "12",
"card_exp_year": "30",
"card_holder_name": "Joseph Does",
"card_cvc": "396"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IT",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IT",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"customer_acceptance": {
"acceptance_type": "offline"
}
}'
MIT Call
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_VyjzlxA4qJnZUAalRRpB8MGDRzw6moojPrhbHThoGwxrZiyCvNnuIdVKoWvumalE' \
--data '{
"amount": 3545,
"currency": "EUR",
"confirm": true,
"customer_id": "tester799",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_WqDpelm1rZ4yvUkf579X"
},
"off_session": true
}'
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 |
|---|---|
Please add cypress test cases as well. Could not run cypress tests since we don't have support for 3ds mandates cypress tests. cc: @likhinbopanna
@mrudulvajpayee4935 Please run the cypress testcases for nexixpay
have support for 3ds mandates cypress tests.
do we have support for 3ds mandates cypress tests? @Gnanasundari24