Skip to content

Instantly share code, notes, and snippets.

@fred-stripe
fred-stripe / applepay.js
Created April 24, 2017 18:24
jiggery pokery for apple pay—inject a button from the console
Stripe.applePay.checkAvailability(console.log);
var btn = document.createElement("button");
btn.innerText = "Apple Pay Jiggery Pokery";
btn.onclick = function () {Stripe.applePay.buildSession({
countryCode: 'US',
currencyCode: 'USD',
total: {
label: 'Apple Pay Test',
amount: '10.00'
@fred-stripe
fred-stripe / main.go
Created May 19, 2017 19:30
Simple webhook example in Go
package main
import(
"fmt"
"log"
"encoding/json"
"net/http"
"os"
"github.com/stripe/stripe-go/client"
"github.com/stripe/stripe-go"
@fred-stripe
fred-stripe / index.js
Created January 17, 2020 19:53
Google Cloud Functions + Stripe Webhook signing
/**
* Responds to any HTTP request that can provide a "message" field in the body.
*
* @param {!Object} req Cloud Function request context.
* @param {!Object} res Cloud Function response context.
*/
exports.webhook = (req, res) => {
// Required environment variables:
// WEBHOOK_SIGNING_KEY -- the whsec_xxx value displayed when you enable webhook signing for your endpoint
-- A quick hammerspoon to use the buttons on my Akai LPD8
-- which is a pretty fun little drum pad that can be had
-- for $40-50 bucks if you shop around:
-- https://images.reverb.com/image/upload/s--TanFLw05--/t_card-square/v1571420337/zzyfza1vf8wsxjynymgr.jpg
devices = hs.midi.virtualSources()
lpd8 = hs.midi.new(devices[1])
held = {}
@fred-stripe
fred-stripe / HelloStripe.java
Created April 3, 2020 22:03
Simple stripe-java example that uses Maven to pull down the requirements
// To appease Maven, put this file in src/main/java/example/HelloStripe.java
// cd your-copy-of-this-project
// mkdir -p src/main/java/example/
// mv HelloStripe.java src/main/java/example/
package example;
import java.util.HashMap;
import java.util.Map;