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

react-liqpay

v1.3.0

Published

React component for LiqPay payment system

Downloads

24

Readme

react-liqpay

React component for LiqPay payment system

NPM JavaScript Style Guide

Install

yarn add react-liqpay

or

npm install --save react-liqpay

Usage

import React, { Component } from "react";

import { LiqPayPay, LiqPaySubscribe } from "react-liqpay";

class Example extends Component {
  const payInfo = {
    amount: 999,
    currency: 'USD',
    title: 'PAY'
  }

  const ButtonComponent = () => (
    <button style={{
      backgroundColor: '#337ab7',
      color: '#fff',
      borderColor: '#2e6da4',
      border: '1px solid transparent',
      borderRadius: '4px',
      padding: '6px 12px',
      cursor: 'pointer'
    }}>
      {`${payInfo.title} ${payInfo.amount} ${payInfo.currency}`}
    </button>
  )

  render() {
    return (
      <div style={{ display: "flex" }}>
        <LiqPayPay
          publicKey={process.env.REACT_APP_PUBLIC_KEY}
          privateKey={process.env.REACT_APP_PRIVATE_KEY}
          amount="3"
          description="Payment for product"
          currency="UAH"
          orderId={Math.floor(1 + Math.random() * 900000000)}
          result_url="http://domain.com/user/account"
          server_url="http://server.domain.com/liqpay"
          product_description="Online courses"
          style={{ margin: "8px" }}
          disabled={true}
        />
        <LiqPaySubscribe
          publicKey={process.env.REACT_APP_PUBLIC_KEY}
          privateKey={process.env.REACT_APP_PRIVATE_KEY}
          amount="3"
          subscribePeriodicity="month"
          description="Payment for subscription"
          currency="USD"
          orderId={Math.floor(1 + Math.random() * 900000000)}
          result_url="http://domain.com/user/account"
          server_url="http://server.domain.com/liqpay"
          product_description="Online courses"
          style={{ margin: "8px" }}
          disabled={false}
        />
        <LiqPayPay
          publicKey={process.env.REACT_APP_PUBLIC_KEY}
          privateKey={process.env.REACT_APP_PRIVATE_KEY}
          description="Payment for product"
          orderId={Math.floor(1 + Math.random() * 900000000)}
          result_url="http://domain.com/user/account"
          server_url="http://server.domain.com/liqpay"
          product_description="Online courses"
          style={{ margin: "8px" }}
          extra={[<ButtonComponent key="1" />]}
        />
      </div>
    );
  }
}

buttons example

common props

  • publicKey - String Public key - the store identifier. You can get the key in the store settings
  • privateKey- String Private key of the created company (not available to anyone except your developer)
  • amount - String Payment amount. For example: 5, 7.34
  • description - String Payment description. (default "test")
  • currency - String Payment currency. Possible values: USD, EUR, RUB, UAH, BYN, KZT. Additional currencies can be added by company's request.
  • orderId - String Unique purchase ID in your shop. Maximum length is 255 symbols.
  • result_url - String URL of your shop where the buyer would be redirected after completion of the purchase. Maximum length 510 symbols.
  • server_url - String URL API in your store for notifications of payment status change (server->server). Maximum length is 510 symbols. Learn more
  • style - Object Styles for component, like 'margin'
  • disabled - Boolean Props for disabling component. (default "false")
  • extra - Object Extra component for rendering as main component (default "null")

LiqPayPay props

  • title - String Text showing as main text inside button. (default "Payment")

LiqPaySubscribe props

  • title - String Text showing as main text inside button. (default "Subscribe")

  • subscribePeriodicity - String Period of payments.

    Possible values: month - once in a month, year - once in a year (default "month")

CHANGELOG

  • v1.0.0
    • initial commit
    • functional buttons with two payment actions:
      • 'pay'
      • 'subscribe'
    • example
  • v1.1.0
    • example to readme
    • component picture
    • additional props in component - can pass 'style', 'result_url', 'server_url', 'product_description' etc...
    • change base64 function - support cyrillic characters
    • costume title for button
  • v1.2.0
    • packages upgrade
  • v1.2.1
    • typos correction
  • v1.3.0
    • custom component - you can pass your own component as 'extra' props
    • refactoring
    • fixing PropTypes
    • 'disabled' props for components buttons
    • props descriptions
    • update component picture
    • updated example

License

MIT © alexneo2003