0.1.6 • Published 10 months ago

@xsolla/payouts-sdk v0.1.6

Weekly downloads
-
License
-
Repository
gitlab
Last release
10 months ago

Mass payouts widget sdk

Getting started

Your node version should be >= 16

npm install
cp ./ci/.env.example ./.env
npm run start

Install and use

If you use npm

npm i @xsolla/payouts-sdk
import { Widget } from "@xsolla/payouts-sdk";

const options = {
    token: /<your token>/,
    lang: /<your locale>/,
    theme: /<your theme>/,
    size: /<your size>/,
    sandbox: boolean
}

const widget = new Widget(options);
widget.show(/<tag id>/);

If you use script

<script>
    const options = {
        token: /<your token>/,
        lang: /<your locale>/,
        theme: /<your theme>/,
        size: /<your size>/,
        sandbox: boolean
    }
    const id = /<tag id>/
    const s = document.createElement('script');
    s.type = "text/javascript";
    s.async = true;
    s.src = "santorelli.min.js";
    s.addEventListener('load', function () {
        const widget = new XPayoutsWidget.Widget(options);
        widget.show(id);
    }, false);
    const head = document.getElementsByTagName('head')[0];
    head.appendChild(s);
</script>
...
<body>
...
<div id="/<tag id>/"></div>
...
</body>

Types

type Options = {
    token: string;
    lang?: 'ru' | 'en'; //default 'en'
    theme?: 'black' | 'white'; //default 'black'
    size?: 'auto' | 'fixed'; //default 'fix'
    sandbox?: boolean; //default 'false'
}

Event listeners

widget.addEventListener(event: EventType, callback: (data: DataType) => void);
EventTypeDataType
'load'empty
'abort'empty
'tokenExpired'empty
'heightResize'{height: number}
'requestWithdrawal'{amount: number}
0.1.6

10 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.2

1 year ago

0.1.3

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.8

1 year ago

0.0.8-beta.0

1 year ago

0.0.7

1 year ago