@amos.com/node 0.1.35 → 0.1.37
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 +15 -15
- package/dist/index.d.mts +11 -17
- package/dist/index.d.ts +11 -17
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/openapi/schema.ts +2 -8
- package/package.json +2 -1
- package/src/index.ts +8 -8
package/openapi/schema.ts
CHANGED
|
@@ -1262,21 +1262,15 @@ export interface components {
|
|
|
1262
1262
|
exp_year?: number;
|
|
1263
1263
|
moto?: boolean;
|
|
1264
1264
|
};
|
|
1265
|
-
/** @description Apple Pay card profile for embed confirm. Clients
|
|
1265
|
+
/** @description Apple Pay card profile for embed confirm. Clients only send wallet_payload (the raw JSON-encoded PKPaymentToken). Brand, last4, expiration, pan_type, wallet_provider, and cryptogram are set from the Vault response. Encrypted PAN and client-supplied cryptogram are not supported. */
|
|
1266
1266
|
ApplePayCardProfileInput: {
|
|
1267
|
-
wallet_brand?: string;
|
|
1268
|
-
/** @description Display last4 from the Apple Pay payment method. */
|
|
1269
|
-
wallet_last4?: string;
|
|
1270
1267
|
/** @description The unmodified JSON-encoded PKPaymentToken. */
|
|
1271
1268
|
wallet_payload: string;
|
|
1272
|
-
wallet_provider?: components["schemas"]["WalletProviderType"];
|
|
1273
1269
|
};
|
|
1270
|
+
/** @description Google Pay card profile for embed confirm. Clients only send wallet_payload. Brand, last4, expiration, pan_type, wallet_provider, and cryptogram are set from the Vault response. Encrypted PAN is not supported. */
|
|
1274
1271
|
GooglePayCardProfileInput: {
|
|
1275
|
-
wallet_brand?: string;
|
|
1276
|
-
wallet_last4?: string;
|
|
1277
1272
|
/** @description The unmodified Google Pay payment token payload. */
|
|
1278
1273
|
wallet_payload: string;
|
|
1279
|
-
wallet_provider?: components["schemas"]["WalletProviderType"];
|
|
1280
1274
|
};
|
|
1281
1275
|
CardProfile: {
|
|
1282
1276
|
avs_check?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amos.com/node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.37",
|
|
4
4
|
"description": "Node.js client for the Amos Pay API.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"biome": "biome check --write",
|
|
22
22
|
"build": "tsup",
|
|
23
|
+
"watch": "tsup --watch",
|
|
23
24
|
"typecheck": "tsc --noEmit",
|
|
24
25
|
"generate": "git -C ../openapi pull && rm -rf openapi/schema.ts && openapi-typescript ../openapi/amos/openapi.public.yaml --output openapi/schema.ts --enum-values",
|
|
25
26
|
"prepack": "npm run build",
|
package/src/index.ts
CHANGED
|
@@ -6,9 +6,9 @@ import type { paths } from "../openapi/schema";
|
|
|
6
6
|
|
|
7
7
|
export * from "../openapi/schema";
|
|
8
8
|
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
9
|
+
export const AMOS_API_BASE_URL_PRODUCTION = "https://api.amos.com";
|
|
10
|
+
export const AMOS_API_BASE_URL_SANDBOX = "https://api-sandbox.amos.com";
|
|
11
|
+
export const AMOS_API_VERSION = "1";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Create a typed `openapi-fetch` client for the Amos Pay API.
|
|
@@ -26,20 +26,20 @@ export const PAY_API_VERSION = "1";
|
|
|
26
26
|
* ```ts
|
|
27
27
|
* import {
|
|
28
28
|
* createPayApiClient,
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* AMOS_API_BASE_URL_SANDBOX,
|
|
30
|
+
* AMOS_API_VERSION,
|
|
31
31
|
* } from "@amos.com/node";
|
|
32
32
|
*
|
|
33
33
|
* const pay = createPayApiClient({
|
|
34
|
-
* baseUrl:
|
|
34
|
+
* baseUrl: AMOS_API_BASE_URL_SANDBOX,
|
|
35
35
|
* headers: {
|
|
36
36
|
* "X-Api-Key": process.env.AMOS_API_KEY!,
|
|
37
|
-
* "X-Api-Version":
|
|
37
|
+
* "X-Api-Version": AMOS_API_VERSION,
|
|
38
38
|
* },
|
|
39
39
|
* });
|
|
40
40
|
*
|
|
41
41
|
* const { data, error } = await pay.POST("/customers", {
|
|
42
|
-
* params: { header: { "X-Api-Version":
|
|
42
|
+
* params: { header: { "X-Api-Version": AMOS_API_VERSION } },
|
|
43
43
|
* body: { customer: { email: "alex@example.com" } },
|
|
44
44
|
* });
|
|
45
45
|
* ```
|