Skip to content

Commit d800127

Browse files
authored
Add files via upload
Signed-off-by: Adrian <76214766+adrian2793@users.noreply.github.com>
1 parent d466f38 commit d800127

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

addons/xsolla_sdk/XsollaSDK.gd

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@tool
2+
extends HTTPRequest
3+
4+
var json_result;
5+
var json;
6+
var _request_completed : bool = false;
7+
8+
func get_json():
9+
return json;
10+
11+
func get_virtual_items(project_id : int, limit : int = 50, offset : int = 0, locale : String = "en", show_inactive_time_limited_offer : int = 0):
12+
$HTTPRequest.request("https://store.xsolla.com/api/v2/project/" + str(int(project_id)) + "/items/virtual_items?limit=" + str(int(limit)) + "&offset=" + str(int(offset)) + "&locale=" + locale + "&show_inactive_time_limited_items=" + str(int(show_inactive_time_limited_offer)));
13+
$HTTPRequest.request_completed.connect(_on_request_completed);
14+
15+
func get_list_of_catalog_filter_rules(project_id, api_key, limit : int = 50, offset : int = 0, is_enabled : int = 0):
16+
$HTTPRequest.request("https://store.xsolla.com/api/v2/project/" + str(int(project_id)) + "/admin/user/attribute/rule?limit=" + str(int(limit)) + "&offset=" + str(int(offset)) + "&is_enabled=" + str(int(is_enabled)), ["Authorization: Basic " + str(int(project_id)) + ":" + str(int(api_key))]);
17+
$HTTPRequest.request_completed.connect(_on_request_completed);
18+
19+
func _on_request_completed(result, response_code, headers, body):
20+
json = JSON.parse_string(body.get_string_from_utf8());
21+
_request_completed = true;
22+
print(_request_completed);
23+
print(json);

addons/xsolla_sdk/node.svg

Lines changed: 1 addition & 0 deletions
Loading

addons/xsolla_sdk/plugin.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[plugin]
2+
3+
name="Xsolla SDK"
4+
description=""
5+
author="Spaceship"
6+
version=""
7+
script="plugin.gd"

addons/xsolla_sdk/plugin.gd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@tool
2+
extends EditorPlugin
3+
4+
func _enter_tree():
5+
add_custom_type("XsolllaSDK", "HTTPRequest", preload("XsollaSDK.gd"), preload("node.svg"));
6+
7+
func _exit_tree():
8+
remove_custom_type("XsollaSDK");

0 commit comments

Comments
 (0)