@tineon/t9n 0.1.2 → 0.1.4
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/dist/index.js +2 -11
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -306,9 +306,8 @@ export class T9nCheckout {
|
|
|
306
306
|
}
|
|
307
307
|
assertSecureConfig() {
|
|
308
308
|
const apiURL = new URL(this.getApiBaseUrl());
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
throw new Error("T9N: apiBaseUrl must use HTTPS outside local development.");
|
|
309
|
+
if (apiURL.protocol !== "https:") {
|
|
310
|
+
throw new Error("T9N: apiBaseUrl must use HTTPS");
|
|
312
311
|
}
|
|
313
312
|
}
|
|
314
313
|
applyButtonStyle(btn, style) {
|
|
@@ -397,14 +396,6 @@ export class T9nCheckout {
|
|
|
397
396
|
}
|
|
398
397
|
}
|
|
399
398
|
function resolveDefaultApiBaseUrl() {
|
|
400
|
-
if (typeof window === "undefined") {
|
|
401
|
-
return T9N_DEFAULT_API_BASE_URL;
|
|
402
|
-
}
|
|
403
|
-
const host = window.location.hostname.toLowerCase();
|
|
404
|
-
const isLocal = host === "localhost" || host === "127.0.0.1" || host === "::1";
|
|
405
|
-
if (isLocal) {
|
|
406
|
-
return "http://localhost:8090";
|
|
407
|
-
}
|
|
408
399
|
return T9N_DEFAULT_API_BASE_URL;
|
|
409
400
|
}
|
|
410
401
|
export function initializeT9n(config) {
|
package/dist/types.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export type T9nHooks = {
|
|
|
33
33
|
error: string;
|
|
34
34
|
}) => void;
|
|
35
35
|
};
|
|
36
|
-
export declare const T9N_DEFAULT_API_BASE_URL = "https://slimepay.
|
|
36
|
+
export declare const T9N_DEFAULT_API_BASE_URL = "https://slimepay-server.up.railway.app";
|
|
37
37
|
export declare const checkoutConfigSchema: z.ZodObject<{
|
|
38
38
|
publicKey: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
39
39
|
amountNgn: z.ZodNumber;
|
package/dist/types.js
CHANGED
|
@@ -14,7 +14,7 @@ export const NATIVE_CURRENCIES = [
|
|
|
14
14
|
"FTM",
|
|
15
15
|
"HBAR",
|
|
16
16
|
];
|
|
17
|
-
export const T9N_DEFAULT_API_BASE_URL = "https://slimepay.
|
|
17
|
+
export const T9N_DEFAULT_API_BASE_URL = "https://slimepay-server.up.railway.app";
|
|
18
18
|
const trimmedString = () => z
|
|
19
19
|
.string()
|
|
20
20
|
.transform((v) => v.trim())
|