react-orel-card-ipg

1.0.1 • Public • Published

react-orel-card-ipg

NPM JavaScript Style Guide

Install

npm install --save react-orel-card-ipg

Usage

import React, {Component} from 'react'

//import IPG
import OrelCardIpg from 'react-orel-card-ipg'
import 'react-orel-card-ipg/dist/index.css'

class Example extends Component {

  token = 'xxxx';
  reference = 'order001'
  stage = 'dev'

  //Open Card View
  addCard = () => {
    this.refs.cardAddService.addCard(this.token, this.reference, this.stage).then((res) => {
      console.log('cardAdding-res', res);
      alert(JSON.stringify(res));
    }).catch(error => {
      console.log('cardAdding-error', error);
      alert(JSON.stringify(error));
    });
  };

  //Cancel Or Close Card View
  cancel = () => {
    this.refs.cardAddService.cancel();
  }

  render() {
    return (
      <div>
        <button onClick={this.addCard}>
          Add Card
        </button>
        <br/><br/>
        <button onClick={this.cancel}>
          Cancel
        </button>

        <OrelCardIpg ref="cardAddService"/>
      </div>
    );
  }
}

Change log

V1.0.0  - Initial release

Package Sidebar

Install

npm i react-orel-card-ipg

Weekly Downloads

3

Version

1.0.1

License

none

Unpacked Size

12.4 kB

Total Files

6

Last publish

Collaborators

  • pramitha1166
  • supunssw
  • hasithaj
  • sasindu88
  • nimeshc64