require "stripe"
Stripe.api_key = "..."
Stripe::Charge.create(
:amount => 2000,
:currency => "eur",
:source => "tok_mastercard", # obtained with Stripe.js
:description => "Charge for hello@thomascullen.io"
)
import stripe
stripe.api_key = "..."
stripe.Charge.create(
amount=2000,
currency="eur",
source="tok_amex", # obtained with Stripe.js
description="Charge for madison.wilson@example.com"
)
var stripe = require("stripe")(
"..."
);
stripe.charges.create({
amount: 2000,
currency: "eur",
source: "tok_visa", // obtained with Stripe.js
description: "Charge for jayden.martinez@example.com"
}, function(err, charge) {
// asynchronously called
});
stripe.Key = "..."
chargeParams := &stripe.ChargeParams{
Amount: 2000,
Currency: "eur",
Desc: "Charge for benjamin.wilson@example.com",
}
// obtained with Stripe.js
chargeParams.SetSource("tok_mastercard")
ch, err := charge.New(chargeParams)