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

logicl-flexpay-transaction-client-js

v0.0.2

Published

FlexPay Transaction API Javascript client

Downloads

3

Readme

Logicl FlexPay Service Javascript Client

This monorepo contains client packages for interfacing with the FlexPay Transaction API.

Installation

npm install @logicl/flexplay-transaction-client

Developer Notes

Do not add package dependencies using 'npm install'. Use the appropriate lerna commands.

The packages should be built using the npm run build command. This executes the build script to compile and lint the source.

Running Unit Tests

Unit tests can be run using the package.json script 'test', e.g., npm run test. This will run the test script in the packages.

Alternately tests can be run by changing to the package's directory (./packages/flexpay-transaction-client) and running the npx jest unit/ or npm run test command.

Tests with verbose output can be run from the package's directory with the npm run test:loud command.

Running Integration Test

Integration tests require the following environment variable to be set before execution:

  • X_FP_GATEWAY_TOKEN - The gateway token configured in the FlexPay account
  • X_FP_API_KEY - A FlexPay API key configured in the FlexPay account
  • X_FP_MERCHANT_ACCOUNT_REFERENCE_ID - The Merchant account reference id from the gateway configured in the FlexPay account

The FlexPay API requires a delay between executing a transaction and performing a follow up transaction (e.g., charge then read, auth then capture). This delay is configurable in the tests. Because of this required delay the tests can take a long time to execute.

The package.json script npm run integration-test will execute the 2 sandbox tests and should be run from the project root.

The integration tests can also be executed from the package's directory (./packages/flexpay-transaction-client). Use the npm run test:integration-prod or npm run test:integration/sandbox-env commands. Or the can be executed with the npx jest command but you should run specific integration tests rather than the entire subdirectory.

The integration tests have been split into prod and sandbox tests. Some tests will always fail in the FlexPay sandbox environment and so have been split into a set of production tests. Caution should be used when executing production tests.

For more output from the tests use the npx jest commandline or modify the jest.config.ts and the package.json scripts. Additionally the FlexPayTransactionClient debugOutput options can be modified in the test.

Publishing to npmjs.org

A publish or automation token is required and needs to be export in the NPM_AUTH_TOKEN environment variable before publishing.

All work must be committed before lerna can will publish. The publishing process will modify the package.json files of the packages with the next version number and a new commit and tag will be pushed to the git repository.

Execute the publish by running the npm run publish command.

Version bumping from a pre-release

If you've published a -beta or -alpha version to npm and are ready to publish a release version that doesn't require any changes (has no new commits) lerna requires additional commandline parameters in order to publish.

npx lerna publish --force-publish=[package name]

The package name value is the name value from the package.json.

lerna will then prompt you for the new version number, update the repo, and publish the package.

lerna command summary.

These commands should be run from the project root rather than the package roots.

  • npm install -- install npm modules for the root and also all the workspaces in /packages. This must be run once after cloning to install the lerna packages.
  • npx lerna bootstrap -- install all dependencies and will also handle local dependencies (if any).
  • npx lerna create package -- add a new package to the monorepo with basic scaffolding. You will need to create the tsconfig.json and modify the package.json after the package is created.
  • npx lerna add module ./packages/[package name] [--dev] -- replaces npm install module for packages. If a package path is omitted the module will be added as a dependency in all the packages.
  • npx lerna run tsc -- runs the package.json script 'tsc' from all the packages (so you don't have to run them individually).