react-orel-card-ipg
v1.0.1
Published
OrelPay ipg module for React
Downloads
9
Readme
react-orel-card-ipg
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