Skip to content

Commit 1bc12bd

Browse files
authored
Merge pull request #178 from samchon/features/fetch
`node-fetch` 의 조건부 사용.
2 parents 2a1cbe4 + f991291 commit 1bc12bd

File tree

13 files changed

+36
-36
lines changed

13 files changed

+36
-36
lines changed

packages/fake-iamport-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fake-iamport-server",
3-
"version": "5.1.1",
3+
"version": "5.1.2",
44
"description": "Fake iamport server for testing",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",

packages/fake-iamport-server/src/providers/FakeIamportPaymentProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { DomainError } from "tstl/exception/DomainError";
66
import { FakeIamportConfiguration } from "../FakeIamportConfiguration";
77
import { FakeIamportStorage } from "./FakeIamportStorage";
88

9+
(global as any).fetch ??= require("node-fetch");
10+
911
export namespace FakeIamportPaymentProvider {
1012
export function store(payment: IIamportPayment): void {
1113
FakeIamportStorage.payments.set(payment.imp_uid, payment);

packages/fake-toss-payments-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fake-toss-payments-server",
3-
"version": "5.1.1",
3+
"version": "5.1.2",
44
"description": "Fake toss-payments server for testing",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",

packages/fake-toss-payments-server/src/providers/FakeTossWebhookProvider.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@ import { ITossPaymentWebhook } from "toss-payments-server-api/lib/structures/ITo
33
import { FakeTossConfiguration } from "../FakeTossConfiguration";
44

55
// POLYFILL FOR NODE
6-
if (
7-
typeof global === "object" &&
8-
typeof global.process === "object" &&
9-
typeof global.process.versions === "object" &&
10-
typeof global.process.versions.node !== undefined
11-
)
12-
(global as any).fetch = require("node-fetch");
6+
(global as any).fetch ??= require("node-fetch");
137

148
export namespace FakeTossWebhookProvider {
159
export async function webhook(input: ITossPaymentWebhook): Promise<void> {

packages/iamport-server-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iamport-server-api",
3-
"version": "5.1.1",
3+
"version": "5.1.2",
44
"description": "API for Iamport Server",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",

packages/iamport-server-api/swagger.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"info": {
1414
"title": "Iamport API",
1515
"description": "Built by [fake-iamport-server](https://github.com/samchon/payments/tree/master/packages/fake-iamport-server) with [nestia](https://github.com/samchon/nestia)",
16-
"version": "5.1.1",
16+
"version": "5.1.2",
1717
"license": {
1818
"name": "MIT"
1919
}
@@ -529,7 +529,7 @@
529529
"target": {
530530
"fileName": "D:/github/samchon/payments/packages/fake-iamport-server/src/api/structures/IIamportCertification.ts",
531531
"textSpan": {
532-
"start": 429,
532+
"start": 447,
533533
"length": 16
534534
}
535535
}
@@ -630,7 +630,7 @@
630630
"target": {
631631
"fileName": "D:/github/samchon/payments/packages/fake-iamport-server/src/api/structures/IIamportCertification.ts",
632632
"textSpan": {
633-
"start": 429,
633+
"start": 447,
634634
"length": 16
635635
}
636636
}
@@ -831,7 +831,7 @@
831831
"target": {
832832
"fileName": "D:/github/samchon/payments/packages/fake-iamport-server/src/api/structures/IIamportCertification.ts",
833833
"textSpan": {
834-
"start": 429,
834+
"start": 447,
835835
"length": 16
836836
}
837837
}
@@ -1096,7 +1096,7 @@
10961096
"target": {
10971097
"fileName": "D:/github/samchon/payments/packages/fake-iamport-server/src/api/structures/IIamportPayment.ts",
10981098
"textSpan": {
1099-
"start": 2017,
1099+
"start": 2101,
11001100
"length": 16
11011101
}
11021102
}
@@ -1302,7 +1302,7 @@
13021302
"target": {
13031303
"fileName": "D:/github/samchon/payments/packages/fake-iamport-server/src/api/structures/IIamportPayment.ts",
13041304
"textSpan": {
1305-
"start": 2017,
1305+
"start": 2101,
13061306
"length": 16
13071307
}
13081308
}
@@ -1415,7 +1415,7 @@
14151415
"target": {
14161416
"fileName": "D:/github/samchon/payments/packages/fake-iamport-server/src/api/structures/IIamportPayment.ts",
14171417
"textSpan": {
1418-
"start": 2017,
1418+
"start": 2101,
14191419
"length": 16
14201420
}
14211421
}
@@ -1533,7 +1533,7 @@
15331533
"target": {
15341534
"fileName": "D:/github/samchon/payments/packages/fake-iamport-server/src/api/structures/IIamportPayment.ts",
15351535
"textSpan": {
1536-
"start": 2017,
1536+
"start": 2101,
15371537
"length": 16
15381538
}
15391539
}

packages/payment-api/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@samchon/payment-api",
3-
"version": "5.1.1",
3+
"version": "5.1.2",
44
"description": "API for Payment Backend",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
@@ -35,8 +35,8 @@
3535
},
3636
"dependencies": {
3737
"@nestia/fetcher": "^2.3.9",
38-
"iamport-server-api": "^5.1.1",
39-
"toss-payments-server-api": "^5.1.1",
38+
"iamport-server-api": "^5.1.2",
39+
"toss-payments-server-api": "^5.1.2",
4040
"typia": "^5.2.6"
4141
}
4242
}

packages/payment-api/swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}
88
],
99
"info": {
10-
"version": "5.1.1",
10+
"version": "5.1.2",
1111
"title": "@samchon/payment-backend",
1212
"description": "Payment Backend Server",
1313
"license": {

packages/payment-backend/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@samchon/payment-backend",
3-
"version": "5.1.1",
3+
"version": "5.1.2",
44
"description": "Payment Backend Server",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
@@ -64,12 +64,12 @@
6464
"@typescript-eslint/parser": "^5.26.0",
6565
"cli": "^1.0.1",
6666
"copyfiles": "^2.4.1",
67-
"iamport-server-api": "^5.1.1",
67+
"iamport-server-api": "^5.1.2",
6868
"nestia": "^5.0.3",
6969
"pm2": "^4.5.6",
7070
"rimraf": "^3.0.2",
7171
"sloc": "^0.2.1",
72-
"toss-payments-server-api": "^5.1.1",
72+
"toss-payments-server-api": "^5.1.2",
7373
"ts-loader": "^9.5.0",
7474
"ts-node": "^10.9.1",
7575
"ts-patch": "^3.0.2",
@@ -88,8 +88,8 @@
8888
"bcryptjs": "^2.4.3",
8989
"dotenv": "^16.3.1",
9090
"dotenv-expand": "^10.0.0",
91-
"fake-iamport-server": "^5.1.1",
92-
"fake-toss-payments-server": "^5.1.1",
91+
"fake-iamport-server": "^5.1.2",
92+
"fake-toss-payments-server": "^5.1.2",
9393
"fastify": "^4.24.3",
9494
"git-last-commit": "^1.0.0",
9595
"inquirer": "^8.2.5",

packages/payment-backend/src/providers/payments/PaymentHistoryProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { TossPaymentService } from "../../services/toss/TossPaymentService";
1616
import { BcryptUtil } from "../../utils/BcryptUtil";
1717
import { PaymentCancelHistoryProvider } from "./PaymentCancelHistoryProvider";
1818

19+
(global as any).fetch ??= require("node-fetch");
20+
1921
export namespace PaymentHistoryProvider {
2022
export namespace json {
2123
export const transform = (

0 commit comments

Comments
 (0)