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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-ecospend-payment-button

v0.1.342

Published

This package adds an Ecospend button to your payment gateway

Readme

React Ecospend Button

This package adds an Ecospend button to your payment gateway.

Installation

Use the package manager of your choice to add it to your React project.

npm install react-ecospend-payment-button
yarn add react-ecospend-payment-button

Usage

import EcospendButton, { EcospendResponseCatcher } from 'react-ecospend-payment-button'

return (
  <EcospendButton
    authenticationUrl="https://myserver.com/authorizeEcospend"
    creditor_account={{
      type: 'SortCode',
      identification: '12345678910111',
      owner_name: 'John Doe'
    }}
    payment= {{
      amount: 3,
      currency: "GBP",
      description: "A cup of coffee",
      reference: "COFFEE_1234",
    }}
  />
  <EcospendResponseCatcher />
)

Explanation of the EcospendResponseCatcher

Ecospend works with Redirect URLs in their popups. To make sure that the payment flow is as smooth as possible, the EcospendResponseCatcher will catch any user coming back to the return URL and automatically closes the window. The main button will handle the processing. The EcospendResponseCatcher should be placed in the Route that the return URL will point to. Default: at the root.

Using this is optional. You can set your own redirectUrl prop to and choose not to include this component at all.

Configuration props

Key | Value | Comment ----| ------|-------- authenticationUrl | string | When set, a POST call will be made to this address to retrieve an access_token for Ecospend. Return format should be: {access_token: '1234'}. Using this method is highly recommended. clientId | string | If you're not using an authenticationUrl, you have to set your Ecospend client id clientSecret | string | If you're not using an authenticationUrl, you have to set your Ecospend client secret buttonText | string | Change the text that will be displayed. Default: Pay with bank transfer redirectUrl | string | If left empty, the redirect URL will be set to the domain root. The EcospendResponseCatcher can close it from here. Override here if necessary. sandboxMode | bool | Whether the API calls and loaded banks should be in sandbox mode or not. Use for testing purposes only.

Ecospend props

The underlying fields correlate with the fields set in the ecospend documentation here

Key | Value | Comment ----| ------|-------- creditor_account | object | Fields type, identification and owner_name are required. payment | object | Fields amount, currency and reference are required.

Methods

Key | Value | Comment ----| ------|-------- onSuccess | function | Callback function for when a transaction is complete. Returns with attribute paymentInfo, which holds all information regarding the payment. onFailure | function | Callback function for when a transaction fails. Returns with an object in the format: {status: String, obj: paymentInfo}.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Disclaimer

This package was created by a lone programmer making this type of component for the first time. Any feedback, improvements or comments are very much welcome.

License

MIT