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

chimoney-payment-widget

v0.0.28

Published

Accept Payment from card, wallets, mobile money, interac and other options powered by chimoney.io.

Downloads

374

Readme

Chimoney Payment Widget

Simplify payments within your web application with Chimoney's embedded payment widget.

Our widget allows you to integrate a multi-currency payment gateway directly into your web applications, supporting a seamless checkout experience with customization options to match your brand.

Install with:

$ yarn add chimoney-payment-widget

For non-module usage, include directly in your HTML:

<script src="https://cdn.jsdelivr.net/gh/Chimoney/payment-widget@main/dist/chimoney-payment-widget.umd.js"></script>.

Usage

For Module Bundlers

For projects using module bundlers like Webpack, Rollup, or when using frameworks like React, Vue.js, etc.:

import PaymentWidget from 'chimoney-payment-widget';

// Initialize the widget with your configuration
const paymentWidget = new PaymentWidget({
  brandColor: '#FF5722',
  brandName: 'Your Brand',
  paymentLink: 'https://dash.chimoney.io/pay?issueID=your_unique_issue_id'
});

// To open the payment modal
paymentWidget.open();

// To close the payment modal
paymentWidget.close();


### For Vanilla JavaScript
For simple HTML/JavaScript applications, include the script and initialize the widget:
```html
<script src="https://cdn.jsdelivr.net/gh/Chimoney/payment-widget@main/dist/chimoney-payment-widget.umd.js"></script>
<script>
  document.addEventListener('DOMContentLoaded', function() {
    const paymentWidget = new PaymentWidget({
      brandColor: '#FF5722',
      brandName: 'Your Brand',
      paymentLink: 'https://dash.chimoney.io/pay?issueID=your_unique_issue_id'
    });

    // Open the widget on button click
    document.getElementById('payButton').addEventListener('click', function() {
      paymentWidget.open();
    });
  });
</script>

Configuration Options

Configure your widget by passing options during initialization. Here are the configurable options:

  • brandColor: String, sets the primary color of the widget to match your brand. (optional)
  • brandName: String, displays your brand name on the widget. (optional)
  • paymentLink: String, the unique URL to your Chimoney payment page.
  • onPaymentSuccess - Function, The callback after payment is completed. (optional)
  • onWidgetClosed - Function, The callback when modal is closed. (optional)

Customization

Customize the look and feel of the widget to match your website or app:

const paymentWidget = new PaymentWidget({
  brandColor: '#4CAF50', // Green
  brandName: 'GreenTech',
  paymentLink: 'https://dash.chimoney.io/pay?issueID=your_custom_issue_id',
});

More Examples

Integration in React

import React, { useEffect } from 'react';
import PaymentWidget from 'chimoney-payment-widget';

const PaymentButton = () => {
  useEffect(() => {
    const paymentWidget = new PaymentWidget({
      brandColor: '#673AB7',
      brandName: 'My App',
      paymentLink: 'https://your.payment.url',
    });

    document.getElementById('paymentButton').onclick = function() {
      paymentWidget.open();
    };
  }, []);

  return <button id="paymentButton">Pay with Chimoney</button>;
};

export default PaymentButton;

Integration in Vue.js

<template>
  <button @click="openPayment">Pay with Chimoney</button>
</template>

<script>
import PaymentWidget from 'chimoney-payment-widget';

export default {
  methods: {
    openPayment() {
      const paymentWidget = new PaymentWidget({
        brandColor: '#3F51B5',
        brandName: 'VueApp',
        paymentLink: 'https://your.payment.url'
      });

      paymentWidget.open();
    }
  }
}
</script>

What's included?

Tools / stack

All tools are defined as dev-dependencies!

Contributing and development

We provide an extensive contribution guideline and a code of conduct to help you in making your contribution a success!

Security

Please read our security policy to get to know which versions are covered.

License

MIT, see license file