Skip to content

Instantly share code, notes, and snippets.

View matthewarkin's full-sized avatar

Matthew Arkin matthewarkin

View GitHub Profile
require 'rubygems'
require 'bundler'
Bundler.setup(:default)
require 'stripe'
Stripe.api_key = "api key"
order = Stripe::Order.create(
:currency => 'usd',
<?php
namespace myNamespace;
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
echo "hi";
require_once('vendor/autoload.php');
\Braintree_Configuration::environment('sandbox');
var Hapi = require('hapi');
var Path = require('path');
// Create a server with a host and port
var server = new Hapi.Server({
connections: {
routes: {
files: {
relativeTo: Path.join(__dirname, 'public')
}
<html>
<body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://checkout.stripe.com/checkout.js"></script>
<form id="myForm" action="https://www.google.fr" method="POST">
<input type="text" id="amount" name="amount"/>
<input type="hidden" id="stripeToken" name="stripeToken"/>
<input type="hidden" id="stripeEmail" name="stripeEmail"/>
</form>
<input type="button" id="customButton" value="pay">
<script>
<!DOCTYPE html>
<html>
<head>
<meta name="twitter:card" content="2586390716:buy_now" />
<meta name="twitter:maxage" content="300" />
<meta name="twitter:site" content="@stripe" />
<meta name="twitter:marketplace:id" content="598278611691442176" />
<meta name="twitter:marketplace:merchant:id" content="643514262481170432" />
<meta name="twitter:marketplace:name" content="Stripe" />
<meta name="twitter:marketplace:merchant:name" content="Matthew Arkin" />
> node-gyp rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: connect ETIMEDOUT
gyp ERR! stack at exports._errnoException (util.js:746:11)
gyp ERR! stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1000:19)
gyp ERR! System Linux 3.14.42-31.38.amzn1.x86_64
gyp ERR! command "node" "/opt/elasticbeanstalk/node-install/node-v0.12.2-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/deployment/application/node_modules/slug/node_modules/unicode/node_modules/bufferstream/node_modules/buffertools
@matthewarkin
matthewarkin / operations.patch
Created July 13, 2015 17:42
Couchnode buffer patch
diff --git a/src/operations.cc b/src/operations.cc
index 3e80f02..96086d0 100644
--- a/src/operations.cc
+++ b/src/operations.cc
@@ -38,7 +38,11 @@ static const int PS_QUERY = 6;
template <int X, size_t Y, typename T, typename V>
bool _ParseString(const T** val, V* nval, Handle<Value> key) {
static char keyBuffer[Y];
- *val = (char*)_NanRawString(key, Nan::UTF8, (size_t*)nval,
+ v8::Local<v8::String> keyStr = key->ToString();
Email customers for: Successful payments - Disabled AND Receipt_email set : No receipts sent (Would send receipt in Live mode)
Email customers for: Successful payments - Disabled AND Receipt_email not set : No receipts sent — Enable customer receipts
Email customers for: Successful payments - Disabled AND Receipt_email not set BUT Customer email set : No receipts sent — Enable customer receipts
Email customers for: Successful payments - Enabled AND Receipt_email set : No receipts sent (Would send receipt in Live mode)
Email customers for: Successful payments - Enabled AND Receipt_email not set : No receipts sent — No email address for this payment
Email customers for: Successful payments - Enabled AND Receipt_email not set BUT Customer email set : No receipts sent (Would send receipt in Live mode)
<!DOCTYPE HTML>
<html>
<body>
<script type="text/javascript" src="https://commencepayments.com/js/commence.js"></script>
<button data-type="CommenceButton"
data-key="pk_test_OZwJfcF4YXzwNdYj8isCwTmx"
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
data-name="Demo Site"
data-description="Awesome Project ($20.00)"
Users.findOne({"id":user_id}).exec(function(err, user) {
stripe.customers.create({ //this saves the user to the platform account
source: tokenID,
email: user.email,
description: "Example customer"
}, function (err, customer) {
user.stripe_cust=customer.id;
//this attempts to create a token associated to the connected account id
stripe.tokens.create(