-
Notifications
You must be signed in to change notification settings - Fork 2
Incorporate Clientify v2 with automatic v1/v2 detection #175
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Overview
Add support for Clientify v2 API in FormsCRM while maintaining full backwards compatibility with v1. The plugin should automatically detect which API version the user's account uses, so they don't need to reconfigure their form field mappings when the underlying API changes.
Motivation
Clientify v2 introduces a new API with different field structures. Without automatic detection, users would need to manually recreate all their form field mappings after migrating to v2, which is a poor user experience.
Requirements
Automatic version detection
- On credentials validation (
login()), detect whether the account is on Clientify v1 or v2 (e.g. by probing a version-specific endpoint or inspecting the API response). - Store the detected version (e.g. as a setting or derived at runtime) so subsequent calls (
list_modules,list_fields,create_entry) use the correct API path.
Shared interface
- Both v1 and v2 must implement the same
CRMLIB_Clientifyinterface:login(),list_modules(),list_fields(),create_entry(). - Consider splitting the implementation into two internal classes (
CRMLIB_Clientify_V1,CRMLIB_Clientify_V2) with a factory/dispatcher inCRMLIB_Clientifythat delegates based on the detected version.
Field mapping compatibility
- Existing v1 field mappings saved in the DB must continue to work without requiring the user to remap fields.
- If v2 uses different field keys, add a mapping/translation layer so saved v1 mappings can be applied to v2 payloads transparently.
No UX disruption
- Users already configured on v1 should experience no change.
- Users on v2 should be able to set up and use the integration without any extra steps beyond entering their credentials.
Acceptance Criteria
- Plugin detects Clientify API version automatically after saving credentials.
- Form submissions work correctly for both v1 and v2 accounts.
- Existing v1 field mappings are honoured without requiring reconfiguration.
- No HTTP 500 or uncaught errors are thrown for either version.
- Unit/integration tests cover version detection and both API paths.
Related
Closes #174 (Clientify v2 reverted due to 500 errors)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request