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
<? | |
\Stripe\Charge::create(array( | |
"amount" => 400, | |
"currency" => "usd", | |
"source" => $_POST['stripeToken'], // obtained with Stripe.js. | |
"description" => "Charge for [email protected]", | |
"shipping" => array( | |
"name" => $_POST['stripeShippingName'], | |
"address" => array( | |
"line1" => $_POST['stripeShippingAddressLine1'], |
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 | |
// Sends an email to customers if their payment fails | |
// If you're using Composer, use Composer's autoload | |
require_once('vendor/autoload.php'); | |
// Be sure to replace this with your actual test API key | |
\Stripe\Stripe::setApiKey("sk_test_YourAPIKey"); | |
// Retrieve the request's body and parse it as JSON |
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 stripe | |
# Be sure to use your API key - https://dashboard.stripe.com/account/apikeys | |
stripe.api_key = "sk_your_secret_key" | |
charges = stripe.Charge.all(limit=100) | |
for charge in charges.data: | |
print(charge.id) |
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 | |
// Create a customer and subscribe them to a plan on a connected account -- should add some error handling | |
// Set your secret key -- generally this should be stored in a config file or ENV variable separate from this code | |
\Stripe\Stripe::setApiKey(PLATFORM_SECRET_KEY); | |
$token = $_POST['stripeToken']; | |
$acct = "acct_yourConnectedAcctID"; | |
// Create a customer on the connected account |
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
txns = Stripe::BalanceTransaction.all(:available_on => 1447113600) | |
amount = 0 | |
txns.data.each do |txn| | |
amount += txn.net # return the net amount with fees removed | |
end | |
transfer_amt = '%.2f' % (amount/100.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
require 'stripe' | |
Stripe.api_key = "sk_your_API_key" | |
customers = Stripe::Customer.all(:limit => 100) | |
customers.each do |customer| | |
puts customer.id | |
end |
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
# require Stripe's Ruby bindings | |
require 'stripe' | |
# set your secret API key. You should generally store this in an evironment variable. | |
Stripe.api_key = "sk_your_key" | |
# grab the first 100 charges | |
charges = Stripe::Charge.list(limit: 100) | |
# print the charge ID for each |
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 | |
// Load Stripe's PHP bindings and set your API key | |
require_once('vendor/autoload.php'); | |
\Stripe\Stripe::setApiKey('sk_your_api_key'); | |
// Retrieve the first 100 customers created in the last month | |
$customers = \Stripe\Customer::all(array("limit" => 100, "created" => array("gte" => strtotime("-1 month")))); | |
// Iterate through the first 100 and output the customer ID and created date |
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 stripe | |
stripe.api_key = "sk_your_api_key" | |
charges = stripe.Charge.all(limit=100, paid='false', include=['total_count']) | |
print (str(charges.total_count) + ' charges failed.') | |
for charge in charges.data: | |
print(charge.id + ' failed. Failure code: '+charge.failure_code) |
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 stripe = require('stripe')('sk_your_api_key'); | |
stripe.events.list( | |
{ limit: 100, type: 'invoice.payment_succeeded' }, | |
function(err, events) { | |
for (i = 0; i < events.data.length; i++){ | |
console.log(events.data[i].id); | |
} | |
if (events.has_more) { | |
paginateEvents(events["data"][events["data"].length - 1].id); |
OlderNewer