npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-recurly

v0.0.6

Published

Ember-cli addon for using Recurly.js

Downloads

4

Readme

ember-cli-recurly

npm version

This addon is a solution for integrating Recurly.js into your Ember.js web app.

Installation

ember install ember-cli-recurly

Usage

  • Create Recurly account: https://recurly.com/
  • Define your Recurly public key in config.
//config/environment.js
module.exports = function(environment) {
  var ENV = {
    //...
    recurly: {
      publicKey: '<your-public-key>'
    }
  };
//...

Inject the service where needed.

recurly: Ember.inject.service()

recurly

Service injection gives access to a global object recurly. Can Also be used to obtain a token using the service.

getToken()

getToken() makes a request to Recurly to retrieve a token using the passed in options token property on the service. Accepts billingInfo as an argument. Returns an Ember.RSVP.Promise which is either resolved with token containing token object or with err which explains why token request failed. It is used like this:

var billingInfo = {
  // required attributes
  first_name: 'John',
  last_name: 'Rambo',

  // optional attributes
  cvv: '123',
  address1: '123 Main St.',
  address2: 'Unit 1',
  city: 'Hope',
  state: 'WA',
  postal_code: '98552',
  country: 'US',
  vat_number: 'SE0000'
};

this.get('recurly').getToken(billingInfo).then(function(token) {
  // do anything with token here
});

token

token is an object which contains the id of the token that can be the used in a recurly transaction.

{
  id: '123abcdebfexample'
}

The object is also held in the service and can be retrieved like so:

let token = this.get('recurly.token')

payPal()

payPal() initiates a PayPal checkout with recurly. Accepts opts as options for the PayPal agreement flow. Returns an Ember.RSVP.Promise which is either resolved with token containing the token or with err which explains why the PayPal request failed. If request is successful the token attribute in the service will also be updated. For more information on how to configure PayPal with Recurly refer to Recurly documentation: https://docs.recurly.com/payment-gateways/paypal-payments It is used like this:

let opts = { descriptions: 'Bazooka Monthly' };

this.get('recurly').payPal(opts).then(function(token) {
  // do anything with token here
  })

getBankInfo()

getBankInfo() looks up additional bank information based from a given routing number. Accepts routingNumber as an argument. Returns an Ember.RSVP.Promise which is either resolved with bankInfo containing bank information or is rejected with err which explains why bank info request failed. It is used like this:

var routingNumber = '1234567';

this.get('recurly').getBankInfo(routingNumber).then(function(bankInfo) {
  // do anything bankInfo here
});

Example of bank information returned:

{
  bank_name: 'BANK OF RECURLY'
}

For more information and using the recurly object refer to Recurly.js docs: https://docs.recurly.com/js/#how-it-works

#TODO

  • recurly.pricing API
  • Write tests

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.