feat: split payments support
Type of Change
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Description
Implemented Split Payments
API:
check-balance-and-apply-pm-data
request:
curl 'https://integ.hyperswitch.io/api/v2/payments/12345_pay_019aa18100847d00874101ea39b49417/eligibility/check-balance-and-apply-pm-data' \
-H 'accept: */*' \
-H 'accept-language: en,en-GB;q=0.9,en-US;q=0.8' \
-H 'api-key: pk_snd_7f095116f99247d88666eb2e05e9e007' \
-H 'authorization: publishable-key=pk_snd_7f095116f99247d88666eb2e05e9e007, client-secret=cs_019aa18100a27d50b3548cdf6213b9b7' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'origin: https://dev.hyperswitch.io' \
-H 'pragma: no-cache' \
-H 'priority: u=1, i' \
-H 'referer: https://dev.hyperswitch.io/' \
-H 'sec-ch-ua: "Google Chrome";v="141", "Not?A_Brand";v="8", "Chromium";v="141"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-site' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36' \
-H 'x-browser-name: Chrome' \
-H 'x-browser-version: 141.0.0' \
-H 'x-client-platform: web' \
-H 'x-client-version: 0.127.0' \
-H 'x-payment-confirm-source: sdk' \
-H 'x-profile-id: pro_TeOWYTMpdh8LuDMSlY4Q' \
--data-raw '{"payment_methods":[{"gift_card":{"givex":{"number":"6036280000000000000","cvc":"12345"}}}]}'
response:
{
"balances": [
{
"payment_method_data": {
"gift_card": {
"givex": {
"number": "6036280000000000000",
"cvc": "12345"
}
}
},
"eligibility": {
"success": {
"balance": 5000,
"applicable_amount": 5000,
"currency": "EUR"
}
}
}
],
"remaining_amount": 5000,
"currency": "EUR",
"requires_additional_pm_data": true,
"surcharge_details": null
}
confirm call:
curl 'https://integ.hyperswitch.io/api/v2/payments/12345_pay_019aa18100847d00874101ea39b49417/confirm-intent' \
-H 'accept: */*' \
-H 'accept-language: en,en-GB;q=0.9,en-US;q=0.8' \
-H 'api-key: invalid_key' \
-H 'authorization: publishable-key=pk_snd_7f095116f99247d88666eb2e05e9e007,client-secret=cs_019aa18100a27d50b3548cdf6213b9b7' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'origin: https://dev.hyperswitch.io' \
-H 'pragma: no-cache' \
-H 'priority: u=1, i' \
-H 'referer: https://dev.hyperswitch.io/' \
-H 'sec-ch-ua: "Google Chrome";v="141", "Not?A_Brand";v="8", "Chromium";v="141"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-site' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36' \
-H 'x-browser-name: Chrome' \
-H 'x-browser-version: 141.0.0' \
-H 'x-client-platform: web' \
-H 'x-client-version: 0.127.0' \
-H 'x-payment-confirm-source: sdk' \
-H 'x-profile-id: pro_TeOWYTMpdh8LuDMSlY4Q' \
--data-raw '{"payment_method_type":"card","payment_method_subtype":"card","payment_method_data":{"card":{"card_number":"4000620000000007","card_exp_month":"03","card_exp_year":"2030","card_cvc":"737","card_issuer":"","card_network":"Visa"}},"split_payment_method_data":[{"payment_method_type":"gift_card","payment_method_subtype":"givex","payment_method_data":{"gift_card":{"givex":{"number":"6036280000000000000","cvc":"12345"}}}}],"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36","accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","language":"en","color_depth":24,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"device_model":"Macintosh","os_type":"macOS","os_version":"10.15.7"}}'
{
"id": "12345_pay_019aa18100847d00874101ea39b49417",
"status": "succeeded",
"amount": {
"order_amount": 10000,
"currency": "EUR",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 10000,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 10000
},
"customer_id": "12345_cus_0199704b4b3871c08ac9fde80cfc42bd",
"connector": "adyen",
"created": "2025-11-20T13:42:57.428Z",
"modified_at": "2025-11-20T13:44:52.320Z",
"payment_method_data": {
"billing": null
},
"payment_method_type": "card",
"payment_method_subtype": "card",
"connector_transaction_id": "R7JPDBPQT2JDCQV5",
"connector_reference_id": "12345_att_019aa182ba767933ac1fd45f6521e93d",
"merchant_connector_id": "mca_sCuW2pdMfI2CWyVbfSVb",
"browser_info": null,
"error": null,
"shipping": null,
"billing": null,
"attempts": null,
"connector_token_details": null,
"payment_method_id": null,
"next_action": null,
"return_url": "https://google.com/success",
"authentication_type": "three_ds",
"authentication_type_applied": "three_ds",
"is_iframe_redirection_enabled": null,
"merchant_reference_id": null,
"raw_connector_response": null,
"feature_metadata": null,
"metadata": null
}
How did you test it?
https://github.com/user-attachments/assets/6032faec-1f99-42fe-b266-7c240141dbbe
Checklist
- [x] I ran
npm run re:build - [x] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
Changed Files
🚫 Missing Linked Issue
Hi 👋 This pull request does not appear to be linked to any open issue yet.
Linking your PR to an issue helps keep the project tidy and ensures the issue is closed automatically.
✔️ How to fix this
- Add a keyword like
Fixes #123orCloses #456to your PR description or a commit message. - Or link it manually using the "Linked issues" panel in the PR sidebar.
✅ Tip: You can link multiple issues. 🚫 Note: If only one issue is linked, it must be open for this check to pass.
Once linked, this check will pass automatically on your next push or when you re-run the workflow.
Thanks for helping maintainers! 🙌
🚫 Missing Linked Issue
Hi 👋 This pull request does not appear to be linked to any open issue yet.
Linking your PR to an issue helps keep the project tidy and ensures the issue is closed automatically.
✔️ How to fix this
- Add a keyword like
Fixes #123orCloses #456to your PR description or a commit message. - Or link it manually using the "Linked issues" panel in the PR sidebar.
✅ Tip: You can link multiple issues. 🚫 Note: If only one issue is linked, it must be open for this check to pass.
Once linked, this check will pass automatically on your next push or when you re-run the workflow.
Thanks for helping maintainers! 🙌
🚫 Missing Linked Issue
Hi 👋 This pull request does not appear to be linked to any open issue yet.
Linking your PR to an issue helps keep the project tidy and ensures the issue is closed automatically.
✔️ How to fix this
- Add a keyword like
Fixes #123orCloses #456to your PR description or a commit message. - Or link it manually using the "Linked issues" panel in the PR sidebar.
✅ Tip: You can link multiple issues. 🚫 Note: If only one issue is linked, it must be open for this check to pass.
Once linked, this check will pass automatically on your next push or when you re-run the workflow.
Thanks for helping maintainers! 🙌