Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Payment Form</title>
<link rel="stylesheet" type="text/css" href="https://fxsupport.org/consolidated_common.css" />
<link rel="stylesheet" type="text/css" href="https://fxsupport.org/css/reset-fonts-grids.css" />
<link href='https://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<?php
require __DIR__ . '/lib/Stripe.php';
if ($_POST) {
Stripe::setApiKey("sk_test_OXXXXXXXXXXXXXXXXXXX9");
try {
// Use Stripe's bindings...
} catch(Stripe_CardError $e) {
// Since it's a decline, Stripe_CardError will be caught
$body = $e->getJsonBody();
API_KEY = 'SECRET_API_KEY'
CSV_FILE = 'refunds.csv'
require 'stripe'
require 'CSV'
Stripe.api_key = API_KEY
# Retrieves all refund events from Stripe, handling pagination
def all_refund_events(count=50, offset=0)
var key = 'pk_test_czwzkTp2tactuLOEOqbMTRzG';
var params = {
'card[number]': '4242 4242 4242 4242',
'card[exp_month]': '01',
'card[exp_year]': '2050'
};
$.ajax({
url: 'https://api.stripe.com/v1/tokens',
method: 'POST',
> curl https://api.stripe.com/v1/customers \
-u [apikey]: \
-d "card[number]=4000000000000002" \
-d "card[exp_month]=12" \
-d "card[exp_year]=2015" \
-d "card[cvc]=123" \
> -d validate=false
{
"object": "customer",
"created": 1388967139,
.ticket-reply-button-wrap > div {
float: right !important;
}
#nav {
display: none !important;
}
.console-header {
[2] pry(main)> Stripe::VERSION
=> "1.11.0"
[3] pry(main)> Stripe.api_key = '[redacted]'
=> "[redacted]"
[4] pry(main)> Stripe.api_version = '2014-01-31'
=> "2014-01-31"
[7] pry(main)> begin
[7] pry(main)* Stripe::Customer.create(email: 'baz@example.com', card: { number: '4000000000000002', exp_month: 12, exp_year: 2014 }, metadata: { profile_id: '100' })
[7] pry(main)* rescue Stripe::CardError => exception
[7] pry(main)* puts "Encountered a card error..."
20> func mult(a:Int)(b:Int) -> Int {
21. return a * b
22. }
23> mult(4)
$R10: (b: Int) -> Int =
24> mult(4)(b: 5)
$R11: Int = 20
#import "MSAppDelegate.h"
@implementation MSAppDelegate
@synthesize lifxContext, lastKeyPress;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
self.lifxContext = [[LFXClient sharedClient] localNetworkContext];
self.lastKeyPress = CACurrentMediaTime();
util = require 'util'
lifx = require './lifx'
lx = lifx.init()
log = (text) ->
process.stdout.write("#{text}\n")
typeIsArray = Array.isArray || (value) ->
{}.toString.call(value) is '[object Array]'