1.1.1 • Published 1 year ago

epay-payment-widget v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Epay Widget

EpayPaymentWidget

react version GitHub license npm size

React Component of Epay Payment Widget

Documentation

Official documentation is on Epay halyk. This is a wrapper component for react.

Installation

npm i epay-payment-widget

Example

import {EpayPaymentWidget} from 'epay-payment-widget';
...
const [showWidget, setShowWidget] = useState(false);
...
<EpayPaymentWidget
    visible={showWidget}
    clientId='CLIENT_ID'
    clientSecret='CLIENT_SECRET'
    // oauthData={{}}
    terminalId='TERMINAL_ID'
    amount={500}
    paymentData={data}
    invoiceId={invoiceId}
    onWidgetClose={() => {}}
    devMode />

Props

PropertyDescriptionTypeRequiredDefault
visibleOpen/close widgetbooleanyesfalse
clientIdYour client id from epaystringyes, if oauthData is not specified. No, if oauthData is specified
clientSecretYour client secret from epaystringyes, if oauthData is not specified. No, if oauthData is specified
terminalIdYour terminal id from epay, which terminal you want to usestringyes
amountamount of money, costnumberyes
invoiceIdYour invoice idstringno'' + new Date().valueOf()
onWidgetClosecallback, which calls when widget closes. Accepts as a parameter object {success: boolean}. Weather of success based on the results of payment processingfunctionnofunction ({success: boolean}) {}
devModeThere is two modes: dev and prod. If you use devMode you will work in a development environtmentbooleannofalse
paymentDataList of payment parameters from official documentationobjectno, if you specify this object it will be priority{}
oauthDataOauth object for payment processing from epayobjectyes, if clientId and clientSecret is not specified. No, if they are specified

If you need to get oauth object from backend, you can get that object from backend and pass it to the oauthData prop

paymentData

If you specify the properties of this object, it will be priority than above props

PropertyDescription (in russian)TypeRequiredDefault
invoiceIdНомер заказа, генерируется коммерсантом, должен быть уникальный для каждого нового заказа,от 6 до 15 цифр. Если ваш номер заказа содержит более 6 символов, то дополнительно уникальность должна соблюдаться по последним 6ти символамstringno
invoiceIdAltальтернативный номер заказа, генерируется коммерсантом, должен быть уникальный для каждого нового заказа,от 6 до 15 цифр.stringno
backLinkСсылка для возврата в магазин при удачном платежеstringno
failureBackLinkСсылка для возврата в магазин при не удачном платежеstringno
postLinkУведомление о платежеstringno
failurePostLinkУведомление о неудачном платеже, если не заполнено, то информация будет отправленна на адрес указанный в postLinkstringno
languageЯзык rus/kaz/engstringnorus
descriptionОписание заказа, допустимое количество символов 125 байтовstringno
accountIdНе обязательное поле для указание идентификатора клиента магазинаstringno
terminalИдентификатор магазинаstringno
amountСумма заказаnumberno
nameимя плательщика, только на латинице (не обязательно)stringno
currencyВалютаstringnoKZT
dataдополнительное поле транслируется в отчете при заполнении (необязательно)stringno

License

MIT

1.1.1

1 year ago

1.1.0

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago