gamemoney 5.0.0 → 6.0.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
@@ -1,4 +1,4 @@
1
- ![GameMoney](https://auth.gamemoney.com/assets/img/logo_gamemoney_login.png)
1
+ ![GameMoney](https://cp.gmpays.com/assets/img/gm_logo.png)
2
2
 
3
3
  [GameMoney](https://gmpays.com/) API wrapper for Node.js
4
4
 
package/index.d.ts CHANGED
@@ -86,6 +86,21 @@ export type GetInvoiceListResponse = {
86
86
  list: GetInvoiceStatusResponse[];
87
87
  is_limit_exceeded: 'yes' | 'no';
88
88
  };
89
+ export type GetCardSessionStatusRequest = Record<string, any> & ({
90
+ invoice: string;
91
+ } | {
92
+ project_invoice: string;
93
+ });
94
+ export type WaitOrDeclineCardSessionStatusResponse = {
95
+ status: 'wait' | 'decline';
96
+ data: string;
97
+ };
98
+ export type FinishCardSessionStatusResponse = {
99
+ status: 'finish';
100
+ type: 'redirect';
101
+ data: string;
102
+ };
103
+ export type GetCardSessionStatusResponse = WaitOrDeclineCardSessionStatusResponse | FinishCardSessionStatusResponse;
89
104
  export type CancelCheckoutRequest = {
90
105
  [key: string]: any;
91
106
  projectId: string;
@@ -312,13 +327,13 @@ export type CreateTerminalResponse = {
312
327
  };
313
328
  export type InvoiceStatus = 'New' | 'Processing' | 'Paid' | 'Chargeback' | 'Refund' | 'Chargeback_cancel' | 'Refused';
314
329
  export type InvoiceNotification = {
315
- project: number;
316
- invoice: number;
330
+ project: string;
331
+ invoice: string;
317
332
  status: InvoiceStatus;
318
- amount: number;
319
- net_amount: number;
320
- recieved_amount: number;
321
- rate?: number;
333
+ amount: string;
334
+ net_amount: string;
335
+ recieved_amount: string;
336
+ rate?: string;
322
337
  user: string;
323
338
  type: string;
324
339
  wallet: string;
@@ -382,6 +397,8 @@ export default class GameMoney {
382
397
  getInvoiceStatus(body: GetInvoiceStatusRequest): Promise<GetInvoiceStatusResponse & GenericResponse>;
383
398
  /** For more details and usage information see [docs](https://cp.gmpays.com/apidoc#invoice_list) */
384
399
  getInvoiceList(body: GetInvoiceListRequest): Promise<GetInvoiceListResponse & GenericResponse>;
400
+ /** For more details and usage information see [docs](https://cp.gmpays.com/apidoc#card_session_status) */
401
+ getCardSessionStatus(body: GetCardSessionStatusRequest): Promise<GetCardSessionStatusResponse & GenericResponse>;
385
402
  /** For more details and usage information see [docs](https://cp.gmpays.com/apidoc#checkout_insert) */
386
403
  createCheckout(body: CreateCheckoutRequest): Promise<GenericResponse>;
387
404
  /** For more details and usage information see [docs](https://cp.gmpays.com/apidoc#checkout_cancel) */
package/index.js CHANGED
@@ -70,6 +70,10 @@ export default class GameMoney {
70
70
  async getInvoiceList(body) {
71
71
  return this.request('invoice/list', body);
72
72
  }
73
+ /** For more details and usage information see [docs](https://cp.gmpays.com/apidoc#card_session_status) */
74
+ async getCardSessionStatus(body) {
75
+ return this.request('invoice/cardsession/status', body);
76
+ }
73
77
  /** For more details and usage information see [docs](https://cp.gmpays.com/apidoc#checkout_insert) */
74
78
  async createCheckout(body) {
75
79
  return this.request('checkout/insert', body, SignType.RSA);
package/package.json CHANGED
@@ -1,85 +1,85 @@
1
1
  {
2
- "name": "gamemoney",
3
- "version": "5.0.0",
4
- "description": "GameMoney API wrapper for Node.js",
5
- "keywords": [
6
- "gamemoney",
7
- "gmpays",
8
- "gm",
9
- "merchant"
10
- ],
11
- "homepage": "https://github.com/gamemoney-ps/gamemoney-node-sdk#readme",
12
- "bugs": {
13
- "url": "https://github.com/gamemoney-ps/gamemoney-node-sdk/issues",
14
- "email": "maxpain177@gmail.com"
15
- },
16
- "author": {
17
- "name": "Maxim Makarov",
18
- "email": "maxpain177@gmail.com",
19
- "url": "https://maxpain.pro"
20
- },
21
- "license": "MIT",
22
- "repository": {
23
- "type": "git",
24
- "url": "https://github.com/gamemoney-ps/gamemoney-node-sdk"
25
- },
26
- "type": "module",
27
- "exports": {
28
- ".": {
29
- "import": "./index.js",
30
- "types": "./index.d.ts"
31
- }
32
- },
33
- "scripts": {
34
- "prebuild": "rm -rf .build",
35
- "build": "tsc",
36
- "postbuild": "cp -r package*.json .npmignore ./src/certs README.md .build",
37
- "test": "NODE_OPTIONS=--experimental-vm-modules jest",
38
- "lint": "xo",
39
- "lint:fix": "xo --fix"
40
- },
41
- "lint-staged": {
42
- "*.ts": "xo"
43
- },
44
- "jest": {
45
- "testMatch": [
46
- "**/*.test.ts"
47
- ],
48
- "preset": "ts-jest/presets/default-esm",
49
- "globals": {
50
- "ts-jest": {
51
- "useESM": true
52
- }
53
- },
54
- "moduleNameMapper": {
55
- "^(\\.{1,2}/.*)\\.js$": "$1"
56
- },
57
- "maxConcurrency": 50
58
- },
59
- "xo": {
60
- "extends": "@onmoon",
61
- "prettier": true
62
- },
63
- "prettier": "@onmoon/prettier-config",
64
- "devDependencies": {
65
- "@onmoon/eslint-config": "^1.0.12",
66
- "@onmoon/prettier-config": "^1.0.2",
67
- "@onmoon/tsconfigs": "^2.0.2",
68
- "@types/body-parser": "^1.19.2",
69
- "@types/express": "^4.17.17",
70
- "@types/jest": "^29.4.0",
71
- "@types/node": "^18.13.0",
72
- "@types/uuid": "^9.0.0",
73
- "body-parser": "^1.20.1",
74
- "express": "^4.18.2",
75
- "husky": "^8.0.3",
76
- "lint-staged": "^13.1.1",
77
- "ts-jest": "^29.0.5",
78
- "typescript": "^4.9.5",
79
- "uuid": "^9.0.0",
80
- "xo": "^0.53.1"
81
- },
82
- "dependencies": {
83
- "got": "^12.5.3"
84
- }
2
+ "name": "gamemoney",
3
+ "version": "6.0.0",
4
+ "description": "GameMoney API wrapper for Node.js",
5
+ "keywords": [
6
+ "gamemoney",
7
+ "gmpays",
8
+ "gm",
9
+ "merchant"
10
+ ],
11
+ "homepage": "https://github.com/gamemoney-ps/gamemoney-node-sdk#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/gamemoney-ps/gamemoney-node-sdk/issues",
14
+ "email": "maxpain177@gmail.com"
15
+ },
16
+ "author": {
17
+ "name": "Maxim Makarov",
18
+ "email": "maxpain177@gmail.com",
19
+ "url": "https://maxpain.pro"
20
+ },
21
+ "license": "MIT",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/gamemoney-ps/gamemoney-node-sdk"
25
+ },
26
+ "type": "module",
27
+ "exports": {
28
+ ".": {
29
+ "import": "./index.js",
30
+ "types": "./index.d.ts"
31
+ }
32
+ },
33
+ "scripts": {
34
+ "prebuild": "rm -rf .build",
35
+ "build": "tsc",
36
+ "postbuild": "cp -r package*.json .npmignore ./src/certs README.md .build",
37
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest",
38
+ "lint": "xo",
39
+ "lint:fix": "xo --fix"
40
+ },
41
+ "lint-staged": {
42
+ "*.ts": "xo"
43
+ },
44
+ "jest": {
45
+ "testMatch": [
46
+ "**/*.test.ts"
47
+ ],
48
+ "preset": "ts-jest/presets/default-esm",
49
+ "globals": {
50
+ "ts-jest": {
51
+ "useESM": true
52
+ }
53
+ },
54
+ "moduleNameMapper": {
55
+ "^(\\.{1,2}/.*)\\.js$": "$1"
56
+ },
57
+ "maxConcurrency": 50
58
+ },
59
+ "xo": {
60
+ "extends": "@onmoon",
61
+ "prettier": true
62
+ },
63
+ "prettier": "@onmoon/prettier-config",
64
+ "devDependencies": {
65
+ "@onmoon/eslint-config": "^1.0.12",
66
+ "@onmoon/prettier-config": "^1.0.2",
67
+ "@onmoon/tsconfigs": "^3.0.0",
68
+ "@types/body-parser": "^1.19.2",
69
+ "@types/express": "^4.17.17",
70
+ "@types/jest": "^29.5.2",
71
+ "@types/node": "^20.4.0",
72
+ "@types/uuid": "^9.0.2",
73
+ "body-parser": "^1.20.2",
74
+ "express": "^4.18.2",
75
+ "husky": "^8.0.3",
76
+ "lint-staged": "^13.2.3",
77
+ "ts-jest": "^29.1.1",
78
+ "typescript": "^5.1.6",
79
+ "uuid": "^9.0.0",
80
+ "xo": "^0.54.2"
81
+ },
82
+ "dependencies": {
83
+ "got": "^12.6.1"
84
+ }
85
85
  }
package/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import crypto from 'node:crypto';
3
3
  export type RsaKey = Parameters<crypto.Sign['sign']>[0];
4
4
  export type HmacKey = Parameters<typeof crypto.createHmac>[1];