@paygood1/collect-core 0.6.1 → 0.7.0
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/README.md
CHANGED
|
@@ -23,7 +23,7 @@ The sessions response includes `sessionKey`. Pass that value into
|
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
25
|
// Server-side example
|
|
26
|
-
const intentResponse = await fetch("https://api-
|
|
26
|
+
const intentResponse = await fetch("https://api-sandbox.paygood.co/tokenization/intents", {
|
|
27
27
|
method: "POST",
|
|
28
28
|
headers: {
|
|
29
29
|
Authorization: "Bearer YOUR_MERCHANT_API_KEY",
|
|
@@ -33,7 +33,7 @@ const intentResponse = await fetch("https://api-staging.paygood.co/tokenization/
|
|
|
33
33
|
});
|
|
34
34
|
const { token } = await intentResponse.json();
|
|
35
35
|
|
|
36
|
-
const sessionResponse = await fetch("https://api-
|
|
36
|
+
const sessionResponse = await fetch("https://api-sandbox.paygood.co/tokenization/sessions", {
|
|
37
37
|
method: "POST",
|
|
38
38
|
headers: {
|
|
39
39
|
Authorization: `Bearer ${token}`,
|
|
@@ -88,10 +88,3 @@ interface TokenizationResult {
|
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
`instrument` is an optional field you can pass in the `createCardCollectCore` init config object; it defaults to `"card"` when omitted.
|
|
91
|
-
|
|
92
|
-
`mode` controls the internal whitelabel URL:
|
|
93
|
-
- `sandbox` -> `https://elements-dev.paygood.co/`
|
|
94
|
-
- `production` -> `https://elements.paygood.com`
|
|
95
|
-
|
|
96
|
-
Set `useStockDomain: true` to omit the PayGood whitelabel domain and use Basis Theory's
|
|
97
|
-
default Elements origin (`https://js.basistheory.com`) instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/internal/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAiBxE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAEjE;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,eAAe,EACrB,cAAc,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/internal/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAiBxE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAEjE;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,eAAe,EACrB,cAAc,UAAO,GACpB,MAAM,GAAG,SAAS,CAMpB;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,eAAe,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAU1F;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,eAAe,GAAG,sBAAsB,CAE1F"}
|
package/dist/internal/config.js
CHANGED
|
@@ -3,7 +3,7 @@ const WHITELABEL_DOMAINS = {
|
|
|
3
3
|
production: "https://elements.paygood.com"
|
|
4
4
|
};
|
|
5
5
|
const TOKENIZATION_API_BASE_URLS = {
|
|
6
|
-
sandbox: "https://
|
|
6
|
+
sandbox: "https://api-sandbox.paygood.co",
|
|
7
7
|
production: ""
|
|
8
8
|
};
|
|
9
9
|
const MODE_DEFAULT_ENVIRONMENT = {
|
|
@@ -13,7 +13,7 @@ const MODE_DEFAULT_ENVIRONMENT = {
|
|
|
13
13
|
export function getWhitelabelDomain(mode) {
|
|
14
14
|
return WHITELABEL_DOMAINS[mode];
|
|
15
15
|
}
|
|
16
|
-
export function resolveCustomDomain(mode, useStockDomain) {
|
|
16
|
+
export function resolveCustomDomain(mode, useStockDomain = true) {
|
|
17
17
|
if (useStockDomain) {
|
|
18
18
|
return undefined;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/internal/config.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAoC;IAC1D,OAAO,EAAE,kCAAkC;IAC3C,UAAU,EAAE,8BAA8B;CAC3C,CAAC;AAEF,MAAM,0BAA0B,GAAoC;IAClE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/internal/config.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAoC;IAC1D,OAAO,EAAE,kCAAkC;IAC3C,UAAU,EAAE,8BAA8B;CAC3C,CAAC;AAEF,MAAM,0BAA0B,GAAoC;IAClE,OAAO,EAAE,gCAAgC;IACzC,UAAU,EAAE,EAAE;CACf,CAAC;AAEF,MAAM,wBAAwB,GAAoD;IAChF,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,IAAI;CACjB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,IAAqB;IACvD,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,IAAqB,EACrB,cAAc,GAAG,IAAI;IAErB,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAAqB,EAAE,QAAiB;IAChF,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,MAAM,OAAO,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IACxD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,yCAAyC,IAAI,QAAQ,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,IAAqB;IAChE,OAAO,wBAAwB,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -7,7 +7,7 @@ const configSchema = z.object({
|
|
|
7
7
|
debug: z.boolean().optional(),
|
|
8
8
|
tokenizationApiBaseUrl: z.string().optional(),
|
|
9
9
|
sessionKey: z.string().trim().min(1).optional(),
|
|
10
|
-
useStockDomain: z.boolean().default(
|
|
10
|
+
useStockDomain: z.boolean().default(true)
|
|
11
11
|
});
|
|
12
12
|
export function validateConfig(input) {
|
|
13
13
|
return configSchema.parse(input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/validation/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1D,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACzD,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5B,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC5D,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7B,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/validation/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1D,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACzD,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5B,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC5D,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7B,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;CAC1C,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc,CAAC,KAAwB;IACrD,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paygood1/collect-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Pure card collection module for PayGood",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,10 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@basis-theory/web-elements": "2.15.0",
|
|
26
|
+
"vite": "8.2.2",
|
|
26
27
|
"zod": "^3.23.8"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"typescript": "^5.6.2",
|
|
30
|
-
"vitest": "^
|
|
31
|
+
"vitest": "^4.1.11"
|
|
31
32
|
}
|
|
32
33
|
}
|