How to use the stripe.charges function in stripe

To help you get started, we’ve selected a few stripe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ghaiklor / generator-sails-rest-api / generators / app / templates / api / services / payment / StripePayment.js View on Github external
createCharge: function (options) {
    var defer = Q.defer();

    stripe.charges.create(options, function (error, charge) {
      if (error) {
        defer.reject(error);
      } else {
        defer.resolve(charge);
      }
    });

    return defer.promise;
  },
github ghaiklor / generator-sails-rest-api / generators / app / templates / api / services / payment / StripePayment.js View on Github external
retrieveCharge: function (options) {
    var defer = Q.defer();

    stripe.charges.retrieve(options.id, function (error, charge) {
      if (error) {
        defer.reject(error);
      } else {
        defer.resolve(charge);
      }
    });

    return defer.promise;
  },