iamport 0.3.4 → 0.4.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.
Files changed (40) hide show
  1. package/README.md +83 -5
  2. package/index.d.ts +848 -0
  3. package/lib/iamport.js +18 -1
  4. package/lib/iamportMethod.js +28 -2
  5. package/lib/resources/Benepia.js +47 -0
  6. package/lib/resources/Certifications.js +26 -0
  7. package/lib/resources/Codes.js +78 -0
  8. package/lib/resources/Cvs.js +46 -0
  9. package/lib/resources/Escrows.js +59 -0
  10. package/lib/resources/KcpQuick.js +47 -0
  11. package/lib/resources/Naver.js +276 -0
  12. package/lib/resources/Partners.js +33 -0
  13. package/lib/resources/Payco.js +33 -0
  14. package/lib/resources/Payments.js +59 -0
  15. package/lib/resources/Paymentwall.js +33 -0
  16. package/lib/resources/Receipts.js +99 -0
  17. package/lib/resources/Subscribe.js +85 -1
  18. package/lib/resources/Subscribe_customer.js +42 -0
  19. package/lib/resources/Tiers.js +32 -0
  20. package/lib/resources/Users.js +32 -0
  21. package/lib/resources/Vbank.js +40 -1
  22. package/openapi.json +11658 -0
  23. package/package.json +1 -1
  24. package/test/resources/Benepia.spec.js +49 -0
  25. package/test/resources/Certification.spec.js +53 -0
  26. package/test/resources/Codes.spec.js +45 -0
  27. package/test/resources/Cvs.spec.js +45 -0
  28. package/test/resources/Escrows.spec.js +71 -0
  29. package/test/resources/KcpQuick.spec.js +45 -0
  30. package/test/resources/Naver.spec.js +305 -0
  31. package/test/resources/Partners.spec.js +31 -0
  32. package/test/resources/Payco.spec.js +31 -0
  33. package/test/resources/Payment.spec.js +60 -0
  34. package/test/resources/Paymentwall.spec.js +31 -0
  35. package/test/resources/Receipts.spec.js +113 -0
  36. package/test/resources/Subscribe.spec.js +163 -0
  37. package/test/resources/Tiers.spec.js +19 -0
  38. package/test/resources/Users.spec.js +11 -0
  39. package/test/resources/Vbank.spec.js +61 -0
  40. package/.npmignore +0 -10
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * iamport
3
+ * MIT Licensed
4
+ */
5
+
6
+ 'use strict';
7
+
8
+ var resource = require('../resource'),
9
+ iamportMethod = resource.iamportMethod;
10
+
11
+ /**
12
+ * Module exports.
13
+ * @public
14
+ */
15
+ module.exports = resource.extend({
16
+
17
+ path: 'payco',
18
+
19
+ /** method 생성
20
+ * PAYCO 주문 상태를 변경합니다.
21
+ * @see {@link https://api.iamport.kr/#!/payco/updatePaycoOrderStatus}
22
+ *
23
+ * @returns {promise} json 주문 정보
24
+ * @public
25
+ */
26
+ updateOrderStatus: iamportMethod({
27
+ method: 'POST',
28
+ command: 'orders/status',
29
+ urlParam: 'imp_uid',
30
+ require: ['status']
31
+ })
32
+
33
+ });
@@ -100,6 +100,65 @@ module.exports = resource.extend({
100
100
  method: 'GET',
101
101
  command: 'prepare',
102
102
  urlParam: 'merchant_uid'
103
+ }),
104
+
105
+ /** method 생성
106
+ * 아임포트 고유 아이디로 결제 잔액 정보를 조회합니다.
107
+ * @see {@link https://api.iamport.kr/#!/payments/getPaymentBalanceByImpUid}
108
+ *
109
+ * @param {Object}
110
+ * @returns {promise} json 결제 잔액 정보
111
+ * @public
112
+ */
113
+ getBalance: iamportMethod({
114
+ method: 'GET',
115
+ command: null,
116
+ urlParam: 'imp_uid',
117
+ command2: 'balance'
118
+ }),
119
+
120
+ /** method 생성
121
+ * 여러 건의 결제 정보를 한꺼번에 조회합니다. (imp_uid[] 또는 merchant_uid[] 쿼리)
122
+ * @see {@link https://api.iamport.kr/#!/payments/getPaymentsByImpUid}
123
+ *
124
+ * @param {Object}
125
+ * @returns {promise} json 결제 정보 배열
126
+ * @public
127
+ */
128
+ getByImpUids: iamportMethod({
129
+ method: 'GET',
130
+ command: null,
131
+ urlParam: null
132
+ }),
133
+
134
+ /** method 생성
135
+ * 상점 고유 아이디로 결제 정보 목록을 조회합니다.
136
+ * @see {@link https://api.iamport.kr/#!/payments/getAllPaymentsByMerchantUid}
137
+ *
138
+ * @param {Object}
139
+ * @returns {promise} json 결제 정보 목록
140
+ * @public
141
+ */
142
+ getAllByMerchant: iamportMethod({
143
+ method: 'GET',
144
+ command: 'findAll',
145
+ urlParam: 'merchant_uid',
146
+ urlParam2: 'payment_status'
147
+ }),
148
+
149
+ /** method 생성
150
+ * 사전등록된 결제정보를 수정합니다.
151
+ * @see {@link https://api.iamport.kr/#!/payments.validation/updatePaymentPrepare}
152
+ *
153
+ * @param {Object}
154
+ * @returns {promise} json 결제 정보
155
+ * @public
156
+ */
157
+ updatePrepare: iamportMethod({
158
+ method: 'PUT',
159
+ command: 'prepare',
160
+ urlParam: null,
161
+ require: ['merchant_uid', 'amount']
103
162
  })
