🚀 #652862-Star Rating Fixes
https://bitrix.vidaselect.com/company/personal/user/322/tasks/task/view/652862/

🚀 #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:

Screenshot_2022-08-18_at_12.21.55_pm

Now all data from the feedback table is saved in Bitrix24:

Screenshot_2022-08-18_at_9.30.03_am

You can use Bitrix24 ORM to work with it: \Dev\ORM\StarRatingsTable::class

The data in the table can be forced to update:

Screenshot_2022-08-18_at_12.26.29_pm

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

Screenshot_2022-08-18_at_12.28.10_pm

The result will look something like this: Screenshot_2022-08-18_at_9.24.49_am