-
Notifications
You must be signed in to change notification settings - Fork 21
feat: add new api clients and improve docs #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: add new api clients and improve docs #423
Conversation
- Add FORWARD_SANDBOX_URL and FORWARD_LIVE_URL to config types - Add IDENTITY_VERIFICATION_SANDBOX_URL and IDENTITY_VERIFICATION_LIVE_URL to config types - Update AuthenticationError, ActionNotAllowed, NotFoundError to include error parameter and body property in error types
- Update error handling table: 401/403/404 now include error.body with details - Update test count from 813+ to 816 tests - Extract contributing guidelines to CONTRIBUTING.md - Remove broken RunKit section - Add link to CONTRIBUTING.md in README footer
|
| async createAMLVerification(body) { | ||
| try { | ||
| const url = `${ | ||
| this.config.host.includes('sandbox') ? IDENTITY_VERIFICATION_SANDBOX_URL : IDENTITY_VERIFICATION_LIVE_URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot be this repeated url code a constant of the class initialized only once when the client is created?.
Other clients use config variables like httpclient, all this logic seems more suitable in the config class. same for other clients like this one that have here this url condition.
david-ruiz-cko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment



Add new API clients and improve project documentation
📋 Summary
This PR adds support for 5 new API clients, updates 36 existing endpoints, improves project documentation, fixes a critical error handling bug, and enhances overall code quality. The SDK now provides comprehensive coverage of the Checkout.com API with better developer experience.
✨ New Features
New API Clients Added
Account Updater (
cko.accountUpdater)Network Tokens (
cko.networkTokens)Payment Methods (
cko.paymentMethods)Identities - Complete identity verification suite (
cko.identities)Issuing - 10 new submodules (
cko.issuing)🔄 Updates to Existing Endpoints
Updated 36 existing API endpoint implementations to align with latest API specifications:
📚 Documentation Improvements
README.md
error.bodyinformationNew Files
TypeScript Definitions
FORWARD_SANDBOX_URL,FORWARD_LIVE_URL,IDENTITY_VERIFICATION_SANDBOX_URL,IDENTITY_VERIFICATION_LIVE_URLAuthenticationError,ActionNotAllowed,NotFoundErrorto includebodyproperty🐛 Bug Fixes
Critical Error Handling Fix
Issue: Error responses for 401/403/404 status codes were not propagating response body details to merchants, preventing visibility into error causes (e.g., "card_not_enrolled" in Sessions endpoint 403 responses).
Solution:
AuthenticationError,ActionNotAllowed,NotFoundErrorconstructors to accept and store error bodydetermineErrorfunction to passawait errorJSONto these error classesImpact: Merchants can now access detailed error information via
error.bodyfor better debugging and error handling.🔧 Configuration & Metadata Improvements
package.json
LICENSE
.npmignore
jsconfig.json
eslint.config.js
prefer-const,no-var,eqeqeq,no-throw-literal,prefer-promise-reject-errors🧪 Testing
🔍 Code Quality
EnvironmentSubdomain.jsandfiles.js📦 Commits Breakdown
feat(account-updater): Add Account Updater API clientfeat(identities): Add Identities API with all submodules (6 submodules)feat(issuing): Add new Issuing submodules (10 submodules)feat(network-tokens): Add Network Tokens API clientfeat(payment-methods): Add Payment Methods API clientfeat: Integrate new API clients into SDK (Checkout.js, index.js exports)feat: Update existing API endpoints (36 modules)test(payment-setups): Add comprehensive test coveragedocs: Rewrite README with improved structure and HTTP client documentationchore: Update package metadata, LICENSE, .npmignore, jsconfig.jsonchore: Improve code quality with ESLint rules and remove unused variablesfix: Propagate error body for 401/403/404 status codesdocs(types): Add missing config URLs and update error typesdocs: Update README and extract CONTRIBUTING to separate fileNone. All changes are backwards compatible. Existing code will continue to work without modifications.
🎯 Migration Notes
cko.paymentsinstead)error.bodynow available for 401/403/404 responses✅ Checklist
📸 Test Results
Ready for review and merge to master. This PR significantly expands SDK capabilities while maintaining high code quality and test coverage.