Skip to content

Commit 50a14e7

Browse files
author
Gypsophila
committedApr 24, 2022
docs: 文档调整
1 parent a2ae547 commit 50a14e7

File tree

2 files changed

+32
-82
lines changed

2 files changed

+32
-82
lines changed
 

‎README.md

+31-81
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ new MixPay(element, options);
4343
#### Example
4444

4545
```html
46-
<div id="wrapper"></div>
46+
<div id="app"></div>
4747
```
4848

4949
```js
@@ -52,19 +52,18 @@ import MixPay from 'mixpayjs;
5252
const element = document.getElementById('app');
5353
5454
const mixpay = new MixPay(element, {
55-
width: '',
56-
height: '',
57-
isModal: false,
58-
withMask: false,
55+
isModal: true,
56+
hasMask: true,
5957
payeeId: '',
6058
settlementAssetId: '',
6159
settlementMemo: '',
62-
settlementMethod: 'mixin',
60+
settlementMethod: '',
6361
clientId: '',
6462
expireSeconds: '',
6563
remark: '',
6664
6765
onReady() {},
66+
onClose() {},
6867
onPaymentCreate() {},
6968
onPaymentSuccess() {},
7069
onPaymentFail() {},
@@ -81,75 +80,22 @@ mixpay.pay({
8180
8281
## Options
8382
84-
### isModal
85-
86-
- Type: `Boolean`
87-
- Default: `false`
88-
89-
### withMask
90-
91-
- Type: `Boolean`
92-
- Default: `false`
93-
94-
### payeeId
95-
96-
- Type: `String`
97-
98-
### settlementAssetId
99-
100-
- Type: `String`
101-
102-
### settlementMemo
103-
104-
- Type: `String`
105-
106-
### settlementMethod
107-
108-
- Type: `String`
109-
- Default: `'mixin'`
110-
- Options:
111-
- `'mixin'`
112-
- `'mixpay'`
113-
114-
### clientId
115-
116-
- Type: `String`
117-
- Default: `''`
118-
119-
### expireSeconds
120-
121-
- Type: `Number`,
122-
- Default: `60`
123-
124-
### remark
125-
126-
- Type: `String`,
127-
- Default: `''`
128-
129-
### onReady
130-
131-
- Type: `Function`,
132-
- Default: `null`
133-
134-
### onClose
135-
136-
- Type: `Function`,
137-
- Default: `null`
138-
139-
### onPaymentCreate
140-
141-
- Type: `Function`,
142-
- Default: `null`
143-
144-
### onPaymentSuccess
145-
146-
- Type: `Function`,
147-
- Default: `null`
148-
149-
### onPaymentFail
150-
151-
- Type: `Function`,
152-
- Default: `null`
83+
| params | type | default | description |
84+
| ------ | ------- | -------- | ----------- |
85+
| isModal| boolean| false | Render as a modal |
86+
| hasMask | boolean| false | Has mask or not |
87+
| payeeId | string | '' | The Mixin UUID of the payee |
88+
| settlementAssetId | string | '' | AssetId of settlement cryptocurrency |
89+
| settlementMemo | string | '' | memo |
90+
| settlementMethod | string | mixin | 'mixin' or 'mixpay', settle to your Mixin Wallet or MixPay Account |
91+
| clientId | string | MixPay.newUUID() | UUID of client of the payment |
92+
| expireSeconds | number | 60 | 60-172800, expiration date of the payment |
93+
| remark | string | '' | Payees leave a message to payers |
94+
| onReady | function | null | This event fires when quote assets and payment assets are loaded |
95+
| onClose | function | null | This event fires when the modal is closed |
96+
| onPaymentCreate | function | null | This event fires when a payment is created |
97+
| onPaymentSuccess | function | null | This event fires when a payment is successful |
98+
| onPaymentFail | function | null | This event fires when a payment is failed |
15399
154100
## Instance Methods
155101
@@ -176,24 +122,28 @@ create a random UUID for `clientId` and `traceId`
176122
177123
### getQuoteAssets()
178124
179-
Get quote assets support cryptocurrency and fiat currency.
125+
Get quote assets support cryptocurrency and fiat currency. See the [Quote Assets](https://developers.mixpay.me/docs/api/assets/quote-assets) section in guide.
180126
181127
### getPaymentAssets()
182128
183-
Get payment assets only support cryptocurrency.
129+
Get payment assets only support cryptocurrency. See the [Payment Assets](https://developers.mixpay.me/docs/api/assets/payment-assets) section in guide.
184130
185131
### getSettlementAssets()
186132
187-
Get settlement assets support cryptocurrency and fiat currency.
133+
Get settlement assets support cryptocurrency and fiat currency. See the [Settlement Assets](https://developers.mixpay.me/docs/api/assets/settlement-assets) section in guide.
188134
189135
### createPayment(options)
190136
191-
Create a payment
137+
Create a payment. See the [Accepting Payments](https://developers.mixpay.me/docs/api/payments/accepting-payments) section and the [On-chain Payments](https://developers.mixpay.me/docs/api/payments/onchain-payments) section in guide.
192138
193139
### getPaymentDetail(traceId)
194140
195-
The details of the payment
141+
The details of the payment. See the [Payments Results](https://developers.mixpay.me/docs/api/payments/payments-results) section in guide.
196142
197143
### getEstPaymentAmount(options)
198144
199-
Get the estimated price and the estimated amount of the transaction.
145+
Get the estimated price and the estimated amount of the transaction. See the [Payments Estimated](https://developers.mixpay.me/docs/api/payments/payments-estimated) section in guide.
146+
147+
## Resources
148+
149+
* [Documentation API](https://developers.mixpay.me/docs/api-overview)

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mixpayjs",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "",
55
"main": "dist/mixpay.common.js",
66
"module": "dist/mixpay.esm.js",

0 commit comments

Comments
 (0)
Please sign in to comment.