0.2.2 • Published 2 years ago

react-native-onepay v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-onepay

Hash secure key and generate pay url for onepay

Installation

npm install react-native-onepay

or

yarn add react-native-onepay

Usage

import OnepayHash from 'react-native-onepay-hash';

const [result, setResult] = useState<string>();

useEffect(() => {
  OnepayHash.generateURL({
    version: '2',
    command: 'pay',
    accessCode: '6BEB2546',
    merchant: 'TESTONEPAY',
    locale: 'en',
    returnUrl: 'https://localhost/returnurl',
    orderInfo: '123214125125',
    amount: '1000000',
    title: 'Test Payment',
    currency: 'VND',
    secretKey: '6D0870CDE5F24F34F3915FB0045120DB',
    baseUrl: 'https://mtf.onepay.vn/',
    merchTxnRef: new Date().getTime().toString(),
    againLink: 'https://scanme.eastplayers.io/cancel-payment',
    cardList: 'INTERNATIONAL',
  }).then((res) => setResult(res));
}, []);

 // ...

Props

PropTypeDefaultNote
versionString2Version module of payment gateway
commandStringpayPayment Function, value is “pay”
accessCodeStringUnique value for each merchant provided by OnePAY
merchantStringUnique value for each merchant provided by OnePAY
localeStringLanguage is used on the payment site Vietnamese: vn, English: en
returnUrlStringMerchant’s URL Website for redirectresponse
orderInfoStringOrder infomation, it could be an order number or brief description of order
amountStringThe amount of the transaction, this value does not have decimal comma. Add “00” before redirect to payment gateway. If transaction amount is VND 25,000 then the amount is 2500000 (Add "00" will be handled by the package)
titleStringTitle of payment gateway is shown on the cardholder’s browser
currencyStringPayment Currency
secretKeyString
baseUrlString
merchTxnRefStringA unique value is created by merchant then send to OnePAY
againLinkStringThe link of website before redirecting to OnePAY
cardListINTERNATIONAL, DOMESTIC
customerId?StringCustomer's id. This one will be used to save customer's card on OnePAY
customerEmail?StringCustomer's email
customerPhone?StringCustomer's phone

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.1.10

2 years ago

0.1.11

2 years ago

0.1.12

2 years ago

0.1.13

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.8

2 years ago

0.1.9

2 years ago

0.2.2

2 years ago

0.1.6

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.5

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago