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

fedapay-cli

v0.1.4

Published

A command-line tool for FedaPay

Downloads

9

Readme

fedapay-cli

Version Downloads/week License

A command-line tool for FedaPay

Install

$ npm install -g fedapay-cli

Update

$ fedapay update

Usage

$ npm install -g fedapay-cli
$ fedapay COMMAND
running command...
$ fedapay (-v|--version|version)
fedapay-cli/0.1.3 linux-x64 node-v14.3.0
$ fedapay --help [COMMAND]
USAGE
  $ fedapay COMMAND
...
 command-line tool for FedaPay

VERSION
  fedapay-cli/0.1.0 linux-x64 node-v14.3.0

USAGE
  $ fedapay [COMMAND]

TOPICS
  customers     Manage FedaPay customer ressources
  events        Here you can manage events
  logs          Manage FedaPay logs
  payouts       Manage FedaPay payout ressources
  samples       Samples integration built by FedaPay
  transactions  Manage FedaPay transaction ressources

COMMANDS
  customers     Manage FedaPay customer ressources
  events        Here you can manage events
  help          display help for fedapay
  login         Connect to Fedapay account
  logout        Logout of Fedapay account
  logs          Manage FedaPay logs
  payouts       Manage FedaPay payout ressources
  profile       Display current login information
  samples       Samples integration built by FedaPay
  transactions  Manage FedaPay transaction ressources

Get started

Login

To start, you need to connect your FedaPay account.

$ fedapay login

The output will look like this:

Select your environment

One you select your environment, you will be redirecting to the cli server page to login and select your account.

Authenticate Select your account

Now you are set.

Succes message

Create a new transaction

$ fedapay transactions:create -d amount=2500 -d description="Sending money to mum" -d currency[iso]=XOF -d customer[email][email protected]

The output will look like this:

{
  "klass": "v1/transaction",
  "id": 16851,
  "reference": "trx__hQ_1603111067446",
  "amount": 2500,
  "description": "Sending money to mum",
  "callback_url": null,
  "status": "pending",
  "customer_id": 2568,
  "currency_id": 1,
  "mode": null,
  "operation": "payment",
  "metadata": {},
  "commission": null,
  "fees": null,
  "fixed_commission": 0,
  "amount_transferred": null,
  "created_at": "2020-10-19T12:37:47.446Z",
  "updated_at": "2020-10-19T12:37:47.446Z",
  "approved_at": null,
  "canceled_at": null,
  "declined_at": null,
  "refunded_at": null,
  "transferred_at": null,
  "deleted_at": null,
  "last_error_code": null,
  "custom_metadata": null,
  "amount_debited": null
}

Retrieve a transaction

$ fedapay transactions:retrieve --id=16851

The output will look like this:

{
  "klass": "v1/transaction",
  "id": 16851,
  "reference": "trx__hQ_1603111067446",
  "amount": 2500,
  "description": "Sending money to mum",
  "callback_url": null,
  "status": "pending",
  "customer_id": 2568,
  "currency_id": 1,
  "mode": null,
  "operation": "payment",
  "metadata": {},
  "commission": null,
  "fees": null,
  "fixed_commission": 0,
  "amount_transferred": null,
  "created_at": "2020-10-19T12:37:47.446Z",
  "updated_at": "2020-10-19T12:37:47.446Z",
  "approved_at": null,
  "canceled_at": null,
  "declined_at": null,
  "refunded_at": null,
  "transferred_at": null,
  "deleted_at": null,
  "last_error_code": null,
  "custom_metadata": null,
  "amount_debited": null
}

Generate a token and a payment URL

$ fedapay transactions:token --id=16851

The output will look like this:

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjE2ODUxLCJleHAiOjE2MDMxOTc3ODh9.961u7Gf5lr2LouyEGCnRN_uPP7Y4DUuRKL50M_WwVV4",
  "url": "https://fpay.li/uxAga"
}

Retrive the last events

$ fedapay events:list

The output will look like this:

{
  "events": [
    {
      "klass": "v1/event",
      "id": "AXVA3Z99XcBqjxRq9dZr",
      "type": "transaction.created",
      "entity": "{\"id\":16851,\"transaction_key\":null,\"reference\":\"trx__hQ_1603111067446\",\"description\":\"Sending money to mum\",\"callback_url\":null,\"amount\":2500,\"items\":1,\"status\":\"pending\",\"currency_id\":1,\"customer_id\":2568,\"deleted_at\":null,\"created_at\":\"2020-10-19T12:37:47.446Z\",\"updated_at\":\"2020-10-19T12:37:47.446Z\",\"mode\":null,\"approved_at\":null,\"metadata\":{},\"canceled_at\":null,\"declined_at\":null,\"refunded_at\":null,\"transferred_at\":null,\"commission\":null,\"fees\":null,\"amount_transferred\":null,\"operation\":\"payment\",\"fixed_commission\":0,\"last_error_code\":null,\"last_error_message\":null,\"custom_metadata\":null,\"page_id\":null,\"amount_debited\":null,\"approved_partially_refunded_at\":null,\"transferred_partially_refunded_at\":null,\"lock_transfer\":false,\"receipt_url\":null}",
      "object_id": 16851,
      "account_id": 1370,
      "created_at": "2020-10-19T12:37:47.480Z",
      "updated_at": "2020-10-19T12:37:47.481Z",
      "object": "transaction"
    },
    {
      "klass": "v1/event",
      "id": "AXVA1-NXXcBqjxRq9dXC",
      "type": "customer.created",
      "entity": "{\"id\":2568,\"firstname\":\"Jane\",\"lastname\":\"Doe\",\"email\":\"[email protected]\",\"account_id\":1370,\"deleted_at\":null,\"created_at\":\"2020-10-19T12:31:31.628Z\",\"updated_at\":\"2020-10-19T12:31:31.628Z\",\"phone_number_id\":11272}",
      "object_id": 2568,
      "account_id": 1370,
      "created_at": "2020-10-19T12:31:31.634Z",
      "updated_at": "2020-10-19T12:31:31.634Z",
      "object": "customer"
    }
  ]
}

Listen to FedaPay events

$ fedapay events --tail

Events tail output

Listen to FedaPay logs

$ fedapay logs --tail

Logs tail output

Create a webhook and forward remote URL to a local URL

$ fedapay webhooks:listen --url=http://localhost:8080/webhooks

Webhooks listen output

Available commands