This sends data to stripe, it is reflected in the logs, but stripe redirects to /charge and I don’t have a route set to that url and there are 0 successful charges in the stripe dashboard
server/methods
'chargeCard': function (stripeToken) { check(stripeToken, String); var Stripe = StripeAPI('sk_test_xxxxxxxxxxxxxxxxxxxx');
Stripe.charges.create({ source: stripeToken, amount: Session.get('stripe-cart-total'), // this is equivalent to $50 currency: 'usd', receipt_email: Meteor.user().emails[0].address, }, function (err, charge) { console.log(err, charge); }); },
The html button
<form action="/charge" method="POST"> <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="pk_test_xxxxxxxxxxxxx" data-amount="{{stripeCartTotal}}" data-name="test" data-description="Checking out the test" data-image="/img/favicon.png" data-zip-code=true data-billing-address=true data-shipping-address=true data-locale="auto"></script> </form>
client/init.js
Meteor.startup(function () { Stripe.setPublishableKey('pk_test_xxxxxxxxxxx'); const handler = StripeCheckout.configure({ key: 'pk_test_xxxxxxxxxxxx', token: function (token) {} }); });