This repository was archived by the owner on Sep 24, 2020. It is now read-only.
This repository was archived by the owner on Sep 24, 2020. It is now read-only.
Creating Charges #109
Open
Description
Hi sorry, I'm very New to this How do I create/ add a charges on the form?
Stripe shows a way how to do it, but i don't.
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
var stripe = require("stripe")("sk_test_A8rby2nqvlUtn6Ze1EEKeTLR");
// Get the credit card details submitted by the form
var token = request.body.stripeToken; // Using Express
// Create a charge: this will charge the user's card
var charge = stripe.charges.create({
amount: 1000, // Amount in cents
currency: "eur",
source: token,
description: "Example charge"
}, function(err, charge) {
if (err && err.type === 'StripeCardError') {
// The card has been declined
}
});
Metadata
Metadata
Assignees
Labels
No labels