EPIK
E-Payment Integration Kit.
It's a JS-library that allows you to integrate Raisenow's E-payment functionalities into your website.
Commands
build
Buld the bundle into dist folder.
npm run build
build:watch
Watch file changes and rebuild automatically.
npm run build:watch
Sample widget implementation flow
<script src="dist/epik.browser.min.js"></script>
<script>
epik = rnw.epik.createEpik({
language: 'en',
eppApiKey: 'sal-rmz8x0',
eppMerchantId: 'sal-qfb3eu',
requireSwissQrBillReferenceNumber: true,
autoFetchReferenceNumber: true,
debug: true,
})
epik.events.fetchPaymentDataEnd.subscribe(function (event) {
var transactionInfo = event.data.transactionInfo
console.log('--> payment', {
status: transactionInfo && transactionInfo.epayment_status,
transactionInfo: transactionInfo,
})
})
epik.init()
payment = epik.createPayment({
flow: 'epp',
payment_method: 'chqr',
currency: 'chf',
amount: 100,
stored_customer_firstname: 'John',
stored_customer_lastname: 'Snow',
stored_customer_street: 'Hardturmstrasse',
stored_customer_street_number: '101',
stored_customer_zip_code: '8005',
stored_customer_city: 'Zurich',
stored_customer_country: 'CH',
stored_chqr_ordered: false,
})
setLanguage = function (lng) {
payment.creditCardIframe.messenger.emit(
rnw.epik.CreditCardIframeMessageType.SET_LANGUAGE,
lng,
)
}
updatePayment = function () {
epik.fetchReferenceNumber().then(function (refno) {
payment.update({
refno: refno,
})
})
}
sendPayment = function () {
if (payment.creditCardIframe) {
payment.markAllFieldsAsTouched()
}
payment.validate().then(function (errors) {
if (errors) {
console.log('validation errors:', errors)
} else {
payment.send()
}
})
}
</script>