104
163
 
105
164
  });
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * iamport
3
+ * MIT Licensed
4
+ */
5
+
6
+ 'use strict';
7
+
8
+ var resource = require('../resource'),
9
+ iamportMethod = resource.iamportMethod;
10
+
11
+ /**
12
+ * Module exports.
13
+ * @public
14
+ */
15
+ module.exports = resource.extend({
16
+
17
+ path: 'paymentwall',
18
+
19
+ /** method 생성
20
+ * Paymentwall 배송정보를 전달합니다.
21
+ * @see {@link https://api.iamport.kr/#!/paymentwall/sendPaymentwallDelivery}
22
+ *
23
+ * @returns {promise} json 배송 정보
24
+ * @public
25
+ */
26
+ sendDelivery: iamportMethod({
27
+ method: 'POST',
28
+ command: 'delivery',
29
+ urlParam: null,
30
+ require: ['imp_uid', 'merchant_uid', 'type', 'status', 'estimated_delivery_datetime', 'estimated_update_datetime', 'refundable', 'shipping_address_email']
31
+ })
32
+
33
+ });
@@ -0,0 +1,99 @@
1
+ /*!
2
+ * iamport
3
+ * MIT Licensed
4
+ */
5
+
6
+ 'use strict';
7
+
8
+ var resource = require('../resource'),
9
+ iamportMethod = resource.iamportMethod;
10
+
11
+ /**
12
+ * Module exports.
13
+ * @public
14
+ */
15
+ module.exports = resource.extend({
16
+
17
+ path: 'receipts',
18
+
19
+ /** method 생성
20
+ * 아임포트 고유 아이디로 현금영수증 정보를 조회합니다.
21
+ * @see {@link https://api.iamport.kr/#!/receipts/getReceipt}
22
+ *
23
+ * @returns {promise} json 현금영수증 정보
24
+ * @public
25
+ */
26
+ get: iamportMethod({
27
+ method: 'GET',
28
+ command: null,
29
+ urlParam: 'imp_uid'
30
+ }),
31
+
32
+ /** method 생성
33
+ * 아임포트 고유 아이디로 현금영수증을 발행합니다.
34
+ * @see {@link https://api.iamport.kr/#!/receipts/issueReceipt}
35
+ *
36
+ * @returns {promise} json 현금영수증 정보
37
+ * @public
38
+ */
39
+ create: iamportMethod({
40
+ method: 'POST',
41
+ command: null,
42
+ urlParam: 'imp_uid',
43
+ require: ['identifier']
44
+ }),
45
+
46
+ /** method 생성
47
+ * 아임포트 고유 아이디로 현금영수증 발행을 취소합니다.
48
+ * @see {@link https://api.iamport.kr/#!/receipts/cancelReceipt}
49
+ *
50
+ * @returns {promise} json 현금영수증 정보
51
+ * @public
52
+ */
53
+ delete: iamportMethod({
54
+ method: 'DELETE',
55
+ command: null,
56
+ urlParam: 'imp_uid'
57
+ }),
58
+
59
+ /** method 생성
60
+ * 상점 고유 아이디로 외부 현금영수증 정보를 조회합니다.
61
+ * @see {@link https://api.iamport.kr/#!/receipts/getExternalReceipt}
62
+ *
63
+ * @returns {promise} json 현금영수증 정보
64
+ * @public
65
+ */
66
+ getExternal: iamportMethod({
67
+ method: 'GET',
68
+ command: 'external',
69
+ urlParam: 'merchant_uid'
70
+ }),
71
+
72
+ /** method 생성
73
+ * 상점 고유 아이디로 외부 현금영수증을 발행합니다.
74
+ * @see {@link https://api.iamport.kr/#!/receipts/issueExternalReceipt}
75
+ *
76
+ * @returns {promise} json 현금영수증 정보
77
+ * @public
78
+ */
79
+ createExternal: iamportMethod({
80
+ method: 'POST',
81
+ command: 'external',
82
+ urlParam: 'merchant_uid',
83
+ require: ['channel_key', 'name', 'amount', 'identifier']
84
+ }),
85
+
86
+ /** method 생성
87
+ * 상점 고유 아이디로 외부 현금영수증 발행을 취소합니다.
88
+ * @see {@link https://api.iamport.kr/#!/receipts/cancelExternalReceipt}
89
+ *
90
+ * @returns {promise} json 현금영수증 정보
91
+ * @public
92
+ */
93
+ deleteExternal: iamportMethod({
94
+ method: 'DELETE',
95
+ command: 'external',
96
+ urlParam: 'merchant_uid'
97
+ })
98
+
99
+ });
@@ -41,7 +41,7 @@ module.exports = resource.extend({
41
41
  method: 'POST',
42
42
  command: 'again',
43
43
  urlParam: null,
44
- require: ['customer_uid','merchant_uid','amount']
44
+ require: ['customer_uid','merchant_uid','amount','name']
45
45
  }),
