@cinerino/sdk 3.48.0 → 3.51.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/example/playground/public/lib/bundle.js +4 -23
- package/example/src/auth/auth.ts +4 -1
- package/example/src/chevre/transaction/processPayCreditCard.ts +1 -0
- package/example/src/chevre/transaction/processPayMGTicket.ts +1 -0
- package/example/src/chevre/transaction/processPayMovieTicket.ts +1 -0
- package/example/src/chevre/transaction/processPublishPaymentUrl.ts +1 -0
- package/example/src/st/searchEventSeats.ts +48 -0
- package/example/src/transaction/checkMovieTicket.ts +33 -30
- package/example/src/transaction/processPlaceOrderByMovieTicket.ts +29 -23
- package/example/src/transaction/processPlaceOrderByMovieTicket4COA.ts +28 -23
- package/lib/bundle.js +4 -23
- package/package.json +2 -2
|
@@ -13531,25 +13531,6 @@ var OrderService = /** @class */ (function (_super) {
|
|
|
13531
13531
|
});
|
|
13532
13532
|
});
|
|
13533
13533
|
};
|
|
13534
|
-
/**
|
|
13535
|
-
* 注文に対するアクションを検索する
|
|
13536
|
-
*/
|
|
13537
|
-
OrderService.prototype.searchActionsByOrderNumber = function (params) {
|
|
13538
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
13539
|
-
var _this = this;
|
|
13540
|
-
return __generator(this, function (_a) {
|
|
13541
|
-
return [2 /*return*/, this.fetch({
|
|
13542
|
-
uri: "/orders/" + params.orderNumber + "/actions",
|
|
13543
|
-
method: 'GET',
|
|
13544
|
-
qs: params,
|
|
13545
|
-
expectedStatusCodes: [http_status_1.OK]
|
|
13546
|
-
})
|
|
13547
|
-
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
13548
|
-
return [2 /*return*/, response.json()];
|
|
13549
|
-
}); }); })];
|
|
13550
|
-
});
|
|
13551
|
-
});
|
|
13552
|
-
};
|
|
13553
13534
|
/**
|
|
13554
13535
|
* 注文取得
|
|
13555
13536
|
*/
|
|
@@ -13844,7 +13825,7 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
13844
13825
|
});
|
|
13845
13826
|
};
|
|
13846
13827
|
/**
|
|
13847
|
-
*
|
|
13828
|
+
* MovieTicket決済承認
|
|
13848
13829
|
*/
|
|
13849
13830
|
PaymentService.prototype.authorizeMovieTicket = function (params) {
|
|
13850
13831
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -13901,7 +13882,7 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
13901
13882
|
});
|
|
13902
13883
|
};
|
|
13903
13884
|
/**
|
|
13904
|
-
*
|
|
13885
|
+
* MovieTicket認証
|
|
13905
13886
|
*/
|
|
13906
13887
|
PaymentService.prototype.checkMovieTicket = function (
|
|
13907
13888
|
// params: factory.action.check.paymentMethod.movieTicket.IObject
|
|
@@ -13910,9 +13891,9 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
13910
13891
|
var _this = this;
|
|
13911
13892
|
return __generator(this, function (_a) {
|
|
13912
13893
|
return [2 /*return*/, this.fetch({
|
|
13913
|
-
uri: "/payment/" + factory.service.paymentService.PaymentServiceType.MovieTicket + "/
|
|
13894
|
+
uri: "/payment/" + factory.service.paymentService.PaymentServiceType.MovieTicket + "/check",
|
|
13914
13895
|
method: 'POST',
|
|
13915
|
-
expectedStatusCodes: [http_status_1.
|
|
13896
|
+
expectedStatusCodes: [http_status_1.OK],
|
|
13916
13897
|
body: params
|
|
13917
13898
|
})
|
|
13918
13899
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
package/example/src/auth/auth.ts
CHANGED
|
@@ -20,11 +20,14 @@ export async function login() {
|
|
|
20
20
|
const state = '12345';
|
|
21
21
|
const codeVerifier = '12345';
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
let authUrl = auth.generateAuthUrl({
|
|
24
24
|
scopes: scopes,
|
|
25
25
|
state: state,
|
|
26
26
|
codeVerifier: codeVerifier
|
|
27
27
|
});
|
|
28
|
+
const signInUrl = new URL(authUrl);
|
|
29
|
+
authUrl = `${signInUrl.href}&identity_provider=`;
|
|
30
|
+
|
|
28
31
|
console.log('authUrl:', authUrl);
|
|
29
32
|
|
|
30
33
|
if (process.env.TEST_REFRESH_TOKEN !== undefined) {
|
|
@@ -43,6 +43,7 @@ async function main() {
|
|
|
43
43
|
recipient: { typeOf: seller.typeOf, name: seller.name, id: seller.id, project: seller.project },
|
|
44
44
|
object: {
|
|
45
45
|
typeOf: client.factory.service.paymentService.PaymentServiceType.CreditCard,
|
|
46
|
+
id: '',
|
|
46
47
|
paymentMethod: {
|
|
47
48
|
typeOf: paymentMethodType,
|
|
48
49
|
amount: 10,
|
|
@@ -42,6 +42,7 @@ async function main() {
|
|
|
42
42
|
recipient: { typeOf: seller.typeOf, name: seller.name, id: seller.id, project: seller.project },
|
|
43
43
|
object: {
|
|
44
44
|
typeOf: client.factory.service.paymentService.PaymentServiceType.MovieTicket,
|
|
45
|
+
id: '',
|
|
45
46
|
paymentMethod: {
|
|
46
47
|
typeOf: paymentMethodType,
|
|
47
48
|
amount: 0,
|
|
@@ -43,6 +43,7 @@ async function main() {
|
|
|
43
43
|
recipient: { typeOf: seller.typeOf, name: seller.name, id: seller.id, project: seller.project },
|
|
44
44
|
object: {
|
|
45
45
|
typeOf: client.factory.service.paymentService.PaymentServiceType.MovieTicket,
|
|
46
|
+
id: '',
|
|
46
47
|
paymentMethod: {
|
|
47
48
|
typeOf: paymentMethodType,
|
|
48
49
|
amount: 0,
|
|
@@ -42,6 +42,7 @@ async function main() {
|
|
|
42
42
|
recipient: { typeOf: seller.typeOf, name: seller.name, id: seller.id, project: seller.project },
|
|
43
43
|
object: {
|
|
44
44
|
typeOf: client.factory.service.paymentService.PaymentServiceType.CreditCard,
|
|
45
|
+
id: '',
|
|
45
46
|
paymentMethod: {
|
|
46
47
|
typeOf: paymentMethodType,
|
|
47
48
|
amount: 10,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// tslint:disable:no-console no-implicit-dependencies no-magic-numbers
|
|
2
|
+
import * as httpStatus from 'http-status';
|
|
3
|
+
|
|
4
|
+
import * as client from '../../../lib/index';
|
|
5
|
+
|
|
6
|
+
const auth = new client.auth.ClientCredentials({
|
|
7
|
+
domain: <string>process.env.ST_AUTHORIZE_SERVER_DOMAIN,
|
|
8
|
+
clientId: <string>process.env.ST_CLIENT_ID,
|
|
9
|
+
clientSecret: <string>process.env.ST_CLIENT_SECRET,
|
|
10
|
+
scopes: [],
|
|
11
|
+
state: 'teststate'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const sellerService = new client.service.Seller({
|
|
15
|
+
endpoint: <string>process.env.ST_API_ENDPOINT,
|
|
16
|
+
auth: auth
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const eventId = '220406001001010900';
|
|
20
|
+
|
|
21
|
+
// tslint:disable-next-line:max-func-body-length
|
|
22
|
+
async function main() {
|
|
23
|
+
console.log('座席を検索しています...');
|
|
24
|
+
const searchResult = await sellerService.fetch({
|
|
25
|
+
uri: `/events/ScreeningEvent/${eventId}/seats`,
|
|
26
|
+
method: 'GET',
|
|
27
|
+
qs: {
|
|
28
|
+
limit: 10
|
|
29
|
+
},
|
|
30
|
+
expectedStatusCodes: [httpStatus.OK]
|
|
31
|
+
})
|
|
32
|
+
.then(async (response) => {
|
|
33
|
+
return {
|
|
34
|
+
data: await response.json()
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
console.log(searchResult.data);
|
|
38
|
+
console.log(searchResult.data.length);
|
|
39
|
+
console.log(searchResult.data[0]?.offers);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
main()
|
|
43
|
+
.then(() => {
|
|
44
|
+
console.log('main processed.');
|
|
45
|
+
})
|
|
46
|
+
.catch((err) => {
|
|
47
|
+
console.error(err);
|
|
48
|
+
});
|
|
@@ -26,8 +26,8 @@ const paymentService = new client.service.Payment({
|
|
|
26
26
|
const movieTickets = [
|
|
27
27
|
{
|
|
28
28
|
typeOf: 'MovieTicket',
|
|
29
|
-
identifier: '
|
|
30
|
-
accessCode: '
|
|
29
|
+
identifier: '2686741478',
|
|
30
|
+
accessCode: '3896'
|
|
31
31
|
}
|
|
32
32
|
// {
|
|
33
33
|
// typeOf: 'MGTicket',
|
|
@@ -38,37 +38,40 @@ const movieTickets = [
|
|
|
38
38
|
|
|
39
39
|
export async function main() {
|
|
40
40
|
// ムビチケ認証
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
const checkMovieTicketResult = await paymentService.checkMovieTicket({
|
|
42
|
+
object: {
|
|
43
|
+
id: '5f9a52994f3709000abe6417',
|
|
44
|
+
paymentMethod: {
|
|
45
|
+
typeOf: movieTickets[0].typeOf
|
|
46
|
+
},
|
|
47
|
+
movieTickets: movieTickets.map((movieTicket) => {
|
|
48
|
+
return {
|
|
49
|
+
...movieTicket,
|
|
50
|
+
project: { id: projectId, typeOf: client.factory.organizationType.Project },
|
|
51
|
+
serviceType: '', // 情報空でよし
|
|
52
|
+
serviceOutput: {
|
|
53
|
+
reservationFor: {
|
|
54
|
+
typeOf: client.factory.chevre.eventType.ScreeningEvent,
|
|
55
|
+
id: 'bkz5a0isy'
|
|
56
|
+
},
|
|
57
|
+
reservedTicket: {
|
|
58
|
+
ticketedSeat: {
|
|
59
|
+
typeOf: client.factory.chevre.placeType.Seat,
|
|
60
|
+
seatingType: '', // 情報空でよし
|
|
61
|
+
seatNumber: '', // 情報空でよし
|
|
62
|
+
seatRow: '', // 情報空でよし
|
|
63
|
+
seatSection: '' // 情報空でよし
|
|
64
|
+
}
|
|
60
65
|
}
|
|
61
66
|
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
};
|
|
68
|
+
}),
|
|
69
|
+
seller: { id: '59d20831e53ebc2b4e774466' }
|
|
70
|
+
}
|
|
66
71
|
});
|
|
67
|
-
console.log('movie ticket:',
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
throw new Error('認証結果は必ず存在します');
|
|
71
|
-
}
|
|
72
|
+
console.log('movie ticket:', checkMovieTicketResult.movieTickets);
|
|
73
|
+
console.log(checkMovieTicketResult.movieTickets.length, 'movieTickets found');
|
|
74
|
+
console.log('purchaseNumberAuthResult:', checkMovieTicketResult.purchaseNumberAuthResult);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
main()
|
|
@@ -259,33 +259,39 @@ async function main() {
|
|
|
259
259
|
|
|
260
260
|
// ムビチケ認証
|
|
261
261
|
const checkMovieTicketAction = await paymentService.checkMovieTicket({
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
262
|
+
object: {
|
|
263
|
+
id: 'xxx',
|
|
264
|
+
paymentMethod: {
|
|
265
|
+
typeOf: movieTickets[0].typeOf
|
|
266
|
+
},
|
|
267
|
+
movieTickets: movieTickets.map((movieTicket) => {
|
|
268
|
+
return {
|
|
269
|
+
...movieTicket,
|
|
270
|
+
project: transaction.project,
|
|
271
|
+
serviceType: '', // 情報空でよし
|
|
272
|
+
serviceOutput: {
|
|
273
|
+
reservationFor: {
|
|
274
|
+
typeOf: screeningEvent.typeOf,
|
|
275
|
+
id: screeningEvent.id
|
|
276
|
+
},
|
|
277
|
+
reservedTicket: {
|
|
278
|
+
ticketedSeat: {
|
|
279
|
+
typeOf: client.factory.chevre.placeType.Seat,
|
|
280
|
+
seatingType: '', // 情報空でよし
|
|
281
|
+
seatNumber: '', // 情報空でよし
|
|
282
|
+
seatRow: '', // 情報空でよし
|
|
283
|
+
seatSection: '' // 情報空でよし
|
|
284
|
+
}
|
|
280
285
|
}
|
|
281
286
|
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
287
|
+
};
|
|
288
|
+
}),
|
|
289
|
+
seller: { id: String(transaction.seller.id) }
|
|
290
|
+
|
|
291
|
+
}
|
|
286
292
|
});
|
|
287
293
|
console.log('movie ticket:', checkMovieTicketAction);
|
|
288
|
-
const checkMovieTicketActionResult = checkMovieTicketAction
|
|
294
|
+
const checkMovieTicketActionResult = checkMovieTicketAction;
|
|
289
295
|
if (checkMovieTicketActionResult === undefined) {
|
|
290
296
|
throw new Error('認証結果は必ず存在します');
|
|
291
297
|
}
|
|
@@ -118,33 +118,38 @@ async function main() {
|
|
|
118
118
|
|
|
119
119
|
// ムビチケ認証
|
|
120
120
|
const checkMovieTicketAction = await paymentService.checkMovieTicket({
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
121
|
+
object: {
|
|
122
|
+
id: 'xxx',
|
|
123
|
+
paymentMethod: {
|
|
124
|
+
typeOf: movieTickets[0].typeOf
|
|
125
|
+
},
|
|
126
|
+
movieTickets: movieTickets.map((movieTicket) => {
|
|
127
|
+
return {
|
|
128
|
+
...movieTicket,
|
|
129
|
+
project: transaction.project,
|
|
130
|
+
serviceType: '', // 情報空でよし
|
|
131
|
+
serviceOutput: {
|
|
132
|
+
reservationFor: {
|
|
133
|
+
typeOf: client.factory.eventType.ScreeningEvent,
|
|
134
|
+
id: screeningEvent.id
|
|
135
|
+
},
|
|
136
|
+
reservedTicket: {
|
|
137
|
+
ticketedSeat: {
|
|
138
|
+
typeOf: client.factory.chevre.placeType.Seat,
|
|
139
|
+
seatingType: '', // 情報空でよし
|
|
140
|
+
seatNumber: '', // 情報空でよし
|
|
141
|
+
seatRow: '', // 情報空でよし
|
|
142
|
+
seatSection: '' // 情報空でよし
|
|
143
|
+
}
|
|
139
144
|
}
|
|
140
145
|
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
146
|
+
};
|
|
147
|
+
}),
|
|
148
|
+
seller: { id: String(transaction.seller.id) }
|
|
149
|
+
}
|
|
145
150
|
});
|
|
146
151
|
console.log('movie ticket:', checkMovieTicketAction);
|
|
147
|
-
const checkMovieTicketActionResult = checkMovieTicketAction
|
|
152
|
+
const checkMovieTicketActionResult = checkMovieTicketAction;
|
|
148
153
|
if (checkMovieTicketActionResult === undefined) {
|
|
149
154
|
throw new Error('認証結果は必ず存在します');
|
|
150
155
|
}
|
package/lib/bundle.js
CHANGED
|
@@ -13531,25 +13531,6 @@ var OrderService = /** @class */ (function (_super) {
|
|
|
13531
13531
|
});
|
|
13532
13532
|
});
|
|
13533
13533
|
};
|
|
13534
|
-
/**
|
|
13535
|
-
* 注文に対するアクションを検索する
|
|
13536
|
-
*/
|
|
13537
|
-
OrderService.prototype.searchActionsByOrderNumber = function (params) {
|
|
13538
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
13539
|
-
var _this = this;
|
|
13540
|
-
return __generator(this, function (_a) {
|
|
13541
|
-
return [2 /*return*/, this.fetch({
|
|
13542
|
-
uri: "/orders/" + params.orderNumber + "/actions",
|
|
13543
|
-
method: 'GET',
|
|
13544
|
-
qs: params,
|
|
13545
|
-
expectedStatusCodes: [http_status_1.OK]
|
|
13546
|
-
})
|
|
13547
|
-
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
13548
|
-
return [2 /*return*/, response.json()];
|
|
13549
|
-
}); }); })];
|
|
13550
|
-
});
|
|
13551
|
-
});
|
|
13552
|
-
};
|
|
13553
13534
|
/**
|
|
13554
13535
|
* 注文取得
|
|
13555
13536
|
*/
|
|
@@ -13844,7 +13825,7 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
13844
13825
|
});
|
|
13845
13826
|
};
|
|
13846
13827
|
/**
|
|
13847
|
-
*
|
|
13828
|
+
* MovieTicket決済承認
|
|
13848
13829
|
*/
|
|
13849
13830
|
PaymentService.prototype.authorizeMovieTicket = function (params) {
|
|
13850
13831
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -13901,7 +13882,7 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
13901
13882
|
});
|
|
13902
13883
|
};
|
|
13903
13884
|
/**
|
|
13904
|
-
*
|
|
13885
|
+
* MovieTicket認証
|
|
13905
13886
|
*/
|
|
13906
13887
|
PaymentService.prototype.checkMovieTicket = function (
|
|
13907
13888
|
// params: factory.action.check.paymentMethod.movieTicket.IObject
|
|
@@ -13910,9 +13891,9 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
13910
13891
|
var _this = this;
|
|
13911
13892
|
return __generator(this, function (_a) {
|
|
13912
13893
|
return [2 /*return*/, this.fetch({
|
|
13913
|
-
uri: "/payment/" + factory.service.paymentService.PaymentServiceType.MovieTicket + "/
|
|
13894
|
+
uri: "/payment/" + factory.service.paymentService.PaymentServiceType.MovieTicket + "/check",
|
|
13914
13895
|
method: 'POST',
|
|
13915
|
-
expectedStatusCodes: [http_status_1.
|
|
13896
|
+
expectedStatusCodes: [http_status_1.OK],
|
|
13916
13897
|
body: params
|
|
13917
13898
|
})
|
|
13918
13899
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cinerino/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.51.0",
|
|
4
4
|
"description": "Cinerino SDK",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"browser": {
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"watchify": "^3.11.1"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@cinerino/api-abstract-client": "3.
|
|
100
|
+
"@cinerino/api-abstract-client": "3.51.0",
|
|
101
101
|
"debug": "^3.2.6",
|
|
102
102
|
"http-status": "^1.4.2",
|
|
103
103
|
"idtoken-verifier": "^2.0.3",
|