0.0.2-beta.4 • Published 1 year ago
@livechat/text-payments v0.0.2-beta.4
Text Payments
Text Payments goal is to be a collection of tools, with which you can easily integrate payment flows for Text, and Text-related products (subscriptions, apps, in-app purchases). The package is currently in the prototype stage, so please be mindful of that.
Usage
Installation
NPM
npm install @livechat/text-paymentsor to get the tarball:
npm pack @livechat/text-paymentsCC Form usage
init(config)
Use the init method to create and embed form in a host element. Init takes a single argument, config object with properties:
token(required) - Auth bearer token, required for Billing API callsproduct(required) - one of the supported products (currently:'livechat' | 'alphabot')rootId- id of the host element (default:'root')env- set this to'test' | 'labs'for API labs envonSuccess(data: eventParams)- callback invoked when CC is saved successfullyonError(data: eventParams)- callback invoked when error occurs during CC saveonCancel()- callback invoked whenCancelbutton is clickedcustomStyles- Emotion-compatible object, applied on the root div container; target.cc-form-containerclass to access the direct form wrapper styles
Example usage in index.html, UMD:
<div id="embed-root">
<script src="/package/dist/text-payments.umd.cjs"></script>
<script defer>
TextPayments.init({
token: <auth_token>,
product: <'livechat' | 'alphabot'>,
rootId: 'embed-root',
env: 'labs'
})
</script>0.0.2-beta.4
1 year ago
0.0.2-beta.3
1 year ago
0.0.2-beta.2
1 year ago
0.0.2-beta.1
1 year ago
0.0.2-beta.0
1 year ago
0.0.2-alpha.4
1 year ago
0.0.2-alpha.3
2 years ago
0.0.2-alpha.2
2 years ago
0.0.2-alpha.1
2 years ago
0.0.2-alpha.0
2 years ago