btrz-api-client 9.31.0 → 9.32.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.
@@ -57,12 +57,13 @@ function stripeTerminalsFactory({
57
57
  }
58
58
 
59
59
  /**
60
- * POST /stripe-terminals/:terminalId/simulate - simulate a payment on a Stripe Terminal reader. API does not accept query params.
60
+ * POST /stripe-terminals/:terminalId/simulate - simulate a payment on a Stripe Terminal reader.
61
61
  * @param {Object} opts
62
62
  * @param {string} [opts.token] - API key
63
63
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
64
64
  * @param {string} opts.id - Terminal ID (Stripe reader id, e.g. tmr_xxx)
65
65
  * @param {{ ccNumber: string }} opts.stripePayment - Payment to simulate; ccNumber required
66
+ * @param {StripeTerminalsListQuery} [opts.query] - Optional providerId for agencies/sellers
66
67
  * @param {Object} [opts.headers] - Optional headers
67
68
  * @returns {Promise<import("axios").AxiosResponse<{ stripeTerminalPayment: Object }>>}
68
69
  * Rejects with 400 (WRONG_DATA), 401,
@@ -74,6 +75,7 @@ function stripeTerminalsFactory({
74
75
  jwtToken,
75
76
  id,
76
77
  stripePayment,
78
+ query = {},
77
79
  headers
78
80
  }) {
79
81
  return client({
@@ -85,6 +87,7 @@ function stripeTerminalsFactory({
85
87
  internalAuthTokenProvider,
86
88
  headers
87
89
  }),
90
+ params: query,
88
91
  data: {
89
92
  stripePayment
90
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "9.31.0",
3
+ "version": "9.32.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -46,23 +46,25 @@ function stripeTerminalsFactory({client, internalAuthTokenProvider}) {
46
46
  }
47
47
 
48
48
  /**
49
- * POST /stripe-terminals/:terminalId/simulate - simulate a payment on a Stripe Terminal reader. API does not accept query params.
49
+ * POST /stripe-terminals/:terminalId/simulate - simulate a payment on a Stripe Terminal reader.
50
50
  * @param {Object} opts
51
51
  * @param {string} [opts.token] - API key
52
52
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
53
53
  * @param {string} opts.id - Terminal ID (Stripe reader id, e.g. tmr_xxx)
54
54
  * @param {{ ccNumber: string }} opts.stripePayment - Payment to simulate; ccNumber required
55
+ * @param {StripeTerminalsListQuery} [opts.query] - Optional providerId for agencies/sellers
55
56
  * @param {Object} [opts.headers] - Optional headers
56
57
  * @returns {Promise<import("axios").AxiosResponse<{ stripeTerminalPayment: Object }>>}
57
58
  * Rejects with 400 (WRONG_DATA), 401,
58
59
  * 404 (PAYMENT_METHOD_NOT_FOUND, TRANSACTION_NOT_FOUND),
59
60
  * 409 (errorCode/errorMessage), 500.
60
61
  */
61
- function simulate({token, jwtToken, id, stripePayment, headers}) {
62
+ function simulate({token, jwtToken, id, stripePayment, query = {}, headers}) {
62
63
  return client({
63
64
  url: `/stripe-terminals/${id}/simulate`,
64
65
  method: "post",
65
66
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
67
+ params: query,
66
68
  data: {stripePayment}
67
69
  });
68
70
  }
@@ -30,13 +30,14 @@ describe("btrzpay/stripe-terminals", () => {
30
30
  const terminalId = "tm_123";
31
31
  const body = {stripePayment};
32
32
  axiosMock.onPost(`/stripe-terminals/${terminalId}/simulate`, body).reply(expectRequest({
33
- statusCode: 200, token, jwtToken
33
+ statusCode: 200, token, jwtToken, query
34
34
  }));
35
35
  return api.btrzpay.stripeTerminals.simulate({
36
36
  id: terminalId,
37
37
  token,
38
38
  jwtToken,
39
- stripePayment
39
+ stripePayment,
40
+ query
40
41
  });
41
42
  });
42
43
  });