This file contains 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
<?php | |
namespace qoo\core; | |
/** |
This file contains 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
<?php | |
class Pirate | |
{ | |
public function doPirateStuff() | |
{ | |
echo "YARRRRRRRR I SINK SHIPS!"; | |
} | |
} | |
class Cyborg |
This file contains 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
//Usual express config | |
var SessionSockets = require('session.socket.io'), | |
sessionSockets = new SessionSockets(io, sessionStore, cookieParser); //sessionStore and cookieParser are from connect/express | |
sessionSockets.on("connection",function(err,socket,session) { | |
if (err) | |
console.log(err); | |
else { | |
console.log("Joining channel "+session.username); | |
socket.join(session.username); //This creates a socket.io room with a single socket. |
This file contains 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
{ | |
"method": "GET", | |
"url": "http://api.marketcloud.it/v0/products/22", | |
"httpVersion": "HTTP/1.1", | |
"cookies": [], | |
"headers": [ | |
{ "name": "Accept", "value": "application/json" }, | |
{ "name": "Content-Type", "value": "application/json" }, | |
{ "name": "X-Auth-Token", "value": "YOUR_TOKEN_HERE" } | |
], |
This file contains 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
{ | |
"method": "GET", | |
"url": "http://api.marketcloud.it/v0/brands", | |
"httpVersion": "HTTP/1.1", | |
"cookies": [], | |
"headers": [ | |
{ "name": "X-Auth-Token", "value": "YOUR_TOKEN_HERE" } | |
], | |
"queryString" : [] | |
} |
This file contains 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
{} |
This file contains 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
var superagent = require('superagent'), | |
crypto = require('crypto'); | |
var current_time = Date.now(), | |
public_key = "YOUR-PUBLIC-KEY", | |
secret_key = "YOUR-SECRET-KEY", | |
hash = crypto.createHash('sha256') | |
.update(secret_key+current_time) | |
.digest('base64'); | |
This file contains 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
#!/bin/bash | |
timestamp=$(date +%s) | |
hashedSecret=$(echo -n "YOUR_SECRET_KEY$timestamp" | openssl sha256 -binary | base64) | |
curl -XPOST -H "Content-Type: application/json" -d "{\"publicKey\" : \"YOUR_PUBLIC_KEY\",\"secretKey\" : \"${hashedSecret}\",\"timestamp\" : ${timestamp}}" http://api.marketcloud.it/v0/tokens |
This file contains 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
// Creating a new instance of the Marketcloud client | |
var client = new Marketcloud.Client({ | |
public_key: 'your-public-key' | |
}) | |
// File uploads requires at least user authentication | |
client.users.authenticate('example@mail.com', 'somepassword') | |
.then(function(response) { | |
// Auth was successful the client stored the user's auth token |
This file contains 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
<?php | |
// You need to install the Marketcloud SDK, you will find information on GitHub | |
// https://www.marketcloud.it/documentation/reference/php | |
/* | |
* Here you can find the data structure sent as a POST request | |
* The reference event is order.paid | |
https://docs.razorpay.com/v1/page/webhooks | |
* | |
*/ |
OlderNewer