Skip to content

Instantly share code, notes, and snippets.

@DonSchado
Forked from kangguru/notification.js
Last active May 10, 2016 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DonSchado/0216bc346b7c5dae473679445f365ecb to your computer and use it in GitHub Desktop.
Save DonSchado/0216bc346b7c5dae473679445f365ecb to your computer and use it in GitHub Desktop.
Mangopay Notifications
// ==UserScript==
// @name Mangopay Notifications
// @namespace http://tampermonkey.net/
// @version 0.1
// @description simulate mangopay notifications direct from the dashboard
// @author Lars Brillert
// @include /https://dashboard.sandbox.mangopay.com/Users/\d+/WalletTransactions/\d+/
// @grant none
// ==/UserScript==
/* jshint -W097 */
'use strict';
$("table > tbody > tr").each(function() {
var id = $(this).children("td:first").text().trim()
var type = $(this).children("td:nth-child(8)").text().trim()
var status = $(this).children("td:nth-child(9)").text().trim()
var link = $(this).children("td:nth-child(11)")
var event = type.toUpperCase() + "_NORMAL_" + status.toUpperCase()
if (event == 'REFUNDED PAYIN_NORMAL_SUCCEEDED') {
event = 'PAYIN_REFUND_SUCCEEDED';
}
link.append(
"<a href='http://localhost/hooks?RessourceId="+id+"&EventType="+event+"&Date=1436252110' class='btn btn-xs'><i class='fa fa-bell green'></i></a>"
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment