Skip to content

makeshopio/sails-service-stripe

Repository files navigation

sails-service-stripe

TravisCI Coverage Status

Service for Sails framework for Stripe payment features.

Stripe Node documentation (docs)

Getting Started

Install this module.

npm install sails-service-stripe

Then require it in your service and create payment instance.

// api/services/StripeService.js
import StripeService from 'sails-service-stripe';

export default StripeService('stripe', {
  apiKey: '<STRIPE_API_KEY>'
});

// api/controllers/PaymentController.js
export default {
  checkout: function(req, res) {
    StripeService
      .checkout({
        amount: req.param('amount'),
        cardNumber: req.param('cardNumber'),
        expMonth: req.param('expMonth'),
        expYear: req.param('expYear'),
        cvv: req.param('cvv')
      })
      .then(res.ok)
      .catch(res.negotiate);
  }
};

About

Stripe payment service for Sails utilizing Stripe.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •