From c9388c024042d96e106cd3277adf76ebabd90663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wi=C4=99cek?= Date: Sat, 7 Sep 2024 19:49:17 +0200 Subject: [PATCH] Updated package version and refactored constructors --- package.json | 2 +- src/payments/directbilling.ts | 9 +++++---- src/payments/sms.ts | 12 +++++------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 4b78812..e6c04e0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "simpay-typescript-api", "author": "Rafał Więcek", - "version": "3.0.1", + "version": "3.0.2", "description": "SimPay.pl API wrapper", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/payments/directbilling.ts b/src/payments/directbilling.ts index 67ab461..ca7921a 100644 --- a/src/payments/directbilling.ts +++ b/src/payments/directbilling.ts @@ -11,11 +11,12 @@ import type { PartialDbTransaction } from '../models/directbilling/transaction/p import type { PaginatedResponse } from '../models/response/paginated.response.js'; export class DirectBilling { - private readonly key: string; - private readonly password: string; private readonly client: AxiosInstance; - constructor(key: string, password: string) { + constructor( + private readonly key: string, + private readonly password: string, + ) { this.key = key; this.password = password; @@ -24,7 +25,7 @@ export class DirectBilling { headers: { 'X-SIM-KEY': this.key, 'X-SIM-PASSWORD': this.password, - 'X-SIM-VERSION': '2.2.2', + 'X-SIM-VERSION': '3.0.2', 'X-SIM-PLATFORM': 'TYPESCRIPT', }, }); diff --git a/src/payments/sms.ts b/src/payments/sms.ts index df0ace0..cbb2e2a 100644 --- a/src/payments/sms.ts +++ b/src/payments/sms.ts @@ -6,20 +6,18 @@ import type { SmsTransaction } from '../models/sms/transaction/sms.transaction.j import type { VerificationResponse } from '../models/sms/verification.response.js'; export class Sms { - private readonly key: string; - private readonly password: string; private readonly client: AxiosInstance; - constructor(key: string, password: string) { - this.key = key; - this.password = password; - + constructor( + private readonly key: string, + private readonly password: string, + ) { this.client = axios.create({ baseURL: 'https://api.simpay.pl/sms', headers: { 'X-SIM-KEY': this.key, 'X-SIM-PASSWORD': this.password, - 'X-SIM-VERSION': '2.2.2', + 'X-SIM-VERSION': '3.0.2', 'X-SIM-PLATFORM': 'TYPESCRIPT', }, });