-----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEbXCAeh4tnJbE5ao1VRlr7kRfYEkFAmIGcDQACgkQVRlr7kRf YEmtNgwAqaz7/NUJ74cYx9VzrhP95aVn77Z8nRHoZUf0LNpXIaDkFchsuhTHQvRV 72Yx51sfhvGpILLqIhMvRGoMP6qIry+86M6g1t6nMS38IhSi6tUsbXa3HBIsQfwk OH+GmhrhzNtCpk8mzKnHOEx4Ie/yGpl6LFbfb+X8qZgatjqEcg/zFBwlfW7JziiQ X9fV8X+utif3b9or7g5PWTvoJCd1+Vlh0cfOUuNa2mohC0R587lSm6cGK62sXbOp EQ9NBKumxC6c1CDQADaaY0uuLXTp5UApRmCr2wuKhhanM3XSI8MqJy8x8yo/jKcB zFAf2oFm/q36aOcFBgfDpIxM0i5BMkOJI6z9EXF7erw+SnBVJNhz4LUi5WtSaPip UUetmfywnnHtuRE1zTfOxyruF2WvpjlVgySRrgwn43+r9REJCMUuiZ5l4Dy6/BFl JOwWO/Q3SYae6v54NTxET6GQiwEUuCxpPvhdoPv9OtyDcU730748wza5CPs/nv3H kj8+R4Pc =7/kD -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEbXCAeh4tnJbE5ao1VRlr7kRfYEkFAmIGcDoACgkQVRlr7kRf YElmUAv+NmXTamlvT23WQM2xabHC0JvYzqnEdlU3zhe/rW98YfyHiBBozmJCKCry /QDmYK14htnBT8gROVb+8R5Ma/zfv0YGmt23+8CmU51kAYWS4WRSrXG1gMsGQfjP f2Ya0R7S3gxg7KHBTzO/IgumMmlS428YCQ3cGIbKvgSDkj1cwu3Mciw/Fe10J1HQ 3+X7HbpUUvRWI38Requbx/Y5KDP7V7m8mUf4cUw9FkmggM8nqYbBZWxslPI6xiGc C+mIyKFvFI6UFr63WyMHWpBBxaDDadxhtzlpeMcp/3y9kz7br/Y6uRwxBEGNaA3N +wS/HRTwPKK6VeYIjV2pWLQV1XBpQenme6E1qh154RjEEd76Lqfb1Uy3/B7Ja5v3 44W+zNwMbo4EJqf2472EBXfSxIoAodFobFerppmN2HuTip8Md9g7U0GTepTW0wSC NfqIAuMxiV6g1WBzQe2H+iWG4qTyA8PFmVw/egxXTGLvwFvX0zuZAz1k3wDRjNDG brMVTamC =zZ8B -----END PGP SIGNATURE----- Merge tag '3.0.1' 3.0.1 |
||
|---|---|---|
| .vscode | ||
| docs | ||
| documentation | ||
| examples | ||
| resources/lang | ||
| src | ||
| .editorconfig | ||
| .env.default | ||
| .gitignore | ||
| .gitkeep | ||
| apiConfig.readonly.json | ||
| changelog.md | ||
| composer.json | ||
| composer.lock | ||
| license.md | ||
| phpcs.xml | ||
| phpdoc.dist.xml | ||
| readme.md | ||
LDC CRM api
Api client for CRM V2
Client version must match CRM version !!
Installation
Multiple ways are possible. You may include the client directly into your project using composer. You will need to have access to this repos. If you read this it may already be the case. So using composer update or composer require ldc/ldccrmv2client should be enough.
This has few dependencies it may not interfer with your project.
"ext-curl": "^7.3",
"php": "^7.3",
"kwaadpepper/enum": "^2.1",
"guzzlehttp/guzzle": "^7.4",
"respect/validation": "^2.2"
Usage
As for initialisation multiple ways are possible. If you are in a laravel project you can map a singleton of the crm api.
Using Laravel
-
Setup
config/crm.php<?php return [ 'endpoint' => 'https://ldc-crm.ldc.fr', 'token' => 'YOUR_API_TOKEN', 'password' => 'YOUR_API_PASSWORD' ]; -
Make a crm singleton if needed (optional)
// In AppServiceProvider.php App::singleton('CrmApiV2', function () { return new CrmApiV2(); }); // You then like this. /** @var \LDC\LDCCRM\CrmApiV2 $crmApi */ $crmApi = app('CrmApiV2); // Or directly use static methods. /** @var \LDC\LDCCRM\Models\Customer|null $customer */ $customer = Customer::find('UUID');
Using any other project
Setup once the main class (it is already a singleton, no need to manage it).
Informations will be kept in memory as static meaning all instance of CrmApiV2 or any class (Customer, ..) will share the same informations as credentials.
$crmToken = 'YOUR_API_TOKEN';
$crmPassword = 'YOUR_API_PASSWORD';
// This has to hapen once. It will be kept in memory;
new CrmApiV2('https://ldc-crm.ldc.fr', $crmToken, $crmPassword);
Using Wordpress
We created as experimental some wordpress classes. It will handle locale storage (in sql database) and sessions using start session. Some security is provided with a settion time out of 15 minutes. A fingerprint is set using the user agent and remote_ip. These cannot be trusted and it wont prevent a replay attack though. Usefull to point out that you make not use this without ssl (https) connection.
The usage is that same as for setting up for any other project, bu instead you can make usage of class in the LDC\LDCCRM\WordPress namespace.
Note: using methods from classes in this namespace will call php session_start if it has not started yet
// If true from here; user session is set and will be remembered until timeout or WPCRM::logout.
$status = WPCRM::login('customer@email.com', 'password');
Using custom implementation and calling directly CRM
You may implement your own call to fit your needs. If you wish to go this way please read these instructions.
More information
- Using WordPress client
- Using normal client
- Writing your own implementation
Customer Informations
The CRM will store multiple informations about your customer. Of course you can contact us if there is a RGPD demand to access or suppress information. Also we store the following informations as for now :
- last connection
- password
- first name
- last name
- birth date
- address
- phone
- country
- city
- postcode
- opt in status and history
- question answers
Password is stored as hashed using strong algorithm and a secret key, no logs are done while authenticating your customer other than the connection date if auth is successful
You may also note that every customer has a HASHCODE, this is the ID of your customer and has to be stored on your side. But even if you don't you can always identify your customers using it's email.
Minimal informations you may keep are :
- hashcode
Change log
Please see the changelog for more information on what has changed recently.
Testing
All unit test are included in the crm source code, meaning you do not have access to them. If you wish you can override any source code, write your own test, but data will still be validated on crm side.
Credits
License
MIT. Please see the license file for more information.