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' | |
# Your platform's secret key | |
Stripe.api_key = "YOUR-SECRET-KEY" | |
# Get a timestamp for the beggining of the year | |
start = DateTime.rfc3339('2017-01-01T00:00:00Z').to_time.to_i | |
# Retrieve transactions - you could use the Stripe-Account header here to get the transactions on a connected account as well. | |
transactions = Stripe::BalanceTransaction.list(limit: 100, created: { gte: start }) |
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
# A simple text-based email receipt webhook, written for Sinatra. Sends email receipts for one-off charges. | |
# See https://github.com/adamjstevenson/stripe-ruby-webhook-receipts for more specifics | |
require 'sinatra' | |
require 'stripe' | |
require 'mailgun-ruby' | |
# Set your Stripe secret key as an environment variable: https://dashboard.stripe.com/account/apikeys | |
Stripe.api_key = ENV['STRIPE_KEY'] |
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
# A simple text-based email receipt webhook, written for Sinatra. Sends email receipts for one-off charges. | |
# See https://github.com/adamjstevenson/stripe-ruby-webhook-receipts for more specifics | |
require 'sinatra' | |
require 'stripe' | |
require 'mailgun-ruby' | |
# Set your Stripe secret key as an environment variable: https://dashboard.stripe.com/account/apikeys | |
Stripe.api_key = ENV['STRIPE_KEY'] |
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
# Load the Stripe library and set your secret key | |
require 'stripe' | |
Stripe.api_key = ENV['SECRET_KEY'] | |
# List connected accounts | |
accounts = Stripe::Account.list(limit: 100) | |
# Paginate through the list of accounts | |
accounts.auto_paging_each do |acct| | |
# Retrieve the balance for this account |