hexopay-cashier
v1.0.4
Published
JavaScript package for Cashier (Hexopay Ltd.)
Downloads
109
Readme
hexopay-cashier
NPM package for easy integration to Hexopay Cashier
Usage:
npm install hexopay-cashier
import { HexopayCashier } from 'hexopay-cashier'
const hexopayCashier = new HexopayCashier('<Hexopay Cashier host>')
const transactionDataHash = { transactionDataToken: '<token from /checkout response>' }
const hexopayCashierElement = document.getElementById('<parent element for hosted card fields>')
hexopayCashier.initialize(hexopayCashierElement, transactionDataHash)
const transactionDataToken = transactionDataHash['transactionDataToken']
Development
Setup:
npm install
Test:
npm test
E2E Tests:
E2E tests are run against staging. Sometimes they might fail cause staging is slow to response.
Please treat them as a way to check your new implementation or bug fix. I do suggest to run playwright with --ui flag to see what has failed. (Mostly it fails waiting for a validation error to appear and it does not due to slow response).
Setting up the tests
npx playwright install
Running the tests
npx playwright test
You can specify specific flags while running playwright:
- project flag let's you specify which browser to use
--project=chromium
- ui flag runs the tests with ui interface, so you can see each line executed and state of the app
--ui
- debug flag runs the tests in debug mode
--debug
Publish:
Currently it's published manually from local repo
To do:
Add automated publish job for github repo