Support » Plugin: GamiPress » Custom Trigger and Listener webhooks call from external website

  • Resolved Hichem

    (@hichem)


    First thanks for the awesome plugin that you have given to the community.
    I am currently developing a plugins to extend GamiPress with new triggers and listeners integration with Restrict Content Pro to ward points and achievement when users purchase a membership level, so far so good the integration is working and gamipress award engine is correctly triggered.

    I wanted to move a step further and trigger awards, when the payment gateway want’s to notify the site about status changes, unfortunately at this level I’m getting erros from GamiPress

    Here is the erros :

    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'logs' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\functions\logs.php on line 138
    [17-May-2019 09:48:22 UTC] 
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'logs_meta' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\functions\logs.php on line 142
    [17-May-2019 09:48:22 UTC] 
    [17-May-2019 09:48:22 UTC] Erreur de la base de données WordPress You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AS l
             
             WHERE ( l.user_id = '64' ) AND ( l.type = 'event_trigg' at line 2 pour la requête SELECT COUNT(*)
             FROM  AS l
             
             WHERE ( l.user_id = '64' ) AND ( l.type = 'event_trigger' ) AND ( l.trigger_type = 'my_prefix_custom_event' ) 
             ORDER BY l.date DESC
              faite par require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, rcp_process_gateway_webooks, RCP_Payment_Gateway_Custom->process_webhooks, RCP_Payments->insert, do_action('rcp_create_payment'), WP_Hook->do_action, WP_Hook->apply_filters, my_prefix_custom_listener, gamipress_trigger_event, gamipress_update_user_trigger_count, gamipress_get_user_trigger_count, gamipress_get_user_log_count, gamipress_query_logs
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'logs' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\functions\logs.php on line 138
    [17-May-2019 09:48:22 UTC] 
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'logs_meta' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\functions\logs.php on line 142
    [17-May-2019 09:48:22 UTC] 
    [17-May-2019 09:48:22 UTC] Erreur de la base de données WordPress You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AS l
             
             WHERE ( l.user_id = '64' ) AND ( l.type = 'event_trigg' at line 2 pour la requête SELECT COUNT(*)
             FROM  AS l
             
             WHERE ( l.user_id = '64' ) AND ( l.type = 'event_trigger' ) AND ( l.trigger_type = 'my_prefix_custom_event' ) 
             ORDER BY l.date DESC
              faite par require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, rcp_process_gateway_webooks, RCP_Payment_Gateway_Custom->process_webhooks, RCP_Payments->insert, do_action('rcp_create_payment'), WP_Hook->do_action, WP_Hook->apply_filters, my_prefix_custom_listener, gamipress_trigger_event, gamipress_log_event_triggered, gamipress_get_user_trigger_count, gamipress_get_user_log_count, gamipress_query_logs
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'db' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 218
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'table_name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 218
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\custom-tables\logs.php on line 193
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\custom-tables\user-earnings.php on line 235
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'db' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 268
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'table_name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 268
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'db' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 268
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'primary_key' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 268
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\custom-tables\logs.php on line 27
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\custom-tables\user-earnings.php on line 27
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\custom-tables\user-earnings.php on line 283
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'db' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 578
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'table_name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 578
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'db' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 623
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'table_name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 623
    [17-May-2019 09:48:22 UTC] Erreur de la base de données WordPress You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '* FROM   WHERE 1=1   ORDER BY . DESC' at line 1 pour la requête SELECT   .* FROM   WHERE 1=1   ORDER BY . DESC  faite par require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, rcp_process_gateway_webooks, RCP_Payment_Gateway_Custom->process_webhooks, RCP_Payments->insert, do_action('rcp_create_payment'), WP_Hook->do_action, WP_Hook->apply_filters, my_prefix_custom_listener, gamipress_trigger_event, gamipress_maybe_award_achievement_to_user, gamipress_check_achievement_completion_for_user, gamipress_achievement_last_user_activity, gamipress_get_user_achievements, CT_Query->get_results
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'db' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 218
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'table_name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 218
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\custom-tables\logs.php on line 193
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\custom-tables\user-earnings.php on line 235
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'db' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 268
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'table_name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 268
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'db' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 268
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'primary_key' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 268
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\custom-tables\logs.php on line 27
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\custom-tables\user-earnings.php on line 27
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\includes\custom-tables\user-earnings.php on line 283
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'db' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 578
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'table_name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 578
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'db' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 623
    [17-May-2019 09:48:22 UTC] PHP Notice:  Trying to get property 'table_name' of non-object in C:\xampp\htdocs\fennecsports\wp-content\plugins\gamipress\libraries\ct\includes\class-ct-query.php on line 623
    [17-May-2019 09:48:22 UTC] Erreur de la base de données WordPress You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '* FROM   WHERE 1=1   ORDER BY . DESC' at line 1 pour la requête SELECT   .* FROM   WHERE 1=1   ORDER BY . DESC  faite par require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, rcp_process_gateway_webooks, RCP_Payment_Gateway_Custom->process_webhooks, RCP_Payments->insert, do_action('rcp_create_payment'), WP_Hook->do_action, WP_Hook->apply_filters, my_prefix_custom_listener, gamipress_trigger_event, gamipress_maybe_award_achievement_to_user, gamipress_check_achievement_completion_for_user, gamipress_get_user_achievements, CT_Query->get_results

    I’am using the code for custom events

    // Listener
    function my_prefix_custom_listener( $payment_id, $args ) {
        
        //error_log( print_r( $args , true ) );
        
        $user_id = $args['user_id'];
    
        do_action( 'my_prefix_custom_listener', $user_id, $args );
        
        gamipress_trigger_event( array(
            // Mandatory data, the event triggered and the user ID to be awarded
            'event' => 'my_prefix_custom_event',
            'user_id' => $user_id,
            'site_id' => get_current_blog_id(),
        ) );
    
        error_log( print_r( $user_id , true ) );
    
    }
    // The listener should be hooked to the desired action through the WordPress function add_action()
    add_action( 'rcp_create_payment', 'my_prefix_custom_listener', 10 , 2 );

    I appreciate if you could help me to understand how to trigger the award from external website using webhooks.

    Many thanks,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author rubengc

    (@rubengc)

    Hi @hichem

    Sorry but we can’t provide help with customization as explained in the plugin FAQ section

    Best regards

    HI @rubengc

    Thanks, I understand I have found a workaround using the rest API, I have some dev related questions regarding your add-ons and to which extent they can be extended and integrated with other plugins, is ok to ask here or should I use the support tool on your website?

    Best Regards,

    Plugin Author rubengc

    (@rubengc)

    Hi @hichem

    You can ask here doubts about GamiPress and/or free add-ons

    For premium add-ons questions, write us directly to our email contact@gamipress.com

    But we won’t provide support custom development questions in anyway

    Best regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Trigger and Listener webhooks call from external website’ is closed to new replies.