@uveysservetoglu/kobil-payment 3.0.0 → 3.0.1

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 CHANGED
@@ -14,14 +14,14 @@ import { PaymentClient, paymentGroup } from "@uveysservetoglu/kobil-payment";
14
14
 
15
15
  // OIDC_ISSUER, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET and PAYMENT_MERCHANT_ID come from the environment.
16
16
  const payment = new PaymentClient({
17
- defaultCurrency: "TRY",
17
+ defaultCurrency: "EUR",
18
18
  defaultMerchantCallback: "https://yourapi.com/payment-callback",
19
19
  });
20
20
  ```
21
21
 
22
- > **Amounts** are in the smallest currency unit (`1300` = 13.00 TRY) and **timeouts** in minutes, in
22
+ > **Amounts** are in the smallest currency unit (`1300` = 13.00 EUR) and **timeouts** in minutes, in
23
23
  > both API modes. Miniapp mode sends the amount as the API's decimal string (`{ value: "13.00",
24
- > currency: "TRY" }`, decimals per ISO 4217 — see `formatMinorUnits`) and the timeout as
24
+ > currency: "EUR" }`, decimals per ISO 4217 — see `formatMinorUnits`) and the timeout as
25
25
  > `timeoutSeconds` (600–3600; omit it for the API's 15-minute default).
26
26
 
27
27
  ## API mode
package/dist/amount.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  export declare function currencyExponent(currency: string): number;
3
3
  /**
4
4
  * Renders an amount in the smallest currency unit as the MiniApp API's decimal string, with exactly the
5
- * currency's number of decimals: `formatMinorUnits(1300, "TRY") === "13.00"`, `(1300, "JPY") === "1300"`.
5
+ * currency's number of decimals: `formatMinorUnits(1300, "EUR") === "13.00"`, `(1300, "JPY") === "1300"`.
6
6
  *
7
7
  * The SDK takes minor units in both API modes so code does not change with the mode; this is the
8
8
  * conversion the miniapp mode applies. Integer arithmetic on the digits — no floating point.
package/dist/amount.js CHANGED
@@ -5,7 +5,7 @@ exports.formatMinorUnits = formatMinorUnits;
5
5
  const error_1 = require("./error");
6
6
  /**
7
7
  * ISO 4217 minor-unit exponents that differ from the usual 2. Every currency not listed has two decimal
8
- * places (TRY, EUR, USD, GBP, …).
8
+ * places (EUR, USD, GBP, …).
9
9
  */
10
10
  const EXPONENTS = {
11
11
  BIF: 0, CLP: 0, DJF: 0, GNF: 0, ISK: 0, JPY: 0, KMF: 0, KRW: 0, PYG: 0, RWF: 0,
@@ -19,7 +19,7 @@ function currencyExponent(currency) {
19
19
  }
20
20
  /**
21
21
  * Renders an amount in the smallest currency unit as the MiniApp API's decimal string, with exactly the
22
- * currency's number of decimals: `formatMinorUnits(1300, "TRY") === "13.00"`, `(1300, "JPY") === "1300"`.
22
+ * currency's number of decimals: `formatMinorUnits(1300, "EUR") === "13.00"`, `(1300, "JPY") === "1300"`.
23
23
  *
24
24
  * The SDK takes minor units in both API modes so code does not change with the mode; this is the
25
25
  * conversion the miniapp mode applies. Integer arithmetic on the digits — no floating point.
package/dist/client.d.ts CHANGED
@@ -17,7 +17,7 @@ export interface PaymentClientOptions extends Partial<KobilCredentials>, KobilAp
17
17
  merchantName?: string;
18
18
  /** Legacy mode: payment tenant — a different tenant from mPower's. Falls back to `PAYMENT_TENANT_ID`. */
19
19
  tenantId?: string;
20
- /** Default ISO currency code. Default: "TRY". */
20
+ /** Default ISO currency code. Default: "EUR". */
21
21
  defaultCurrency?: string;
22
22
  /** Default result callback. Every miniapp-mode operation needs one (here or per request). */
23
23
  defaultMerchantCallback?: string;
package/dist/client.js CHANGED
@@ -67,7 +67,7 @@ class PaymentClient extends kobil_core_1.KobilServiceClient {
67
67
  this.merchantIdOption = options.merchantId ?? process.env.PAYMENT_MERCHANT_ID;
68
68
  this.merchantServiceUuidOption = options.merchantServiceUuid;
69
69
  this.tenantId = options.tenantId ?? process.env.PAYMENT_TENANT_ID;
70
- this.defaultCurrency = options.defaultCurrency ?? "TRY";
70
+ this.defaultCurrency = options.defaultCurrency ?? "EUR";
71
71
  this.defaultMerchantCallback = options.defaultMerchantCallback;
72
72
  this.defaultTimeoutOption = options.defaultTransactionTimeoutMinutes;
73
73
  this.version = options.version ?? 1;
package/dist/types.d.ts CHANGED
@@ -8,7 +8,7 @@ export interface PaymentContentItem {
8
8
  export type PaymentContent = PaymentContentItem[][];
9
9
  export interface CreateTransactionInput {
10
10
  userId: string;
11
- /** Amount in the smallest currency unit (e.g. 1300 = 13.00 TRY), in both API modes. */
11
+ /** Amount in the smallest currency unit (e.g. 1300 = 13.00 EUR), in both API modes. */
12
12
  amount: number;
13
13
  currency?: string;
14
14
  /** Result callback. Required in miniapp mode (here or as `defaultMerchantCallback`). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uveysservetoglu/kobil-payment",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "KOBIL Pay (mpay-merchant) client for Node.js: create/pre-auth/post-auth, status, cancel and refund transactions with automatic OAuth token management.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",