-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnexpay-gen.html
More file actions
272 lines (248 loc) · 9.04 KB
/
nexpay-gen.html
File metadata and controls
272 lines (248 loc) · 9.04 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Nexpay Generator - CatWeb Tools</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="./static/images/favicon.ico" />
<link rel="stylesheet" href="stylesheet.css" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
/>
</head>
<body>
<header>
<h1>Nexpay Generator</h1>
<div class="description">
Create custom Nexpay checkout URLs for your products.
</div>
</header>
<main>
<form id="nexpay-form" onsubmit="return false;">
<div class="form-group">
<label>
Background Color
<span
class="tooltip"
data-tooltip="The HEX color code for the background of the image (e.g., #RRGGBB)."
><i class="fas fa-question-circle"></i></span>
</label>
<input type="color" id="dblockcol" required />
</div>
<div class="form-group">
<label>
Product Image
<span
class="tooltip"
data-tooltip="A Roblox Decal (Object) ID for your product image."
><i class="fas fa-question-circle"></i></span>
<a
href="https://create.roblox.com/store/decals"
target="_blank"
rel="noopener noreferrer"
class="icon-info-link"
>Roblox Decals</a>
</label>
<input type="text" id="dimage" required autocomplete="off" />
</div>
<div class="form-group">
<label>
Product Title
<span
class="tooltip"
data-tooltip="The main title displayed for your product."
><i class="fas fa-question-circle"></i></span>
</label>
<input type="text" id="ftitletxt" required autocomplete="off" />
</div>
<div class="form-group">
<label>
Product Price (in Robux)
<span
class="tooltip"
data-tooltip="The price of your product."
><i class="fas fa-question-circle"></i></span>
</label>
<input
type="number"
id="fpricetxt"
required
autocomplete="off"
min="0"
/>
</div>
<div class="form-group">
<label>
Product Type
<span
class="tooltip"
data-tooltip="The type of Roblox item being purchased (GamePass, Product, Asset)."
><i class="fas fa-question-circle"></i></span>
</label>
<div class="radio-group">
<label>
<input type="radio" name="ftypepr" value="GamePass" required />
GamePass
</label>
<label>
<input type="radio" name="ftypepr" value="Product" />
Product
</label>
<label>
<input type="radio" name="ftypepr" value="Asset" />
Asset
</label>
</div>
</div>
<div class="form-group">
<label>
Product ID
<span
class="tooltip"
data-tooltip="The ID of the GamePass, Product, or Asset to purchase."
><i class="fas fa-question-circle"></i></span>
</label>
<input type="text" id="fidpr" required autocomplete="off" />
</div>
<div class="form-group">
<label>
Success URL
<span
class="tooltip"
data-tooltip="The URL where the user is redirected after a successful payment."
><i class="fas fa-question-circle"></i></span>
</label>
<input type="text" id="fresuc" required autocomplete="off" />
</div>
<div class="form-group">
<label>
Cancellation URL
<span
class="tooltip"
data-tooltip="The URL where the user is redirected if the payment is canceled."
><i class="fas fa-question-circle"></i></span>
</label>
<input type="text" id="frecan" required autocomplete="off" />
</div>
</form>
<button id="add-demo-btn" type="button" style="margin-top: 10px">
Add Demo Data
</button>
<div class="output" id="output" style="display: none">
<code id="generated-code"></code>
</div>
<button class="copy-btn" id="copy-btn" title="Copy to clipboard">
<i class="fas fa-copy"></i> Copy
</button>
</main>
<footer>
This site is open source.
<a href="https://github.com/TRC-Loop/CatWebTools" target="_blank"
>Improve this page</a
>. This page is not affiliated with Nexpay. | Version:
<script src="./static/version.js"></script>
<a href="changelog" target="_blank"> View Changelog</a>.
</footer>
<script>
const dblockcolInput = document.getElementById("dblockcol");
const dimageInput = document.getElementById("dimage");
const ftitletxtInput = document.getElementById("ftitletxt");
const fpricetxtInput = document.getElementById("fpricetxt");
const ftypeprInputs = document.querySelectorAll('input[name="ftypepr"]');
const fidprInput = document.getElementById("fidpr");
const fresucInput = document.getElementById("fresuc");
const frecanInput = document.getElementById("frecan");
const output = document.getElementById("output");
const generatedCode = document.getElementById("generated-code");
const copyBtn = document.getElementById("copy-btn");
function generateUrl() {
const dblockcol = encodeURIComponent(
dblockcolInput.value.replace("#", "")
);
const dimage = encodeURIComponent(dimageInput.value.trim());
const ftitletxt = encodeURIComponent(ftitletxtInput.value.trim());
const fpricetxt = encodeURIComponent(fpricetxtInput.value.trim());
let ftypepr = "";
ftypeprInputs.forEach((radio) => {
if (radio.checked) {
ftypepr = encodeURIComponent(radio.value);
}
});
const fidpr = encodeURIComponent(fidprInput.value.trim());
const fresuc = encodeURIComponent(fresucInput.value.trim());
const frecan = encodeURIComponent(frecanInput.value.trim());
if (
!dblockcol ||
!dimage ||
!ftitletxt ||
!fpricetxt ||
!ftypepr ||
!fidpr ||
!fresuc ||
!frecan
) {
output.style.display = "none";
return;
}
const baseUrl = "nexpay.rbx/checkouts";
const url = `${baseUrl}?dblockcol=${dblockcol}&dimage=${dimage}&ftitletxt=${ftitletxt}&fpricetxt=${fpricetxt}&ftypepr=${ftypepr}&fidpr=${fidpr}&fresuc=${fresuc}&frecan=${frecan}`;
// Set the URL as plain text inside <code>
generatedCode.textContent = url;
// Store the URL for copying
generatedCode.setAttribute("data-url", url);
output.style.display = "block";
}
[
dblockcolInput,
dimageInput,
ftitletxtInput,
fpricetxtInput,
fidprInput,
fresucInput,
frecanInput,
].forEach((input) => input.addEventListener("input", generateUrl));
ftypeprInputs.forEach((radio) =>
radio.addEventListener("change", generateUrl)
);
document
.getElementById("copy-btn")
.addEventListener("click", () => {
const urlToCopy = generatedCode.getAttribute("data-url");
if (urlToCopy) {
navigator.clipboard
.writeText(urlToCopy)
.then(() => {
document.getElementById("copy-btn").textContent = "Copied!";
setTimeout(() => {
document.getElementById("copy-btn").innerHTML =
'<i class="fas fa-copy"></i> Copy';
}, 1500);
})
.catch(() => {
document.getElementById("copy-btn").textContent =
"Failed to copy";
setTimeout(() => {
document.getElementById("copy-btn").innerHTML =
'<i class="fas fa-copy"></i> Copy';
}, 1500);
});
}
});
const addDemoBtn = document.getElementById("add-demo-btn");
addDemoBtn.addEventListener("click", () => {
dblockcolInput.value = "#007bff";
dimageInput.value = "1234567890";
ftitletxtInput.value = "Awesome GamePass";
fpricetxtInput.value = "499";
document.querySelector('input[value="GamePass"]').checked = true;
fidprInput.value = "9876543210";
// Demo URLs now use yourwebsite.rbx without a protocol
fresucInput.value = "yourwebsite.rbx/success";
frecanInput.value = "yourwebsite.rbx/cancel";
generateUrl();
});
window.addEventListener("load", generateUrl);
</script>
</body>
</html>