JSPM

react-payhere-button

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q27520F
  • License MIT

PayHere button component for react

Package Exports

  • react-payhere-button

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-payhere-button) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-payhere-button

PayHere button component for react

NPM JavaScript Style Guide

Install

npm install --save react-payhere-button

Usage

import React, { Component } from 'react'

import { PayHereButton } from 'react-payhere-button'

class Example extends Component {
  render() {
    const onSucess = (orderId: number) => console.log('onSuccess', orderId);
    const onDismissed = () => console.log('onDismissed');
    const onError = (error: Object) => console.log('onError', error);

    return <PayHereButton
      sandbox={true}
      merchant_id={'1214560'}
      onCompleted={onSucess}
      onDismissed={onDismissed}
      onError={onError}
      order_id={'ItemNo12345'}
      items={'Door bell wireles'}
      amount={100}
      currency={'LKR'}
      first_name={'Prahveen'}
      last_name={'Thiruchelvam'}
      email={'prahveent@gmail.com'}
      phone={'0771234567'}
      address={'No.1, Galle Road'}
      city={'Colombo'}
      country={'Sri Lanka'}
      options={{
        delivery_address: 'No. 123, Galle road, Colombo 03',
        delivery_city: 'Kollupitiya',
        delivery_country: 'Sri Lanka',
        custom_1: '',
        custom_2: '',
        return_url: 'http://sample.com/return',
        cancel_url: 'http://sample.com/cancel',
        notify_url: 'http://sample.com/notify',
      }}
    />
  }
}

License

MIT © Prahveen Thiruchelvam (prahveent@gmail.com))