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.
- package/README.md +83 -5
- package/index.d.ts +848 -0
- package/lib/iamport.js +18 -1
- package/lib/iamportMethod.js +28 -2
- package/lib/resources/Benepia.js +47 -0
- package/lib/resources/Certifications.js +26 -0
- package/lib/resources/Codes.js +78 -0
- package/lib/resources/Cvs.js +46 -0
- package/lib/resources/Escrows.js +59 -0
- package/lib/resources/KcpQuick.js +47 -0
- package/lib/resources/Naver.js +276 -0
- package/lib/resources/Partners.js +33 -0
- package/lib/resources/Payco.js +33 -0
- package/lib/resources/Payments.js +59 -0
- package/lib/resources/Paymentwall.js +33 -0
- package/lib/resources/Receipts.js +99 -0
- package/lib/resources/Subscribe.js +85 -1
- package/lib/resources/Subscribe_customer.js +42 -0
- package/lib/resources/Tiers.js +32 -0
- package/lib/resources/Users.js +32 -0
- package/lib/resources/Vbank.js +40 -1
- package/openapi.json +11658 -0
- package/package.json +1 -1
- package/test/resources/Benepia.spec.js +49 -0
- package/test/resources/Certification.spec.js +53 -0
- package/test/resources/Codes.spec.js +45 -0
- package/test/resources/Cvs.spec.js +45 -0
- package/test/resources/Escrows.spec.js +71 -0
- package/test/resources/KcpQuick.spec.js +45 -0
- package/test/resources/Naver.spec.js +305 -0
- package/test/resources/Partners.spec.js +31 -0
- package/test/resources/Payco.spec.js +31 -0
- package/test/resources/Payment.spec.js +60 -0
- package/test/resources/Paymentwall.spec.js +31 -0
- package/test/resources/Receipts.spec.js +113 -0
- package/test/resources/Subscribe.spec.js +163 -0
- package/test/resources/Tiers.spec.js +19 -0
- package/test/resources/Users.spec.js +11 -0
- package/test/resources/Vbank.spec.js +61 -0
- package/.npmignore +0 -10
|
@@ -84,3 +84,63 @@ describe('payment.getByStatus', function() {
|
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
|
+
|
|
88
|
+
describe('payment.getBalance', function() {
|
|
89
|
+
it('Should return error when imp_uid is missing', function(done){
|
|
90
|
+
iamport.payment.getBalance()
|
|
91
|
+
.then(function(result){
|
|
92
|
+
expect(result).to.be.empty;
|
|
93
|
+
done();
|
|
94
|
+
})
|
|
95
|
+
.catch(function(error){
|
|
96
|
+
expect(error.toString()).to.contain('Param missing');
|
|
97
|
+
done();
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
describe('payment.getByImpUids', function() {
|
|
103
|
+
it('Should be a function', function(){
|
|
104
|
+
expect(iamport.payment.getByImpUids).to.be.a('function');
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe('payment.getAllByMerchant', function() {
|
|
109
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
110
|
+
iamport.payment.getAllByMerchant()
|
|
111
|
+
.then(function(result){
|
|
112
|
+
expect(result).to.be.empty;
|
|
113
|
+
done();
|
|
114
|
+
})
|
|
115
|
+
.catch(function(error){
|
|
116
|
+
expect(error.toString()).to.contain('Param missing');
|
|
117
|
+
done();
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
describe('payment.updatePrepare', function() {
|
|
123
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
124
|
+
iamport.payment.updatePrepare()
|
|
125
|
+
.then(function(result){
|
|
126
|
+
expect(result).to.be.empty;
|
|
127
|
+
done();
|
|
128
|
+
})
|
|
129
|
+
.catch(function(error){
|
|
130
|
+
expect(error.toString()).to.contain('Param missing');
|
|
131
|
+
done();
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('Should return error when amount is missing', function(done){
|
|
136
|
+
iamport.payment.updatePrepare({merchant_uid: 'test_merchant_uid'})
|
|
137
|
+
.then(function(result){
|
|
138
|
+
expect(result).to.be.empty;
|
|
139
|
+
done();
|
|
140
|
+
})
|
|
141
|
+
.catch(function(error){
|
|
142
|
+
expect(error.toString()).to.contain('Param missing');
|
|
143
|
+
done();
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var iamport = new require('../../lib/iamport')()
|
|
5
|
+
, expect = require('chai').expect;
|
|
6
|
+
|
|
7
|
+
describe('paymentwall.sendDelivery', function(){
|
|
8
|
+
it('Should return error when imp_uid is missing', function(done){
|
|
9
|
+
iamport.paymentwall.sendDelivery()
|
|
10
|
+
.then(function(result){
|
|
11
|
+
expect(result).to.be.empty;
|
|
12
|
+
done();
|
|
13
|
+
})
|
|
14
|
+
.catch(function(error){
|
|
15
|
+
expect(error.toString()).to.contain('Param missing');
|
|
16
|
+
done();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
21
|
+
iamport.paymentwall.sendDelivery({imp_uid: 'test_imp_uid'})
|
|
22
|
+
.then(function(result){
|
|
23
|
+
expect(result).to.be.empty;
|
|
24
|
+
done();
|
|
25
|
+
})
|
|
26
|
+
.catch(function(error){
|
|
27
|
+
expect(error.toString()).to.contain('Param missing');
|
|
28
|
+
done();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var iamport = new require('../../lib/iamport')()
|
|
5
|
+
, expect = require('chai').expect;
|
|
6
|
+
|
|
7
|
+
describe('receipt.get', function(){
|
|
8
|
+
it('Should return error when imp_uid is missing', function(done){
|
|
9
|
+
iamport.receipt.get()
|
|
10
|
+
.then(function(result){
|
|
11
|
+
expect(result).to.be.empty;
|
|
12
|
+
done();
|
|
13
|
+
})
|
|
14
|
+
.catch(function(error){
|
|
15
|
+
expect(error.toString()).to.contain('Param missing');
|
|
16
|
+
done();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe('receipt.create', function(){
|
|
22
|
+
it('Should return error when imp_uid is missing', function(done){
|
|
23
|
+
iamport.receipt.create()
|
|
24
|
+
.then(function(result){
|
|
25
|
+
expect(result).to.be.empty;
|
|
26
|
+
done();
|
|
27
|
+
})
|
|
28
|
+
.catch(function(error){
|
|
29
|
+
expect(error.toString()).to.contain('Param missing');
|
|
30
|
+
done();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('Should return error when identifier is missing', function(done){
|
|
35
|
+
iamport.receipt.create({imp_uid: 'test_imp_uid'})
|
|
36
|
+
.then(function(result){
|
|
37
|
+
expect(result).to.be.empty;
|
|
38
|
+
done();
|
|
39
|
+
})
|
|
40
|
+
.catch(function(error){
|
|
41
|
+
expect(error.toString()).to.contain('Param missing');
|
|
42
|
+
done();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('receipt.delete', function(){
|
|
48
|
+
it('Should return error when imp_uid is missing', function(done){
|
|
49
|
+
iamport.receipt.delete()
|
|
50
|
+
.then(function(result){
|
|
51
|
+
expect(result).to.be.empty;
|
|
52
|
+
done();
|
|
53
|
+
})
|
|
54
|
+
.catch(function(error){
|
|
55
|
+
expect(error.toString()).to.contain('Param missing');
|
|
56
|
+
done();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe('receipt.getExternal', function(){
|
|
62
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
63
|
+
iamport.receipt.getExternal()
|
|
64
|
+
.then(function(result){
|
|
65
|
+
expect(result).to.be.empty;
|
|
66
|
+
done();
|
|
67
|
+
})
|
|
68
|
+
.catch(function(error){
|
|
69
|
+
expect(error.toString()).to.contain('Param missing');
|
|
70
|
+
done();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe('receipt.createExternal', function(){
|
|
76
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
77
|
+
iamport.receipt.createExternal()
|
|
78
|
+
.then(function(result){
|
|
79
|
+
expect(result).to.be.empty;
|
|
80
|
+
done();
|
|
81
|
+
})
|
|
82
|
+
.catch(function(error){
|
|
83
|
+
expect(error.toString()).to.contain('Param missing');
|
|
84
|
+
done();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('Should return error when channel_key is missing', function(done){
|
|
89
|
+
iamport.receipt.createExternal({merchant_uid: 'test_merchant'})
|
|
90
|
+
.then(function(result){
|
|
91
|
+
expect(result).to.be.empty;
|
|
92
|
+
done();
|
|
93
|
+
})
|
|
94
|
+
.catch(function(error){
|
|
95
|
+
expect(error.toString()).to.contain('Param missing');
|
|
96
|
+
done();
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
describe('receipt.deleteExternal', function(){
|
|
102
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
103
|
+
iamport.receipt.deleteExternal()
|
|
104
|
+
.then(function(result){
|
|
105
|
+
expect(result).to.be.empty;
|
|
106
|
+
done();
|
|
107
|
+
})
|
|
108
|
+
.catch(function(error){
|
|
109
|
+
expect(error.toString()).to.contain('Param missing');
|
|
110
|
+
done();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -16,5 +16,168 @@ describe('subscribe_customer.create', function(){
|
|
|
16
16
|
done();
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe('subscribe.getSchedules', function(){
|
|
22
|
+
it('Should return error when schedule_from is missing', function(done){
|
|
23
|
+
iamport.subscribe.getSchedules()
|
|
24
|
+
.then(function(result){
|
|
25
|
+
expect(result).to.be.empty;
|
|
26
|
+
done();
|
|
27
|
+
})
|
|
28
|
+
.catch(function(error){
|
|
29
|
+
expect(error.toString()).to.contain('Param missing');
|
|
30
|
+
done();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('Should return error when schedule_to is missing', function(done){
|
|
35
|
+
iamport.subscribe.getSchedules({schedule_from: 1234567890})
|
|
36
|
+
.then(function(result){
|
|
37
|
+
expect(result).to.be.empty;
|
|
38
|
+
done();
|
|
39
|
+
})
|
|
40
|
+
.catch(function(error){
|
|
41
|
+
expect(error.toString()).to.contain('Param missing');
|
|
42
|
+
done();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('subscribe.getScheduleByMerchantUid', function(){
|
|
48
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
49
|
+
iamport.subscribe.getScheduleByMerchantUid()
|
|
50
|
+
.then(function(result){
|
|
51
|
+
expect(result).to.be.empty;
|
|
52
|
+
done();
|
|
53
|
+
})
|
|
54
|
+
.catch(function(error){
|
|
55
|
+
expect(error.toString()).to.contain('Param missing');
|
|
56
|
+
done();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe('subscribe.updateSchedule', function(){
|
|
62
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
63
|
+
iamport.subscribe.updateSchedule()
|
|
64
|
+
.then(function(result){
|
|
65
|
+
expect(result).to.be.empty;
|
|
66
|
+
done();
|
|
67
|
+
})
|
|
68
|
+
.catch(function(error){
|
|
69
|
+
expect(error.toString()).to.contain('Param missing');
|
|
70
|
+
done();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('Should return error when schedule_at is missing', function(done){
|
|
75
|
+
iamport.subscribe.updateSchedule({merchant_uid: 'test_merchant'})
|
|
76
|
+
.then(function(result){
|
|
77
|
+
expect(result).to.be.empty;
|
|
78
|
+
done();
|
|
79
|
+
})
|
|
80
|
+
.catch(function(error){
|
|
81
|
+
expect(error.toString()).to.contain('Param missing');
|
|
82
|
+
done();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
describe('subscribe.retrySchedule', function(){
|
|
88
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
89
|
+
iamport.subscribe.retrySchedule()
|
|
90
|
+
.then(function(result){
|
|
91
|
+
expect(result).to.be.empty;
|
|
92
|
+
done();
|
|
93
|
+
})
|
|
94
|
+
.catch(function(error){
|
|
95
|
+
expect(error.toString()).to.contain('Param missing');
|
|
96
|
+
done();
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
});
|
|
19
100
|
|
|
101
|
+
describe('subscribe.rescheduleSchedule', function(){
|
|
102
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
103
|
+
iamport.subscribe.rescheduleSchedule()
|
|
104
|
+
.then(function(result){
|
|
105
|
+
expect(result).to.be.empty;
|
|
106
|
+
done();
|
|
107
|
+
})
|
|
108
|
+
.catch(function(error){
|
|
109
|
+
expect(error.toString()).to.contain('Param missing');
|
|
110
|
+
done();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('Should return error when schedule_at is missing', function(done){
|
|
115
|
+
iamport.subscribe.rescheduleSchedule({merchant_uid: 'test_merchant'})
|
|
116
|
+
.then(function(result){
|
|
117
|
+
expect(result).to.be.empty;
|
|
118
|
+
done();
|
|
119
|
+
})
|
|
120
|
+
.catch(function(error){
|
|
121
|
+
expect(error.toString()).to.contain('Param missing');
|
|
122
|
+
done();
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
describe('subscribe.getSchedulesByCustomerUid', function(){
|
|
128
|
+
it('Should return error when customer_uid is missing', function(done){
|
|
129
|
+
iamport.subscribe.getSchedulesByCustomerUid()
|
|
130
|
+
.then(function(result){
|
|
131
|
+
expect(result).to.be.empty;
|
|
132
|
+
done();
|
|
133
|
+
})
|
|
134
|
+
.catch(function(error){
|
|
135
|
+
expect(error.toString()).to.contain('Param missing');
|
|
136
|
+
done();
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('Should return error when from is missing', function(done){
|
|
141
|
+
iamport.subscribe.getSchedulesByCustomerUid({customer_uid: 'test_customer'})
|
|
142
|
+
.then(function(result){
|
|
143
|
+
expect(result).to.be.empty;
|
|
144
|
+
done();
|
|
145
|
+
})
|
|
146
|
+
.catch(function(error){
|
|
147
|
+
expect(error.toString()).to.contain('Param missing');
|
|
148
|
+
done();
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
describe('subscribe_customer.getMultiple', function(){
|
|
154
|
+
it('Should be a function', function(){
|
|
155
|
+
expect(iamport.subscribe_customer.getMultiple).to.be.a('function');
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
describe('subscribe_customer.getSchedules', function(){
|
|
160
|
+
it('Should return error when customer_uid is missing', function(done){
|
|
161
|
+
iamport.subscribe_customer.getSchedules()
|
|
162
|
+
.then(function(result){
|
|
163
|
+
expect(result).to.be.empty;
|
|
164
|
+
done();
|
|
165
|
+
})
|
|
166
|
+
.catch(function(error){
|
|
167
|
+
expect(error.toString()).to.contain('Param missing');
|
|
168
|
+
done();
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('Should return error when from is missing', function(done){
|
|
173
|
+
iamport.subscribe_customer.getSchedules({customer_uid: 'test_customer'})
|
|
174
|
+
.then(function(result){
|
|
175
|
+
expect(result).to.be.empty;
|
|
176
|
+
done();
|
|
177
|
+
})
|
|
178
|
+
.catch(function(error){
|
|
179
|
+
expect(error.toString()).to.contain('Param missing');
|
|
180
|
+
done();
|
|
181
|
+
});
|
|
182
|
+
});
|
|
20
183
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var iamport = new require('../../lib/iamport')()
|
|
5
|
+
, expect = require('chai').expect;
|
|
6
|
+
|
|
7
|
+
describe('tier.get', function(){
|
|
8
|
+
it('Should return error when tier_code is missing', function(done){
|
|
9
|
+
iamport.tier.get()
|
|
10
|
+
.then(function(result){
|
|
11
|
+
expect(result).to.be.empty;
|
|
12
|
+
done();
|
|
13
|
+
})
|
|
14
|
+
.catch(function(error){
|
|
15
|
+
expect(error.toString()).to.contain('Param missing');
|
|
16
|
+
done();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var iamport = new require('../../lib/iamport')()
|
|
5
|
+
, expect = require('chai').expect;
|
|
6
|
+
|
|
7
|
+
describe('vbank.create', function(){
|
|
8
|
+
it('Should return error when merchant_uid is missing', function(done){
|
|
9
|
+
iamport.vbank.create()
|
|
10
|
+
.then(function(result){
|
|
11
|
+
expect(result).to.be.empty;
|
|
12
|
+
done();
|
|
13
|
+
})
|
|
14
|
+
.catch(function(error){
|
|
15
|
+
expect(error.toString()).to.contain('Param missing');
|
|
16
|
+
done();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe('vbank.getHolder', function(){
|
|
22
|
+
it('Should return error when bank_code is missing', function(done){
|
|
23
|
+
iamport.vbank.getHolder()
|
|
24
|
+
.then(function(result){
|
|
25
|
+
expect(result).to.be.empty;
|
|
26
|
+
done();
|
|
27
|
+
})
|
|
28
|
+
.catch(function(error){
|
|
29
|
+
expect(error.toString()).to.contain('Param missing');
|
|
30
|
+
done();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
describe('vbank.update', function(){
|
|
36
|
+
it('Should return error when imp_uid is missing', function(done){
|
|
37
|
+
iamport.vbank.update()
|
|
38
|
+
.then(function(result){
|
|
39
|
+
expect(result).to.be.empty;
|
|
40
|
+
done();
|
|
41
|
+
})
|
|
42
|
+
.catch(function(error){
|
|
43
|
+
expect(error.toString()).to.contain('Param missing');
|
|
44
|
+
done();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('vbank.delete', function(){
|
|
50
|
+
it('Should return error when imp_uid is missing', function(done){
|
|
51
|
+
iamport.vbank.delete()
|
|
52
|
+
.then(function(result){
|
|
53
|
+
expect(result).to.be.empty;
|
|
54
|
+
done();
|
|
55
|
+
})
|
|
56
|
+
.catch(function(error){
|
|
57
|
+
expect(error.toString()).to.contain('Param missing');
|
|
58
|
+
done();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
});
|
package/.npmignore
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Dependency directory
|
|
2
|
-
# Commenting this out is preferred by some people, see
|
|
3
|
-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
|
|
4
|
-
node_modules
|
|
5
|
-
|
|
6
|
-
# Vim generated file
|
|
7
|
-
*.swp
|
|
8
|
-
|
|
9
|
-
# JetBrains IDE configuration files
|
|
10
|
-
.idea
|