🚀 #652862-Star Rating Fixes https://bitrix.vidaselect.com/company/personal/user/322/tasks/task/view/652862/
Hi, there!
Unfortunately, a rather trivial task required significant efforts to implement it.
So, first of all, due to the rather resource-intensive processing of hooks, I transferred the execution to agents.
Therefore, the task will appear within 5 minutes after the hook is sent.
Also, to unify the code, the corrected executable code was moved to the class public static function \Dev\Helpers\StarRatings::createAgentTask( $ontraportId, $rating )
Processing of third-party requests is performed by files: local/sales/ontraport/csd_low_review_1_star_webhook.php local/sales/ontraport/csd_low_review_2_star_webhook.php local/sales/ontraport/csd_low_review_3_star_webhook.php
Any file can be independently accessed for testing: /local/sales/ontraport/csd_low_review_1_star_webhook.php?testingId={ontraportContactId}
You need to understand that messages will be attached to this task, taking into account the rating.
Now Ontraport SDK is connected centrally by the composer. Also, to complete the task, a package was installed for working with Google services through the API. API is currently only available for Google Spreadsheets.
Secret keys for access are here: local/lib/Google/Keys/gsheet-359619-4d10a0bcbc2c.json
Google Spreadsheet class added: local/lib/Google/Sheets.php
Ontraport classes added: local/lib/Ontraport/Message.php local/lib/Ontraport/Sequence.php local/lib/Ontraport/Tag.php
To access the tables (or other google services), we must give access to the user: serviceacc@gsheet-359619.iam.gserviceaccount.com
You can update the list of Ontraport sequences and like this:
Now all data from the feedback table is saved in Bitrix24:
You can use Bitrix24 ORM to work with it: \Dev\ORM\StarRatingsTable::class
The data in the table can be forced to update:
In the dev.tools module settings, you can select several useful options: https://bitrix.vidaselect.com/bitrix/admin/settings.php?lang=ru&mid=dev.tools&lang=en