You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/default/store/web-supervisor.md
+65-5Lines changed: 65 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,17 @@ title: Web supervisor
4
4
description: How to setup PixelBuy web supervisors.
5
5
---
6
6
7
+
```mdx-code-block
8
+
import DocCard from '@theme/DocCard';
9
+
```
10
+
7
11
The web supervisor interface is a type of system that retrieves data from a web store to apply any necessary delivery inside Minecraft server.
8
12
9
13
## Types
10
14
11
15
PixelBuy currently aims to support some delivery concepts:
12
16
17
+
*`PIXELBUY` - Website compatible with PixelBuy web API format.
13
18
*`WOOMINECRAFT` - Self-hosted WordPress using **WooMinecraft** plugin.
14
19
*`TEBEX` - BuyCraft-like delivery from **Tebex** store.
15
20
@@ -18,10 +23,60 @@ PixelBuy currently aims to support some delivery concepts:
18
23
Any web supervisor has common configuration paths.
19
24
20
25
```yaml
26
+
Type: PIXELBUY
21
27
Group: 'servername'
28
+
URL: 'https://shop.mysite.com'
22
29
```
23
30
31
+
* `type` - The type of web supervisor.
24
32
* `group` - Is the server associated with the name that the supervisor is looking for orders.
33
+
* `url` - Is the store url.
34
+
35
+
## PixelBuy
36
+
37
+
The PixelBuy web supervisor retrieves information from a site compatible with PixelBuy web API schema:
38
+
39
+
```mdx-code-block
40
+
<DocCard item={{
41
+
type: "link",
42
+
href: "/pixelbuy/developers/schema/",
43
+
label: "Schema",
44
+
description: "PixelBuy web API schema"
45
+
}}
46
+
/>
47
+
```
48
+
49
+
This supervisor also came with its own configuration.
50
+
51
+
```yaml
52
+
Version: 1
53
+
Format:
54
+
Server: '{url}/api/server/{key}'
55
+
Order: '{url}/api/order/{key}'
56
+
Rest:
57
+
Check-Interval: 30
58
+
Auth: PARAMS
59
+
Property: 'secret'
60
+
Secret: ''
61
+
```
62
+
63
+
* `version` - The version of PixelBuy schema.
64
+
* `format.server` - The URL format to get server information (`{key}` will be replaced with server group).
65
+
* `format.order` - The URL format to get order information (`{key}` will be replaced with order ID).
66
+
* `rest.check-interval` - The interval in seconds to check new orders, set to `DETECT` to use a provided one by REST API.
67
+
* `rest.auth` - The authentication type to connect with REST API.
68
+
* `rest.property` - The property name, this both apply to `PARAMS` and `HEADER` authentication.
69
+
* `rest.secret` - The secret key that is used to get information.
70
+
71
+
### Format version
72
+
73
+
* **Version 1:** Initial PixelBuy web API version, no changes.
74
+
75
+
### Auth types
76
+
77
+
* `PARAMS` - Use query parameters to provide the secret.
78
+
* `HEADER` - Use header property to provide the secret.
79
+
* `BASIC` - Use HTTP Basic authorization.
25
80
26
81
## WooMinecraft
27
82
@@ -30,14 +85,12 @@ The WooMinecraft supervisor type makes delayed checks to get what order commands
30
85
The store plugin setup is the same as [WooMinecraft wiki](https://github.com/WooMinecraft/WooMinecraft/wiki/Step-2:-Setting-up-the-wordpress-side) and also [the commands](https://github.com/WooMinecraft/WooMinecraft/wiki/Step-3:-Creating-A-Package).
31
86
32
87
```yaml
33
-
Check-Interval: 7
34
-
URL: 'http://shop.mysite.com'
88
+
Check-Interval: 600
35
89
Key: 'asdUniqueKeyForServer'
36
90
```
37
91
38
-
* `Check-Interval` - Is the interval in seconds to check WooMinecraft rest api from store url.
39
-
* `URL` - Is the store url.
40
-
* `Key` - Is the server key from [WooMinecraft configuration](https://github.com/WooMinecraft/WooMinecraft/wiki/Step-2:-Setting-up-the-wordpress-side).
92
+
* `check-interval` - Is the interval in seconds to check WooMinecraft rest api from store url.
93
+
* `key` - Is the server key from [WooMinecraft configuration](https://github.com/WooMinecraft/WooMinecraft/wiki/Step-2:-Setting-up-the-wordpress-side).
41
94
42
95
### WooCommerce integration
43
96
@@ -62,8 +115,15 @@ Next you only need to set the generated key and secret into web supervisor confi
62
115
63
116
```yaml
64
117
WooCommerce:
118
+
Version: 3
119
+
Auth: PARAMS
65
120
ConsumerKey: 'ck_theGeneratedConsumerKey'
66
121
ConsumerSecret: 'cs_theGeneratedConsumerSecret'
67
122
```
68
123
124
+
* `version` - WooCommerce API version, currently only version 3 is supported.
125
+
* `auth` - The [authentication type](https://woocommerce.github.io/woocommerce-rest-api-docs/#authentication-over-https) to connect with WooCommerce API (`PARAMS` or `BASIC`).
126
+
* `consumerkey` - The generated key.
127
+
* `consumersecret` - The generated secret.
128
+
69
129
Take in count that every consumer key starts with `ck_` and every consumer secret starts with `cs_`.
description: Esquema de datos para hacer un sitio web compatible con PixelBuy.
5
+
---
6
+
7
+
Para permitir que la gente haga su propio sitio web conectado con PixelBuy, se ha creado un formato en común.
8
+
9
+
## REST API
10
+
11
+
Hacer que tu sitio web transfiera datos con el proceso tipico de `GET` y `POST`.
12
+
13
+
Se usará contenido en Json para explicar el formato.
14
+
15
+
### Autenticación
16
+
17
+
Todos los sitios web compatibles con PixelBuy deben proveer una "clave secreta", la cual será usada por el usuario para obtener información de la API del sitio web.
18
+
19
+
PixelBuy es compatible con multiples formatos de autenticación:
20
+
21
+
* Query parameters, al proveer la clave secrete como un query parameter en el mismo URL.
22
+
* Header property, al proveer la clave secrete como un header de http en cada conexión.
23
+
* Basic authentication, al pasar la clave secreta en un header de Basic authentication header en cada conexión.
24
+
25
+
### Versión 1
26
+
27
+
**error:** Es la respuesta para comunicar un error.
28
+
29
+
```json5
30
+
{
31
+
"error":"error_message_code",
32
+
"message":"An error has occur",
33
+
"status":404,
34
+
}
35
+
```
36
+
37
+
**(GET) order:** Una orden de compra, el jugador puede ser solo un nombre si no quieres dar el UUID.
38
+
39
+
```json5
40
+
{
41
+
"id":1234, // ID numérico de la orden / número de transacción
"execution":"BUY", // Opcional, el valor debe ser BUY, RECOVER o REFUND
45
+
// Puede no haber items si el valor de la ejecución es RECOVER o REFUND
46
+
"items": [
47
+
{
48
+
"product":55, // Opcional, es el identificador del producto, puede ser cualquier tipo de objeto
49
+
"id":"super-pickaxe", // El identificador del item que fue configurado en PixelBuy
50
+
"amount":1, // La cantidad de items de este tipo, debe ser un número entero
51
+
"price":2.49, // La cantidad real de dinero gastado en este items (considera la cantidad de items)
52
+
},
53
+
{
54
+
"product":94,
55
+
"id":"eco-bundle",
56
+
"amount":6,
57
+
"price":5.04,
58
+
}
59
+
]
60
+
}
61
+
```
62
+
63
+
**(GET) server:** Información sobre el servidor.
64
+
65
+
```json5
66
+
{
67
+
// Ordenes de compra que deberían ser procesadas por PixelBuy
68
+
"pending_orders": [
69
+
{
70
+
// Objeto de una orden (arriba está especificado su formato)...
71
+
},
72
+
{
73
+
// Otro objeto de una orden (arriba está especificado su formato)...
74
+
}
75
+
],
76
+
"next_check":60, // Opcional, the amount of seconds to wait until make the next check
77
+
}
78
+
```
79
+
80
+
**(POST) update:** Le dice a la tienda que debe ejecutarse una actualización.
81
+
82
+
```json5
83
+
{
84
+
"processed_orders": [ 1234, 6727, 1897 ], // Los IDs de las ordenes que compra que ya fueron procesadas (y por lo tanto ya no deberían aparecer en la información del servidor)
0 commit comments