Skip to content

Instantly share code, notes, and snippets.

@boucher
boucher / gist:1750375
Created February 6, 2012 07:09 — forked from siddarth/gist:1379745
Stripe PHP simple example
<?php
require 'path-to-Stripe.php';
if ($_POST) {
Stripe::setApiKey("YOUR-API-KEY");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");
@boucher
boucher / webhook-mailer.php
Created January 31, 2012 01:45
Stripe Webhook PHP Example
<?php
// SETUP:
// 1. Customize all the settings (stripe api key, email settings, email text)
// 2. Put this code somewhere where it's accessible by a URL on your server.
// 3. Add the URL of that location to the settings at https://manage.stripe.com/#account/webhooks
// 4. Have fun!
// set your secret key: remember to change this to your live secret key in production
// see your keys here https://manage.stripe.com/account
@boucher
boucher / gist:1750368
Created February 6, 2012 07:07 — forked from saikat/gist:1084146
Stripe sample checkout form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Sample Form</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<script type="text/javascript">
alpha_1 | E0111 01:55:50.572284 16 panics.go:33] panic: interface conversion: interface {} is int64, not []interface {}.
alpha_1 | trace: goroutine 132351 [running]:
alpha_1 | runtime/debug.Stack(0xc00649b7e8, 0x1bcad80, 0xc00471a0f0)
alpha_1 | /usr/local/go/src/runtime/debug/stack.go:24 +0x9f
alpha_1 | github.com/dgraph-io/dgraph/graphql/api.PanicHandler(0xc00649bf28)
alpha_1 | /ext-go/1/src/github.com/dgraph-io/dgraph/graphql/api/panics.go:33 +0x57
alpha_1 | panic(0x1bcad80, 0xc00471a0f0)
alpha_1 | /usr/local/go/src/runtime/panic.go:969 +0x1b9
alpha_1 | github.com/dgraph-io/dgraph/graphql/resolve.idFilter(0xc00471a090, 0x1f987a0, 0xc00471a0c0, 0x1bae9a0, 0xc00471a090, 0xc00005dc00)
alpha_1 | /ext-go/1/src/github.com/dgraph-io/dgraph/graphql/resolve/query_rewriter.go:1453 +0x125
@boucher
boucher / StripeTutorialPage.html
Created February 6, 2012 07:05
Stripe Tutorial Payment Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method FcmDartService#start on channel plugins.flutter.io/firebase_messaging)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
<asynchronous suspension>
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
#2 FirebaseMessaging.configure (package:firebase_messaging/firebase_messaging.dart:130:16)
#3 main (package:wormhole/main.dart:18:22)
#4 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:75:64)
#5 _rootRunUnary (dart:async/zone.dart:1134:38)
#6 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#7 _FutureListener.handleValue (dart:async/future_impl.dart:140:18)
(00.000047) Added /app/available_modules:/app/available_modules ext mount mapping
(00.000072) Added /app/modules/db:/app/modules/db ext mount mapping
(00.000075) Added /etc/resolv.conf:/etc/resolv.conf ext mount mapping
(00.000077) Added /etc/hostname:/etc/hostname ext mount mapping
(00.000079) Added /etc/hosts:/etc/hosts ext mount mapping
(00.000083) ========================================
(00.000089) Dumping processes (pid: 22777)
(00.000091) ========================================
(00.000146) Found anon-shmem device at 4
(00.000157) Reset 22830's dirty tracking
### Keybase proof
I hereby claim:
* I am boucher on github.
* I am boucher (https://keybase.io/boucher) on keybase.
* I have a public key whose fingerprint is F4FE 783B 7CB0 C0EF DDBE 84A0 465F 9F37 14A0 59E3
To claim this, I am signing this object: