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
> 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, |
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 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', |
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
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) |
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 | |
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(); |
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
<!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> |
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 | |
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"); |
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 | |
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"); |
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
import Control.Monad ( liftM ) | |
import Web.JonathansCard ( latest ) | |
main :: IO () | |
main = putStrLn . show =<< latest | |
{- Outputs: | |
Right (Balance {balAmount = 28.08, balBalanceId = 25573, balCreated = Just | |
2011-08-08 00:56:03 UTC, balMessage = "My balance is $28.08 as of Aug 7th at |
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
skeletonBase :: String -> String -> Html -> AttributeValue -> AttributeValue | |
-> Html -> Html | |
skeletonBase cssDir iconDir title desc author content = do | |
docType | |
htmlTag | |
htmlBody $ do | |
-- ... |
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
-- | Special set of conditionals for the HTML tag to make Skeleton compatible | |
-- with all browsers. | |
htmlTag :: Html | |
htmlTag = do | |
comment "lt IE 7" $ htmlEn ! class_ "ie ie6" | |
comment "IE 7" $ htmlEn ! class_ "ie ie7" | |
comment "IE 8" $ htmlEn ! class_ "ie ie8" | |
comment "(gte IE 9)|!(IE)" $ htmlEn | |
where htmlEn = html' ! lang "en" $ "" |