btrz-api-client 5.201.0 → 5.203.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/lib/client-standalone-min.js +3 -3
- package/lib/client.js +2 -0
- package/lib/endpoints/accounts/journey-prices-settings.js +43 -0
- package/lib/endpoints/btrzpay/prismaTerminals.js +42 -0
- package/package.json +1 -1
- package/src/client.js +2 -0
- package/src/endpoints/accounts/journey-prices-settings.js +30 -0
- package/src/endpoints/btrzpay/prismaTerminals.js +28 -0
- package/test/endpoints/accounts/journey-prices-settings.test.js +35 -0
- package/test/endpoints/btrzpay/prismaTerminals.tests.js +40 -0
- package/types/client.d.ts +29 -0
- package/types/endpoints/accounts/journey-prices-settings.d.ts +17 -0
- package/types/endpoints/btrzpay/prismaTerminals.d.ts +20 -0
- package/types/initializedClient.d.ts +29 -0
package/lib/client.js
CHANGED
|
@@ -204,6 +204,7 @@ function createAccounts(_ref4) {
|
|
|
204
204
|
client: client, internalAuthTokenProvider: internalAuthTokenProvider
|
|
205
205
|
}),
|
|
206
206
|
revenueManagementSettings: require("./endpoints/accounts/rms-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
207
|
+
journeyPricesSettings: require("./endpoints/accounts/journey-prices-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
207
208
|
subPrintTemplates: require("./endpoints/accounts/sub-print-templates.js")({
|
|
208
209
|
client: client, internalAuthTokenProvider: internalAuthTokenProvider
|
|
209
210
|
}),
|
|
@@ -451,6 +452,7 @@ function createBtrzPay(_ref13) {
|
|
|
451
452
|
squareWebhooks: require("./endpoints/btrzpay/square.js").squareWebhooksFactory({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
452
453
|
oxxo: require("./endpoints/btrzpay/oxxo.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
453
454
|
datalogic: require("./endpoints/btrzpay/datalogic.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
455
|
+
prismaTerminals: require("./endpoints/btrzpay/prismaTerminals.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
454
456
|
__test: {
|
|
455
457
|
client: client
|
|
456
458
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("../endpoints_helpers.js"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function journeyPricesSettingsFactory(_ref) {
|
|
7
|
+
var client = _ref.client,
|
|
8
|
+
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
+
|
|
10
|
+
function get(_ref2) {
|
|
11
|
+
var token = _ref2.token,
|
|
12
|
+
jwtToken = _ref2.jwtToken,
|
|
13
|
+
headers = _ref2.headers;
|
|
14
|
+
|
|
15
|
+
return client({
|
|
16
|
+
url: "/journey-prices-settings",
|
|
17
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function update(_ref3) {
|
|
22
|
+
var token = _ref3.token,
|
|
23
|
+
jwtToken = _ref3.jwtToken,
|
|
24
|
+
journeyPricesSettings = _ref3.journeyPricesSettings,
|
|
25
|
+
headers = _ref3.headers;
|
|
26
|
+
|
|
27
|
+
return client({
|
|
28
|
+
url: "/journey-prices-settings",
|
|
29
|
+
method: "put",
|
|
30
|
+
headers: authorizationHeaders({
|
|
31
|
+
token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers
|
|
32
|
+
}),
|
|
33
|
+
data: journeyPricesSettings
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
get: get,
|
|
39
|
+
update: update
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
module.exports = journeyPricesSettingsFactory;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("../endpoints_helpers"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function prismaTerminalsFactory(_ref) {
|
|
7
|
+
var client = _ref.client,
|
|
8
|
+
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
+
|
|
10
|
+
var payments = {
|
|
11
|
+
get: function get(_ref2) {
|
|
12
|
+
var token = _ref2.token,
|
|
13
|
+
jwtToken = _ref2.jwtToken,
|
|
14
|
+
id = _ref2.id,
|
|
15
|
+
headers = _ref2.headers;
|
|
16
|
+
|
|
17
|
+
return client.get("/prisma-terminals/payments/" + id, {
|
|
18
|
+
params: {},
|
|
19
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
create: function create(_ref3) {
|
|
23
|
+
var token = _ref3.token,
|
|
24
|
+
jwtToken = _ref3.jwtToken,
|
|
25
|
+
prismaPayment = _ref3.prismaPayment,
|
|
26
|
+
headers = _ref3.headers;
|
|
27
|
+
|
|
28
|
+
return client({
|
|
29
|
+
url: "/prisma-terminals/payments",
|
|
30
|
+
method: "post",
|
|
31
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
32
|
+
data: { prismaPayment: prismaPayment }
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
payments: payments
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
module.exports = prismaTerminalsFactory;
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -170,6 +170,7 @@ function createAccounts({baseURL, headers, timeout, overrideFn, internalAuthToke
|
|
|
170
170
|
client, internalAuthTokenProvider
|
|
171
171
|
}),
|
|
172
172
|
revenueManagementSettings: require("./endpoints/accounts/rms-settings.js")({client, internalAuthTokenProvider}),
|
|
173
|
+
journeyPricesSettings: require("./endpoints/accounts/journey-prices-settings.js")({client, internalAuthTokenProvider}),
|
|
173
174
|
subPrintTemplates: require("./endpoints/accounts/sub-print-templates.js")({
|
|
174
175
|
client, internalAuthTokenProvider
|
|
175
176
|
}),
|
|
@@ -354,6 +355,7 @@ function createBtrzPay({baseURL, headers, timeout, overrideFn, internalAuthToken
|
|
|
354
355
|
squareWebhooks: require("./endpoints/btrzpay/square.js").squareWebhooksFactory({client, internalAuthTokenProvider}),
|
|
355
356
|
oxxo: require("./endpoints/btrzpay/oxxo.js")({client, internalAuthTokenProvider}),
|
|
356
357
|
datalogic: require("./endpoints/btrzpay/datalogic.js")({client, internalAuthTokenProvider}),
|
|
358
|
+
prismaTerminals: require("./endpoints/btrzpay/prismaTerminals.js")({client, internalAuthTokenProvider}),
|
|
357
359
|
__test: {
|
|
358
360
|
client
|
|
359
361
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
function journeyPricesSettingsFactory({client, internalAuthTokenProvider}) {
|
|
6
|
+
function get({token, jwtToken, headers}) {
|
|
7
|
+
return client({
|
|
8
|
+
url: "/journey-prices-settings",
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function update({token, jwtToken, journeyPricesSettings, headers}) {
|
|
14
|
+
return client({
|
|
15
|
+
url: "/journey-prices-settings",
|
|
16
|
+
method: "put",
|
|
17
|
+
headers: authorizationHeaders({
|
|
18
|
+
token, jwtToken, internalAuthTokenProvider, headers
|
|
19
|
+
}),
|
|
20
|
+
data: journeyPricesSettings
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
get,
|
|
26
|
+
update
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = journeyPricesSettingsFactory;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("../endpoints_helpers");
|
|
4
|
+
|
|
5
|
+
function prismaTerminalsFactory({client, internalAuthTokenProvider}) {
|
|
6
|
+
const payments = {
|
|
7
|
+
get({token, jwtToken, id, headers}) {
|
|
8
|
+
return client.get(`/prisma-terminals/payments/${id}`, {
|
|
9
|
+
params: {},
|
|
10
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
create({token, jwtToken, prismaPayment, headers}) {
|
|
14
|
+
return client({
|
|
15
|
+
url: "/prisma-terminals/payments",
|
|
16
|
+
method: "post",
|
|
17
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
18
|
+
data: {prismaPayment}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
payments
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports = prismaTerminalsFactory;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const {axiosMock, expectRequest} = require("../../test-helpers.js");
|
|
2
|
+
const api = require("../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
|
|
4
|
+
describe("accounts/journey-prices", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "secret";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
axiosMock.reset();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should get the journey prices settings", () => {
|
|
13
|
+
axiosMock.onGet("/journey-prices-settings")
|
|
14
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
15
|
+
|
|
16
|
+
return api.accounts.journeyPricesSettings.get({token, jwtToken});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should update journey prices settings", () => {
|
|
20
|
+
const journeyPricesSettings = {
|
|
21
|
+
recordProtectionRules: [{attribute: "isBase", rule: "EQUALS", value: true}]
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
axiosMock.onPut("/journey-prices-settings")
|
|
25
|
+
.reply(expectRequest({
|
|
26
|
+
statusCode: 200,
|
|
27
|
+
token,
|
|
28
|
+
jwtToken
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
return api.accounts.journeyPricesSettings.update({
|
|
32
|
+
token, jwtToken, journeyPricesSettings
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const {
|
|
2
|
+
axiosMock, expectRequest
|
|
3
|
+
} = require("../../test-helpers");
|
|
4
|
+
const api = require("../../../src/client").createApiClient({
|
|
5
|
+
baseURL: "http://test.com"
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
describe("btrzpay/prisma-terminals", () => {
|
|
9
|
+
const token = "token";
|
|
10
|
+
const jwtToken = "I owe you a JWT token";
|
|
11
|
+
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
axiosMock.reset();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("should get the prisma terminal payment", () => {
|
|
17
|
+
axiosMock.onGet("/prisma-terminals/payments/1").reply(expectRequest({
|
|
18
|
+
statusCode: 200, token, jwtToken
|
|
19
|
+
}));
|
|
20
|
+
return api.btrzpay.prismaTerminals.payments.get({
|
|
21
|
+
token,
|
|
22
|
+
jwtToken,
|
|
23
|
+
id: 1
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("should create a prisma terminal payment intent", () => {
|
|
28
|
+
axiosMock.onPost("/prisma-terminals/payments").reply(expectRequest({
|
|
29
|
+
statusCode: 200, token, jwtToken
|
|
30
|
+
}));
|
|
31
|
+
return api.btrzpay.prismaTerminals.payments.create({
|
|
32
|
+
token,
|
|
33
|
+
jwtToken,
|
|
34
|
+
prismaPayment: {
|
|
35
|
+
terminalId: "1",
|
|
36
|
+
amount: "12.45"
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
package/types/client.d.ts
CHANGED
|
@@ -2280,6 +2280,19 @@ export function createApiClient(options: {
|
|
|
2280
2280
|
headers: any;
|
|
2281
2281
|
}) => any;
|
|
2282
2282
|
};
|
|
2283
|
+
journeyPricesSettings: {
|
|
2284
|
+
get: ({ token, jwtToken, headers }: {
|
|
2285
|
+
token: any;
|
|
2286
|
+
jwtToken: any;
|
|
2287
|
+
headers: any;
|
|
2288
|
+
}) => any;
|
|
2289
|
+
update: ({ token, jwtToken, journeyPricesSettings, headers }: {
|
|
2290
|
+
token: any;
|
|
2291
|
+
jwtToken: any;
|
|
2292
|
+
journeyPricesSettings: any;
|
|
2293
|
+
headers: any;
|
|
2294
|
+
}) => any;
|
|
2295
|
+
};
|
|
2283
2296
|
subPrintTemplates: {
|
|
2284
2297
|
create: ({ jwtToken, token, subPrintTemplate, headers }: {
|
|
2285
2298
|
jwtToken: any;
|
|
@@ -4322,6 +4335,22 @@ export function createApiClient(options: {
|
|
|
4322
4335
|
}): any;
|
|
4323
4336
|
};
|
|
4324
4337
|
};
|
|
4338
|
+
prismaTerminals: {
|
|
4339
|
+
payments: {
|
|
4340
|
+
get({ token, jwtToken, id, headers }: {
|
|
4341
|
+
token: any;
|
|
4342
|
+
jwtToken: any;
|
|
4343
|
+
id: any;
|
|
4344
|
+
headers: any;
|
|
4345
|
+
}): any;
|
|
4346
|
+
create({ token, jwtToken, prismaPayment, headers }: {
|
|
4347
|
+
token: any;
|
|
4348
|
+
jwtToken: any;
|
|
4349
|
+
prismaPayment: any;
|
|
4350
|
+
headers: any;
|
|
4351
|
+
}): any;
|
|
4352
|
+
};
|
|
4353
|
+
};
|
|
4325
4354
|
__test: {
|
|
4326
4355
|
client: axios.AxiosInstance;
|
|
4327
4356
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export = journeyPricesSettingsFactory;
|
|
2
|
+
declare function journeyPricesSettingsFactory({ client, internalAuthTokenProvider }: {
|
|
3
|
+
client: any;
|
|
4
|
+
internalAuthTokenProvider: any;
|
|
5
|
+
}): {
|
|
6
|
+
get: ({ token, jwtToken, headers }: {
|
|
7
|
+
token: any;
|
|
8
|
+
jwtToken: any;
|
|
9
|
+
headers: any;
|
|
10
|
+
}) => any;
|
|
11
|
+
update: ({ token, jwtToken, journeyPricesSettings, headers }: {
|
|
12
|
+
token: any;
|
|
13
|
+
jwtToken: any;
|
|
14
|
+
journeyPricesSettings: any;
|
|
15
|
+
headers: any;
|
|
16
|
+
}) => any;
|
|
17
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export = prismaTerminalsFactory;
|
|
2
|
+
declare function prismaTerminalsFactory({ client, internalAuthTokenProvider }: {
|
|
3
|
+
client: any;
|
|
4
|
+
internalAuthTokenProvider: any;
|
|
5
|
+
}): {
|
|
6
|
+
payments: {
|
|
7
|
+
get({ token, jwtToken, id, headers }: {
|
|
8
|
+
token: any;
|
|
9
|
+
jwtToken: any;
|
|
10
|
+
id: any;
|
|
11
|
+
headers: any;
|
|
12
|
+
}): any;
|
|
13
|
+
create({ token, jwtToken, prismaPayment, headers }: {
|
|
14
|
+
token: any;
|
|
15
|
+
jwtToken: any;
|
|
16
|
+
prismaPayment: any;
|
|
17
|
+
headers: any;
|
|
18
|
+
}): any;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -2234,6 +2234,19 @@ declare const _exports: {
|
|
|
2234
2234
|
headers: any;
|
|
2235
2235
|
}) => any;
|
|
2236
2236
|
};
|
|
2237
|
+
journeyPricesSettings: {
|
|
2238
|
+
get: ({ token, jwtToken, headers }: {
|
|
2239
|
+
token: any;
|
|
2240
|
+
jwtToken: any;
|
|
2241
|
+
headers: any;
|
|
2242
|
+
}) => any;
|
|
2243
|
+
update: ({ token, jwtToken, journeyPricesSettings, headers }: {
|
|
2244
|
+
token: any;
|
|
2245
|
+
jwtToken: any;
|
|
2246
|
+
journeyPricesSettings: any;
|
|
2247
|
+
headers: any;
|
|
2248
|
+
}) => any;
|
|
2249
|
+
};
|
|
2237
2250
|
subPrintTemplates: {
|
|
2238
2251
|
create: ({ jwtToken, token, subPrintTemplate, headers }: {
|
|
2239
2252
|
jwtToken: any;
|
|
@@ -4276,6 +4289,22 @@ declare const _exports: {
|
|
|
4276
4289
|
}): any;
|
|
4277
4290
|
};
|
|
4278
4291
|
};
|
|
4292
|
+
prismaTerminals: {
|
|
4293
|
+
payments: {
|
|
4294
|
+
get({ token, jwtToken, id, headers }: {
|
|
4295
|
+
token: any;
|
|
4296
|
+
jwtToken: any;
|
|
4297
|
+
id: any;
|
|
4298
|
+
headers: any;
|
|
4299
|
+
}): any;
|
|
4300
|
+
create({ token, jwtToken, prismaPayment, headers }: {
|
|
4301
|
+
token: any;
|
|
4302
|
+
jwtToken: any;
|
|
4303
|
+
prismaPayment: any;
|
|
4304
|
+
headers: any;
|
|
4305
|
+
}): any;
|
|
4306
|
+
};
|
|
4307
|
+
};
|
|
4279
4308
|
__test: {
|
|
4280
4309
|
client: import("axios").AxiosInstance;
|
|
4281
4310
|
};
|