-
-
Save DonSchado/0216bc346b7c5dae473679445f365ecb to your computer and use it in GitHub Desktop.
Mangopay Notifications
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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