Skip to content

Instantly share code, notes, and snippets.

@adamjstevenson
Last active December 15, 2017 12:59
Show Gist options
  • Save adamjstevenson/8ea94f08fd907aa1def10a5033522783 to your computer and use it in GitHub Desktop.
Save adamjstevenson/8ea94f08fd907aa1def10a5033522783 to your computer and use it in GitHub Desktop.
Create a direct charge on a Connected account
# Create a charge for $100 and take a $10 commission for the platform
charge = Stripe::Charge.create(
{
amount: 10000, # Charge amount in cents
currency: "usd", # The currency of the charge
source: "src_1BF7yx2jy8PDLWD6TFmguGn0", # A source token representing a Visa card
application_fee: 1000 # The commission your platform is taking
},
{
stripe_account: "acct_j1cXUEAksEpalsjc3Xl3" # The ID of the Stripe account connected to your platform
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment