Skip to content

Instantly share code, notes, and snippets.

@adamjstevenson
Created October 22, 2017 18:28
Show Gist options
  • Save adamjstevenson/b13730a620943bfa12710c20892f2e90 to your computer and use it in GitHub Desktop.
Save adamjstevenson/b13730a620943bfa12710c20892f2e90 to your computer and use it in GitHub Desktop.
Split payments between sellers
# Create a charge for $10
charge = Stripe::Charge.create({
amount: 1000,
currency: "usd",
source: "src_1BF7yx2jy8PDLWD6TFmguGn0",
transfer_group: "notes_328324"
})
# Send $4 to one account
transfer = Stripe::Transfer.create({
amount: 400,
currency: "usd",
destination: "acct_j1cXUEAksEpalsjc3",
transfer_group: "notes_328324"
})
# Sent $5 to another
transfer = Stripe::Transfer.create({
amount: 500,
currency: "usd",
destination: "acct_1BF8VRBAxruRdpTq",
transfer_group: "notes_328324"
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment