2017 © Pedro Peláez
 

gplcart-module webhook

Allows to inform external resources about various system events by sending HTTP POST payloads

image

gplcart/webhook

Allows to inform external resources about various system events by sending HTTP POST payloads

  • Saturday, March 10, 2018
  • by gplcart
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Build Status Scrutinizer Code Quality, (*1)

Web Hook is a GPL Cart module that allows to inform external resources about various system events by sending HTTP POST payloads, (*2)

Features:, (*3)

  • Configurable triggering hooks
  • Configurable payload URL
  • Data encryption

Requirements:, (*4)

  • CURL

Installation, (*5)

  1. Download and extract to system/modules manually or using composer composer require gplcart/webhook. IMPORTANT: If you downloaded the module manually, be sure that the name of extracted module folder doesn't contain a branch/version suffix, e.g -master. Rename if needed.
  2. Go to admin/module/list end enable the module
  3. Go to admin/module/settings/webhook and adjust settings

Receiving payloads, (*6)

Example settings:, (*7)

  • Url: http://domain.com/webhook.php
  • Sender: My cool site
  • Key: My secret key
  • Salt: My salt

In webhook.php paste the following code, (*8)

if(isset($_POST['sender']) && $_POST['sender'] === 'My cool site'){

    $json = $_POST['data'];

    if($_POST['encrypted']){
        $secret = hash("sha256", 'My secret key');
        $hash = substr(hash("sha256", 'My salt'), 0, 16);
        $json = openssl_decrypt($json, "AES-256-CBC", $secret, 0, $hash);
    }

    $payload = json_decode($json, true);
    print_r($payload);
}

The Versions

10/03 2018

dev-master

9999999-dev

Allows to inform external resources about various system events by sending HTTP POST payloads

  Sources   Download

GPL-3.0 GPL-3.0-or-later

The Requires

 

by Iurii Makukh

ecommerce shopping cart gplcart gplcart-module gplcart-api

10/03 2018

dev-dev

dev-dev

Allows to inform external resources about various system events by sending HTTP POST payloads

  Sources   Download

GPL-3.0-or-later

The Requires

 

ecommerce shopping cart gplcart gplcart-module gplcart-api