46
46
 
47
47
  /** method 생성
@@ -71,6 +71,90 @@ module.exports = resource.extend({
71
71
  command: 'unschedule',
72
72
  urlParam: null,
73
73
  require: ['customer_uid']
74
+ }),
75
+
76
+ /** method 생성
77
+ * 예약된 결제목록을 조회합니다.
78
+ * @see {@link https://api.iamport.kr/#!/subscribe/payments/schedule}
79
+ *
80
+ * @returns {promise} json 스케줄 정보
81
+ * @public
82
+ */
83
+ getSchedules: iamportMethod({
84
+ method: 'GET',
85
+ command: 'schedule',
86
+ urlParam: null,
87
+ require: ['schedule_from', 'schedule_to']
88
+ }),
89
+
90
+ /** method 생성
91
+ * 상점 고유 아이디로 예약된 결제를 조회합니다.
92
+ * @see {@link https://api.iamport.kr/#!/subscribe/payments/schedule/merchant_uid}
93
+ *
94
+ * @returns {promise} json 스케줄 정보
95
+ * @public
96
+ */
97
+ getScheduleByMerchantUid: iamportMethod({
98
+ method: 'GET',
99
+ command: 'schedule',
100
+ urlParam: 'merchant_uid'
101
+ }),
102
+
103
+ /** method 생성
104
+ * 상점 고유 아이디로 예약된 결제를 수정합니다.
105
+ * @see {@link https://api.iamport.kr/#!/subscribe/payments/schedule/merchant_uid}
106
+ *
107
+ * @returns {promise} json 스케줄 정보
108
+ * @public
109
+ */
110
+ updateSchedule: iamportMethod({
111
+ method: 'PUT',
112
+ command: 'schedule',
113
+ urlParam: 'merchant_uid',
114
+ require: ['schedule_at']
115
+ }),
116
+
117
+ /** method 생성
118
+ * 예약된 결제를 재시도합니다.
119
+ * @see {@link https://api.iamport.kr/#!/subscribe/payments/schedule/merchant_uid/retry}
120
+ *
121
+ * @returns {promise} json 스케줄 정보
122
+ * @public
123
+ */
124
+ retrySchedule: iamportMethod({
125
+ method: 'POST',
126
+ command: 'schedule',
127
+ urlParam: 'merchant_uid',
128
+ command2: 'retry'
129
+ }),
130
+
131
+ /** method 생성
132
+ * 예약된 결제를 재예약합니다.
133
+ * @see {@link https://api.iamport.kr/#!/subscribe/payments/schedule/merchant_uid/reschedule}
134
+ *
135
+ * @returns {promise} json 스케줄 정보
136
+ * @public
137
+ */
138
+ rescheduleSchedule: iamportMethod({
139
+ method: 'POST',
140
+ command: 'schedule',
141
+ urlParam: 'merchant_uid',
142
+ command2: 'reschedule',
143
+ require: ['schedule_at']
144
+ }),
145
+
146
+ /** method 생성
147
+ * 구매자의 customer_uid로 예약된 결제목록을 조회합니다.
148
+ * @see {@link https://api.iamport.kr/#!/subscribe/payments/schedule/customers/customer_uid}
149
+ *
150
+ * @returns {promise} json 스케줄 정보
151
+ * @public
152
+ */
153
+ getSchedulesByCustomerUid: iamportMethod({
154
+ method: 'GET',
155
+ command: 'schedule/customers',
156
+ urlParam: 'customer_uid',
157
+ require: ['from', 'to']
74
158
  })
75
159
 
76
160
  });
@@ -74,6 +74,48 @@ module.exports = resource.extend({
74
74
  method: 'DELETE',
75
75
  command: 'customers',
76
76
  urlParam: 'customer_uid'
77
+ }),
78
+
79
+ /** method 생성
80
+ * 구매자의 빌링키로 결제된 결제목록 조회
81
+ * @see {@link https://api.iamport.kr/#!/subscribe.customer/customer_payments}
82
+ *
83
+ * @returns {promise} json 결제 정보
84
+ * @public
85
+ */
86
+ getPayments: iamportMethod({
87
+ method: 'GET',
88
+ command: 'customers',
89
+ urlParam: 'customer_uid',
90
+ command2: 'payments'
91
+ }),
92
+
93
+ /** method 생성
94
+ * 여러 구매자의 빌키 정보를 한꺼번에 조회합니다.
95
+ * @see {@link https://api.iamport.kr/#!/subscribe.customer/customer_view_multiple}
96
+ *
97
+ * @returns {promise} json 빌키 정보 목록
98
+ * @public
99
+ */
100
+ getMultiple: iamportMethod({
101
+ method: 'GET',
102
+ command: 'customers',
103
+ urlParam: null
104
+ }),
105
+
106
+ /** method 생성
107
+ * 구매자의 빌링키로 예약된 결제 스케줄을 조회합니다.
108
+ * @see {@link https://api.iamport.kr/#!/subscribe.customer/customer_schedules}
109
+ *
110
+ * @returns {promise} json 스케줄 정보
111
+ * @public
112
+ */
113
+ getSchedules: iamportMethod({
114
+ method: 'GET',
115
+ command: 'customers',
116
+ urlParam: 'customer_uid',
117
+ command2: 'schedules',
118
+ require: ['from', 'to']
77
119
  })
78
120
 
79
121
  });
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * iamport
3
+ * MIT Licensed
4
+ */
5
+
6
+ 'use strict';
7
+
8
+ var resource = require('../resource'),
9
+ iamportMethod = resource.iamportMethod;
10
+
11
+ /**
12
+ * Module exports.
13
+ * @public
14
+ */
15
+ module.exports = resource.extend({
16
+
17
+ path: 'tiers',
18
+
19
+ /** method 생성
20
+ * 하위 상점 정보를 조회합니다.
21
+ * @see {@link https://api.iamport.kr/#!/tiers/getTier}
22
+ *
23
+ * @returns {promise} json 하위 상점 정보
24
+ * @public
25
+ */
26
+ get: iamportMethod({
27
+ method: 'GET',
28
+ command: null,
29
+ urlParam: 'tier_code'
30
+ })
31
+
32
+ });
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * iamport
3
+ * MIT Licensed
4
+ */
5
+
6
+ 'use strict';
7
+
8
+ var resource = require('../resource'),
9
+ iamportMethod = resource.iamportMethod;
10
+
11
+ /**
12
+ * Module exports.
13
+ * @public
14
+ */
15
+ module.exports = resource.extend({
16
+
17
+ path: 'users',
18
+
19
+ /** method 생성
20
+ * PG사 설정 정보를 조회합니다.
21
+ * @see {@link https://api.iamport.kr/#!/users/getPgSettings}
22
+ *
23
+ * @returns {promise} json PG 설정 정보
24
+ * @public
25
+ */
26
+ getPg: iamportMethod({
27
+ method: 'GET',
28
+ command: 'pg',
29
+ urlParam: null
30
+ })
31
+
32
+ });
@@ -28,6 +28,45 @@ module.exports = resource.extend({
28
28
  command: null ,
29
29
  urlParam: null,
30
30
  require: ['merchant_uid','amount','vbank_code','vbank_due','vbank_holder']
31
- })
31
+ }),
32
+
33
+ /** method 생성
34
+ * 희망하시는 은행, 계좌번호로 예금주명을 조회할 수 있습니다.
35
+ * @see {@link https://api.iamport.kr/#!/vbanks/queryBankHolder}
36
+ *
37
+ * @returns {promise} json 결제 정보
38
+ * @public
39
+ */
40
+ getHolder: iamportMethod({
41
+ method: 'GET',
42
+ command: 'holder',
43
+ urlParam: null,
44
+ require: ['bank_code','bank_num'],
45
+ }),
32
46
 
47
+ /** method 생성
48
+ * 가상계좌 정보를 수정합니다. (입금기한, 금액 등)
49
+ * @see {@link https://api.iamport.kr/#!/vbanks/updateVbank}
50
+ *
51
+ * @returns {promise} json 결제 정보
52
+ * @public
53
+ */
54
+ update: iamportMethod({
55
+ method: 'PUT',
56
+ command: null,
57
+ urlParam: 'imp_uid'
58
+ }),
59
+
60
+ /** method 생성
61
+ * 가상계좌를 삭제(말소)합니다.
62
+ * @see {@link https://api.iamport.kr/#!/vbanks/deleteVbank}
63
+ *
64
+ * @returns {promise} json 결제 정보
65
+ * @public
66
+ */
67
+ delete: iamportMethod({
68
+ method: 'DELETE',
69
+ command: null,
70
+ urlParam: 'imp_uid'
71
+ }),
33
72
  });