Skip to content

Commit

Permalink
Updated package version and refactored constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGL committed Sep 7, 2024
1 parent 6bb04f9 commit c9388c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 5 additions & 4 deletions src/payments/directbilling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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',
},
});
Expand Down
12 changes: 5 additions & 7 deletions src/payments/sms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
});
Expand Down

0 comments on commit c9388c0

Please sign in to comment.