Commit 09e6d89c authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Allow sites to custom the return page where the user will be driven into after payment

parent e9dacdb7
...@@ -22,13 +22,19 @@ ...@@ -22,13 +22,19 @@
return {}; return {};
}) })
.declareMethod("render", function (options) { .declareMethod("render", function (options) {
var gadget = this; var gadget = this,
return_page = options.return_page;
if (return_page === undefined) {
return_page = "slap_invoice_list";
}
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getElement(), gadget.getElement(),
gadget.getUrlFor({command: 'change', gadget.getUrlFor({command: 'change',
options: {jio_key: "/", page: "slap_invoice_list", "result": ""}}) options: {jio_key: "/", page: return_page, "result": ""}})
]); ]);
}) })
.push(function (result) { .push(function (result) {
...@@ -65,7 +71,6 @@ ...@@ -65,7 +71,6 @@
} else { } else {
throw new Error("Unknown action to take: " + options.result); throw new Error("Unknown action to take: " + options.result);
} }
console.log(options);
element.innerHTML = message_template({ element.innerHTML = message_template({
message_to_acknowledge: message, message_to_acknowledge: message,
advice: advice, advice: advice,
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Gadget SlapOS Site invoice State</string> </value> <value> <string>Gadget SlapOS Payment Result JS</string> </value>
</item> </item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.64933.61168.51421</string> </value> <value> <string>984.11864.24475.17493</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1516648704.86</float> <float>1590639279.1</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment