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

recurly-js-mock

v0.1.4

Published

A tiny service returning Recurly.js tokens for automated test scenarios.

Downloads

12

Readme

recurly-js-mock

Greenkeeper badge Build Status npm

A tiny service returning Recurly.js tokens for automated test scenarios

What it does

This service returns Recurly.js tokens for automated test scenarios by running a headless browser in the background, entering user-provided data into a minimal payment form and submitting the data to Recurly.

How it works

Single-run mode

  1. Spin up a headless browser (phantomjs via the phantom node interface)
  2. Load a HTML file containing a minimal payment form
  3. Load and configure Recurly.js, this will inject the hosted credit card fields
  4. Fill the form with either user-provided or default values
  5. Submit the form and retrieve the Recurly.js token
  6. Shut down the headless browser and return the token

Daemon mode

Not yet implemented.

Using the CLI

If you installed this package via npm, this package's CLI can be accessed as follows:

$ recurly-js-mock --key <your-recurly-public-api-key>
$recurly-js-mock --help

Usage: recurlyJsMockCLI [options]


Options:

  -V, --version             output the version number
  -k, --key <value>         public key for Recurly.js
  -n, --number [value]      the credit card's number
  -m, --month [value]       the credit card's expiration month
  -y, --year [value]        the credit card's expiration year
  -f, --firstName [value]   first name
  -l, --lastName [value]    first name
  -q, --cvv [value]         the credit card's CVV
  -a, --address1 [value]    address field 1
  -b, --address2 [value]    address field 2
  -c, --city [value]        city
  -o, --country [value]     country, e.g. "US"
  -p, --postalCode [value]  postal code
  -t, --phone [value]       phone number
  -s, --state [value]       state
  -x, --vatNumber [value]   VAT number
  -y, --logLevel [level]    log level [error]
  -h, --help                output usage information

On success, the CLI will return the Recurly.js token.

Using as library

This application is written in TypeScript. To consume its functionality in another project, import the library

import { RecurlyJsMock } from "./recurlyJsMock";

and generate a Recurly.js token

RecurlyJsMock.getTokenSingleRun("<your-recurly-public-api-key>")
  .then((token) => console.log(token.id));

which can be used in automated test scenarios.

Building locally

To build from source locally, clone this repository and run

$ npm install
$ npm run build

License

Copyright (c) Tapkey GmbH. All rights reserved.

Licensed under the Apache License 2.0