Callbacks

  • All callbacks prevent the default action of taking place
  • To setup your callbacks on user actions you can use:
// implemented
partooPage.on('subscribe', function() {});
partooPage.on('open_business', function() {});
partooPage.on('lab_create', function() {});
partooPage.on('business_created', function() {});
partooPage.on('business_additional_info_updated', function() {});
partooPage.on('business_address_updated', function() {});
partooPage.on('business_contact_updated', function() {});
partooPage.on('business_description_updated', function() {});
partooPage.on('business_open_hours_updated', function() {});
partooPage.on('lab_results_received', function() {});
partooPage.on('no_eligible_business_click', function() {});
partooPage.on('pm_view_go_to_edit_click', function() {});
partooPage.on('pm_view_go_to_partner_connection_click', function() {});
partooPage.on('lab_results_received', function() {});
partooPage.on('no_business_click', function() {});
partooPage.on('lab_login_button', function() {)};
partooPage.on('lab_sign_up_button', function() {});

Subscribe business callback

Happens when a user clicks on subscribe

partooPage.on('subscribe', function(subscribeData) {
        // use business_id
})

subscribeData has the following structure, with presence_management being either presence_management or review_management

{
        "productName": "presence_management",
        "businesses": [
                {
                        "id": "5a2ab4edb12ff67cba1b7e1b",
                        "org_id": 709,
                        "name": "SCEP du Caire",
                }
        ]
}

Open business callback

Happens when a user click a link to open a business page.

partooPage.on('open_business', function(business_id) {
        // use business_id
});

business_id is the identifier of the business the user wants to open

Business created callback

Happens when then user has created a business, has clicked on save and the business has been saved in the Partoo DB ⚠Warning : this callback does not prevent redirection to the business edit page

partooPage.on('business_created', function(business_id) {
        // use business_id
})

Business additional info updated callback

Happens when then user has successfully updated the additionnal info of his/her business (in the additionnal info tab, he/she clicked on save). ⚠Warning : this is a none blocking callback

partooPage.on('business_additional_info_updated', function(data) {
        // use data
})

Business address updated callback

Happens when then user has successfully updated the address of his/her business (in the address tab, he/she clicked on save). ⚠Warning : this is a none blocking callback

partooPage.on('business_address_updated', function(data) {
        // use data
})

Business contact updated callback

Happens when then user has successfully updated contact of his/her business (in the contact tab, he/she clicked on save). ⚠Warning : this is a none blocking callback

partooPage.on('business_contact_updated', function(data) {
        // use data
})

Business description updated callback

Happens when then user has successfully updated the description of his/her business (in the description tab, he/she clicked on save). ⚠Warning : this is a none blocking callback

partooPage.on('business_description_updated', function(data) {
        // use data
})

Business open hours updated callback

Happens when then user has successfully updated the open hours of his/her business (in the open hours tab, he/she clicked on save). ⚠Warning : this is a none blocking callback

partooPage.on('business_open_hours_updated', function(data) {
        // use data
})

Lab create callback

Happens when the user click on create business in the lab view

partooPage.on('lab_create', function(labDetails) {
        // use labDetails
});

labDetails structure is the following :

{
        "civlity": "Mr",
        "email": "deLaBatte@gmail.com",
        "first_name": "Hubert",
        "last_name": "de la Batte",
        "password": "zzzzzzzz",
        "phone": "0102030405"
}

Lab results received callback

Happens when the lab has returned results

partooPage.on('lab_results_received', function(labResults) {
        // use labResults
})

labResults structure is the following :

{
        "annuaire": {
                "stats": {
                        "detailed": {},
                        "summary": {
                                "accurate": 0,
                                "not_found": 1,
                                "error": 0
                        }
                },
                "business": {}
        },
        "le118000": {
                "stats": {
                        "detailed": {},
                        "summary": {
                                "accurate": 0,
                                "not_found": 1,
                                "error": 0
                        }
                },
                "business": {}
        },
}

With a key per integration displayed in the view (google_my_business, annuaire, le118000)

Lab sign up button callback

Happens when a user click on the sign up button in the Lab View.

partooPage.on('lab_sign_up_button', function() {
                // ...
})

Lab login button callback

Happens when a user click on the login button in the Lab View.

partooPage.on('lab_login_button', function() {
                // ...
})

Error callback

Happens when an error 400, 403, 404, 500 happens during page rendering

partooPage.on('error', function(errorCode) {
        // use errorCode
})

errorCode is an int (400 (client error), 403 (not authorized), 404 (not found), 500 (server error))

No business button callback

Happens when a use click on a No Business button.

partooPage.on('no_business_click', function() { /* the code you want to be executed on click */});

No business eligible button callback

Happens when a use click on a No Business button.

partooPage.on('no_eligible_business_click', function() { /* the code you want to be executed on click */});

Presence Managament go to edit click callback

Happens when a use click on a Edit link in the presence management view that should redirect him to business edit view.

partooPage.on('pm_view_go_to_edit_click', function() { /* the code you want to be executed on click */});

Presence Managament go to partner connection click callback

Happens when a use click on a Edit link in the presence management view that should redirect him to connection view.

partooPage.on('pm_view_go_to_edit_click', function() { /* the code you want to be executed on click */});