node-red-contrib-alice 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nodes/alice-device.js +0 -1
- package/nodes/alice-range.js +0 -1
- package/nodes/alice.html +15 -3
- package/package.json +1 -1
package/nodes/alice-device.js
CHANGED
package/nodes/alice-range.js
CHANGED
package/nodes/alice.html
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
return this.name || "Alice-Credentials";
|
|
17
17
|
},
|
|
18
18
|
oneditprepare:function(){
|
|
19
|
+
$('#dev-on-gate').text("checking ...");
|
|
20
|
+
$('#subscribe-status').text("checking ...");
|
|
19
21
|
let em = $('#node-config-input-email').val();
|
|
20
22
|
let idt = $('#node-config-input-id').val();
|
|
21
23
|
getDeviceCount(idt,em,"dev-on-gate");
|
|
@@ -43,7 +45,7 @@
|
|
|
43
45
|
format:"json"
|
|
44
46
|
})
|
|
45
47
|
.done(result=>{
|
|
46
|
-
$('#'+contId).text(result.text);
|
|
48
|
+
$('#'+contId).text(result.data.text);
|
|
47
49
|
})
|
|
48
50
|
.fail(error=>{
|
|
49
51
|
console.log(error)
|
|
@@ -69,7 +71,7 @@
|
|
|
69
71
|
})
|
|
70
72
|
.done(result=>{
|
|
71
73
|
// console.log(result);
|
|
72
|
-
$('#'+contId).text(result.text);
|
|
74
|
+
$('#'+contId).text(result.data.text);
|
|
73
75
|
})
|
|
74
76
|
.fail(error=>{
|
|
75
77
|
console.log(error)
|
|
@@ -110,6 +112,7 @@
|
|
|
110
112
|
|
|
111
113
|
};
|
|
112
114
|
function pay(id, email) {
|
|
115
|
+
console.log("Start pay");
|
|
113
116
|
if (!id || !email){
|
|
114
117
|
RED.notify("Please authorize before purchasing a subscription", {type:"error"});
|
|
115
118
|
return;
|
|
@@ -117,6 +120,7 @@
|
|
|
117
120
|
$('#subscribe-button').prop('disabled', true);
|
|
118
121
|
RED.notify("Request has been sent. Please, wait",{type:"compact"});
|
|
119
122
|
let paymentWidget = new cp.CloudPayments();
|
|
123
|
+
console.log("Start get pay confi");
|
|
120
124
|
$.ajax({
|
|
121
125
|
url: "https://nodered-home.ru/payment/create",
|
|
122
126
|
type:"POST",
|
|
@@ -133,12 +137,20 @@
|
|
|
133
137
|
format:"json"
|
|
134
138
|
})
|
|
135
139
|
.done(paydata=>{
|
|
136
|
-
console.log(
|
|
140
|
+
console.log("pay config done");
|
|
141
|
+
console.log("Start widget");
|
|
137
142
|
paymentWidget.pay('auth', // или 'charge'
|
|
138
143
|
paydata,
|
|
139
144
|
{
|
|
140
145
|
onSuccess: function (result) { // success
|
|
141
146
|
//действие при успешной оплате
|
|
147
|
+
let em = $('#node-config-input-email').val();
|
|
148
|
+
let idt = $('#node-config-input-id').val();
|
|
149
|
+
$('#subscribe-status').text("checking ...");
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
getSubscribeStatus(idt,em,"subscribe-status");
|
|
152
|
+
}, 2000);
|
|
153
|
+
|
|
142
154
|
},
|
|
143
155
|
onFail: function (reason, options) { // fail
|
|
144
156
|
//действие при неуспешной оплате
|