1.3.4 • Published 5 years ago
mt_ecommerce v1.3.4
Money Transfer: Ecommerce Library
Integrate your website with money transfer API
Install
npm i mt_ecommerce
Usage
Using npm
// React
// Function Component
import React from 'react'
import { moneyTransfer } from 'mt_ecommerce'
const CheckoutCart = ({total, items}) => {
React.useEffect(() => {
moneyTransfer.init('ID_CONTAINER_ELEMENT', total, userCellphone, ownerCellphone)
}, [])
return (
<>
{items.map(item => (
<DetailItem item={item}/>
))}
// This is where the money transfer button will render
<div id="ID_CONTAINER_ELEMENT"></div>
</>
)
}
// Class Component
import React from 'react'
import { moneyTransfer } from 'mt_ecommerce'
class Checkout extends React.Component {
componentDidMount() {
moneyTransfer.init('ID_CONTAINER_ELEMENT', this.props.total, this.props.userCellphone, this.props.ownerCellphone)
}
render() {
return (
<>
{this.props.items.map(item => (
<DetailItem item={item}/>
))}
// This is where the money transfer button will render
<div id="ID_CONTAINER_ELEMENT"></div>
</>
)
}
}
Using CDN
Insert this in your index.html
<script src="https://unpkg.com/mt_ecommerce@1.0.0/index.min.js"></script>
Then in your javascript file you will have to create an instance using MoneyTransfer
const mt = new MoneyTransfer()
mt.init('ID_CONTAINER_ELEMENT', total, userCellphone, ownerCellphone)
1.3.4
5 years ago
1.3.3
5 years ago
1.3.2
5 years ago
1.3.1
5 years ago
1.3.0
5 years ago
1.2.8
5 years ago
1.2.7
5 years ago
1.2.6
5 years ago
1.2.5
5 years ago
1.2.4
5 years ago
1.2.3
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago