This repository has been archived by the owner on Dec 8, 2020. It is now read-only.
forked from hakobera/Simple-WebSocket-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathayyo-requests.js
89 lines (84 loc) · 1.61 KB
/
ayyo-requests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
var params = {
login_phone_start:
{
"phone": "+79151214674"
},
login_phone_send:
{
"action_id": 21
},
login_phone_sms_code_check:
{
"phone": "+79151214674",
"sms_code": "000"
},
login_access_token:
{
"access_token": "tokeeen"
},
payment_phone_start:
{
"phone": "+79151214674",
"amount": 200
},
payment_phone_send:
{
"action_id": 1333
},
payment_card_start:
{
"amount": 500,
"link_card": false,
"fail_url": "http://ayyo.ru/card_fail.html",
"success_url": "http://ayyo.ru/card_success.html"
},
payment_card_send:
{
"action_id": 1333
},
payment_linked_card_start:
{
"card_id": 1,
"amount": 200
},
payment_linked_card_send:
{
"action_id": 000
},
card_link_start:
{
"order_id": 000
},
card_link_send:
{
"action_id": 000
},
card_unlink_start:
{
"card_id": 1
},
card_unlink_send:
{
"action_id": 000
},
}
var names = new Array();
for (var key in params) {
if (params.hasOwnProperty(key)) {
names.push(key);
}
}
for (var i = 0; i < names.length; i++) {
$('#customRequests').append('<option value="' + names[i] + '">' + names[i] + '</option>');
}
id = 0;
$('#customRequests').change(function () {
var param = params[$(this).val()];
var request = {
id: (++id).toString(),
method: $(this).val(),
params: param
};
var json = JSON.stringify(request, null, 4);
$('#sendMessage').val(json);
});