@branta-ops/branta 1.0.1 → 1.0.2
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/v2/client.d.ts
CHANGED
package/dist/v2/client.js
CHANGED
|
@@ -11,9 +11,10 @@ export class V2BrantaClient {
|
|
|
11
11
|
return [];
|
|
12
12
|
}
|
|
13
13
|
const raw = await response.json();
|
|
14
|
-
const data = raw.map(({ platform_logo_url: platformLogoUrl, verify_url: verifyUrl, ...rest }) => ({
|
|
14
|
+
const data = raw.map(({ platform_logo_url: platformLogoUrl, platform_logo_light_url: platformLogoLightUrl, verify_url: verifyUrl, ...rest }) => ({
|
|
15
15
|
...rest,
|
|
16
16
|
platformLogoUrl,
|
|
17
|
+
platformLogoLightUrl,
|
|
17
18
|
verifyUrl,
|
|
18
19
|
}));
|
|
19
20
|
const baseUrl = this._resolveBaseUrl(options);
|
|
@@ -29,6 +30,15 @@ export class V2BrantaClient {
|
|
|
29
30
|
if (!valid)
|
|
30
31
|
throw new BrantaPaymentException("platformLogoUrl domain does not match the configured baseUrl domain");
|
|
31
32
|
}
|
|
33
|
+
if (payment.platformLogoLightUrl) {
|
|
34
|
+
let valid = false;
|
|
35
|
+
try {
|
|
36
|
+
valid = new URL(payment.platformLogoLightUrl).origin === baseOrigin;
|
|
37
|
+
}
|
|
38
|
+
catch { /* invalid URL */ }
|
|
39
|
+
if (!valid)
|
|
40
|
+
throw new BrantaPaymentException("platformLogoLightUrl domain does not match the configured baseUrl domain");
|
|
41
|
+
}
|
|
32
42
|
}
|
|
33
43
|
return data;
|
|
34
44
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface ServerEnvironment {
|
|
2
|
-
value: number;
|
|
3
|
-
url: string;
|
|
4
|
-
}
|
|
5
|
-
export interface BrantaServerBaseUrlType {
|
|
6
|
-
Staging: ServerEnvironment;
|
|
7
|
-
Production: ServerEnvironment;
|
|
8
|
-
Localhost: ServerEnvironment;
|
|
9
|
-
}
|
|
10
|
-
declare const BrantaServerBaseUrl: BrantaServerBaseUrlType;
|
|
11
|
-
export default BrantaServerBaseUrl;
|