Skip to content

Commit

Permalink
SkillHost payments
Browse files Browse the repository at this point in the history
  • Loading branch information
WiktorDev committed May 18, 2023
1 parent d2929c4 commit c8ec6dc
Show file tree
Hide file tree
Showing 52 changed files with 231 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .idea/discord.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "1.1.2",
"description": "Payments lib",
"private": false,
"files": ["./**"],
"files": [
"./**"
],
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
Expand All @@ -19,7 +21,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@types/node": "^18.11.9",
"@types/node": "^18.16.12",
"typescript": "^4.9.3"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/BasePayment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios, {AxiosBasicCredentials, AxiosRequestConfig, AxiosResponse} from "axios";
const project = require('../package.json')

export type HTTP_METHODS = "GET"|"POST"|"PUT"|"DELETE"

Expand All @@ -8,7 +9,7 @@ export abstract class BasePayment {
method: method,
url: url,
headers: {
'User-Agent': 'node-payments-lib/3.0'
'User-Agent': `node-payments-lib/${project.version}`
},
data: data,
maxRedirects: 0,
Expand Down
5 changes: 0 additions & 5 deletions src/Payment.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/global.config.ts

This file was deleted.

45 changes: 22 additions & 23 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
import {IcehostPayment} from "./online/icehost/icehost.payment";

export {DpayDirectbillingPayment} from "./online/dpay/directbilling/dpay.directbilling.payment";
export {MicrosmsPayment} from "./online/microsms/microsms.payment";
export {PaybylinkPayment} from "./online/paybylink/paybylink.payment";
export {PaybylinkPaysafecardPayment} from "./online/paybylink/paysafecard/paybylinkPaysafecard.payment";
export {PaybylinkDirectbillingPayment} from "./online/paybylink/directbilling/paybylink.directbilling.payment";
export {Przelewy24Payment} from "./online/przelewy24/przelewy24.payment";
export {SimpayDirectbillingPayment} from "./online/simpay/simpayDirectbilling.payment";
export {DpayPayment} from "./online/dpay/dpay.payment";
export {DotpayPayment} from "./online/dotpay/dotpay.payment";
export {CashbillPayment} from "./online/cashbill/cashbill.payment";
export {HotpayPayment} from './online/hotpay/hotpay.payment'
export {HotpayMobilePayment} from "./online/hotpay/mobile/hotpay.mobile.payment";
export {IcehostPayment} from './online/icehost/icehost.payment'
export {PaypalPayment} from './online/paypal/paypal.payment'
export {Host2PlayPayment} from './online/host2play/host2play.payment'
export {DpayDirectbillingPayment} from "./payments/online/dpay/directbilling/dpay.directbilling.payment";
export {MicrosmsPayment} from "./payments/online/microsms/microsms.payment";
export {PaybylinkPayment} from "./payments/online/paybylink/paybylink.payment";
export {PaybylinkPaysafecardPayment} from "./payments/online/paybylink/paysafecard/paybylinkPaysafecard.payment";
export {PaybylinkDirectbillingPayment} from "./payments/online/paybylink/directbilling/paybylink.directbilling.payment";
export {Przelewy24Payment} from "./payments/online/przelewy24/przelewy24.payment";
export {SimpayDirectbillingPayment} from "./payments/online/simpay/simpayDirectbilling.payment";
export {DpayPayment} from "./payments/online/dpay/dpay.payment";
export {DotpayPayment} from "./payments/online/dotpay/dotpay.payment";
export {CashbillPayment} from "./payments/online/cashbill/cashbill.payment";
export {HotpayPayment} from './payments/online/hotpay/hotpay.payment'
export {HotpayMobilePayment} from "./payments/online/hotpay/mobile/hotpay.mobile.payment";
export {IcehostPayment} from './payments/wallets/icehost/icehost.payment'
export {PaypalPayment} from './payments/wallets/paypal/paypal.payment'
export {Host2PlayPayment} from './payments/wallets/host2play/host2play.payment'
export {SkillHostPayment} from './payments/wallets/skillhost/skillhost.payment'
/**
* SMS
*/
export {CashbillSms} from "./sms/cashbill.sms";
export {GetpaySms} from "./sms/getpay.sms";
export {HotpaySms} from "./sms/hotpay.sms";
export {MicrosmsSms} from "./sms/microsms.sms";
export {PaybylinkSms} from "./sms/paybylink.sms";
export {SimpaySms} from "./sms/simpay.sms";
export {CashbillSms} from "./payments/sms/cashbill.sms";
export {GetpaySms} from "./payments/sms/getpay.sms";
export {HotpaySms} from "./payments/sms/hotpay.sms";
export {MicrosmsSms} from "./payments/sms/microsms.sms";
export {PaybylinkSms} from "./payments/sms/paybylink.sms";
export {SimpaySms} from "./payments/sms/simpay.sms";
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {BasePayment} from "../../BasePayment";
import {BasePayment} from "../../../BasePayment";
import {CashbillParams} from "./cashbill.params";
import {PaymentException} from "../../exceptions/payment.exception";
import {PaymentGeneratedEntity} from "../../entities/paymentGenerated.entity";
import {hash} from "../../utils/crypto.function";
import {HashingMethodsEnum} from "../../enums/HashingMethodsEnum";
import {PaymentException} from "../../../exceptions/payment.exception";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";
import {hash} from "../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {CashbillTransactionEntity} from "./entity/cashbill.transaction.entity";
import {CashbillPaymentChannelsEntity} from "./entity/cashbill.paymentChannels.entity";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {BasePayment} from "../../BasePayment";
import {BasePayment} from "../../../BasePayment";
import {DotpayParams} from "./dotpay.params";
import {validateObject} from "../../utils/validate.function";
import {PaymentGeneratedEntity} from "../../entities/paymentGenerated.entity";
import {objectToQueryString} from "../../utils/objectToQueryString.function";
import {hash, hmac} from "../../utils/crypto.function";
import {HashingMethodsEnum} from "../../enums/HashingMethodsEnum";
import {validateObject} from "../../../utils/validate.function";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";
import {objectToQueryString} from "../../../utils/objectToQueryString.function";
import {hash, hmac} from "../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {DotpayUrlcEntity} from "./entities/dotpayUrlc.entity";

export class DotpayPayment extends BasePayment {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {BasePayment} from "../../../BasePayment";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";
import {validateObject} from "../../../utils/validate.function";
import {BasePayment} from "../../../../BasePayment";
import {PaymentGeneratedEntity} from "../../../../entities/paymentGenerated.entity";
import {validateObject} from "../../../../utils/validate.function";
import {DpayDirectbillingParams} from "./dpay.directbilling.params";
import {hash} from "../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {hash} from "../../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../../enums/HashingMethodsEnum";
import {DpayParams} from "../dpay.params";
import {PaymentException} from "../../../exceptions/payment.exception";
import {PaymentException} from "../../../../exceptions/payment.exception";

export class DpayDirectbillingPayment extends BasePayment {
private guid: string;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {BasePayment} from "../../BasePayment";
import {BasePayment} from "../../../BasePayment";
import {DpayParams} from "./dpay.params";
import {PaymentGeneratedEntity} from "../../entities/paymentGenerated.entity";
import {PaymentException} from "../../exceptions/payment.exception";
import {validateObject} from "../../utils/validate.function";
import {hash} from "../../utils/crypto.function";
import {HashingMethodsEnum} from "../../enums/HashingMethodsEnum";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";
import {PaymentException} from "../../../exceptions/payment.exception";
import {validateObject} from "../../../utils/validate.function";
import {hash} from "../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {DpayTransactionEntity} from "./entities/dpay.transaction.entity";

export class DpayPayment extends BasePayment {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {BasePayment} from "../../BasePayment";
import {BasePayment} from "../../../BasePayment";
import {HotpayParams} from "./hotpay.params";
import {validateObject} from "../../utils/validate.function";
import {validateObject} from "../../../utils/validate.function";
import * as querystring from "querystring";
import {hash} from "../../utils/crypto.function";
import {HashingMethodsEnum} from "../../enums/HashingMethodsEnum";
import {isJson} from "../../utils/isJson.function";
import {PaymentException} from "../../exceptions/payment.exception";
import {PaymentGeneratedEntity} from "../../entities/paymentGenerated.entity";
import {hash} from "../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {isJson} from "../../../utils/isJson.function";
import {PaymentException} from "../../../exceptions/payment.exception";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";

export class HotpayPayment extends BasePayment {
private secret: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {BasePayment} from "../../../BasePayment";
import {BasePayment} from "../../../../BasePayment";
import {HotpayMobileParams} from "./hotpay.mobile.params";
import {validateObject} from "../../../utils/validate.function";
import {objectToQueryString} from "../../../utils/objectToQueryString.function";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";
import {hash} from "../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {validateObject} from "../../../../utils/validate.function";
import {objectToQueryString} from "../../../../utils/objectToQueryString.function";
import {PaymentGeneratedEntity} from "../../../../entities/paymentGenerated.entity";
import {hash} from "../../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../../enums/HashingMethodsEnum";

export class HotpayMobilePayment extends BasePayment {
private readonly apiUrl: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {hash} from "../../utils/crypto.function";
import {hash} from "../../../utils/crypto.function";

export class MicrosmsParams {
amount: number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {BasePayment} from "../../BasePayment";
import {HashingMethodsEnum} from "../../enums/HashingMethodsEnum";
import {BasePayment} from "../../../BasePayment";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {MicrosmsParams} from "./microsms.params";
import {PaymentGeneratedEntity} from "../../entities/paymentGenerated.entity";
import {objectToQueryString} from "../../utils/objectToQueryString.function";
import {PaymentException} from "../../exceptions/payment.exception";
import {hash} from "../../utils/crypto.function";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";
import {objectToQueryString} from "../../../utils/objectToQueryString.function";
import {PaymentException} from "../../../exceptions/payment.exception";
import {hash} from "../../../utils/crypto.function";
import axios from "axios";

export class MicrosmsPayment extends BasePayment {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {BasePayment} from "../../../BasePayment";
import {BasePayment} from "../../../../BasePayment";
import {PaybylinkDirectbillingParams} from "./paybylink.directbilling.params";
import {validateObject} from "../../../utils/validate.function";
import {PaymentException} from "../../../exceptions/payment.exception";
import {hash} from "../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";
import {validateObject} from "../../../../utils/validate.function";
import {PaymentException} from "../../../../exceptions/payment.exception";
import {hash} from "../../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../../enums/HashingMethodsEnum";
import {PaymentGeneratedEntity} from "../../../../entities/paymentGenerated.entity";
import {PaybylinkDirectbillingTransactionEntity} from "./entities/paybylink.directbilling.transaction.entity";

export class PaybylinkDirectbillingPayment extends BasePayment {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {BasePayment} from "../../BasePayment";
import {BasePayment} from "../../../BasePayment";
import {PaybylinkParams} from "./paybylink.params";
import {validateObject} from "../../utils/validate.function";
import {PaymentException} from "../../exceptions/payment.exception";
import {HashingMethodsEnum} from "../../enums/HashingMethodsEnum";
import {hash} from "../../utils/crypto.function";
import {PaymentGeneratedEntity} from "../../entities/paymentGenerated.entity";
import {validateObject} from "../../../utils/validate.function";
import {PaymentException} from "../../../exceptions/payment.exception";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {hash} from "../../../utils/crypto.function";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";
import {isNull} from "util";

export class PaybylinkPayment extends BasePayment {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {BasePayment} from "../../../BasePayment";
import {BasePayment} from "../../../../BasePayment";
import {PaybylinkPaysafecardParams} from "./paybylinkPaysafecard.params";
import {validateObject} from "../../../utils/validate.function";
import {hash} from "../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {validateObject} from "../../../../utils/validate.function";
import {hash} from "../../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../../enums/HashingMethodsEnum";
import * as querystring from "querystring";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";
import {isJson} from "../../../utils/isJson.function";
import {PaymentException} from "../../../exceptions/payment.exception";
import {PaymentGeneratedEntity} from "../../../../entities/paymentGenerated.entity";
import {isJson} from "../../../../utils/isJson.function";
import {PaymentException} from "../../../../exceptions/payment.exception";

export class PaybylinkPaysafecardPayment extends BasePayment {
public params: PaybylinkPaysafecardParams
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import {BasePayment} from "../../BasePayment";
import {BasePayment} from "../../../BasePayment";
import {Przelewy24Params} from "./przelewy24.params";
import {PaymentGeneratedEntity} from "../../entities/paymentGenerated.entity";
import {hash} from "../../utils/crypto.function";
import {HashingMethodsEnum} from "../../enums/HashingMethodsEnum";
import {PaymentException} from "../../exceptions/payment.exception";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";
import {hash} from "../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {PaymentException} from "../../../exceptions/payment.exception";
import * as querystring from "querystring";
import {Przelewy24PaymentChannelsEntity} from "./entities/przelewy24.paymentChannels.entity";

export class Przelewy24Payment extends BasePayment {
private merchantId: number
private posId: number
private crc: string
private raportKey: string
private apiUrl: string
private paymentPageUrl: string
private readonly merchantId: number
private readonly posId: number
private readonly crc: string
private readonly raportKey: string
private readonly apiUrl: string
private readonly paymentPageUrl: string
public params: Przelewy24Params

constructor(merchantId: number, posId: number, crc: string, raportKey: string, sandboxMode: boolean = false) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {BasePayment} from "../../BasePayment";
import {BasePayment} from "../../../BasePayment";
import {SimpayDirectbillingParams} from "./simpayDirectbilling.params";
import {validateObject} from "../../utils/validate.function";
import {hash} from "../../utils/crypto.function";
import {HashingMethodsEnum} from "../../enums/HashingMethodsEnum";
import {PaymentException} from "../../exceptions/payment.exception";
import {PaymentGeneratedEntity} from "../../entities/paymentGenerated.entity";
import {validateObject} from "../../../utils/validate.function";
import {hash} from "../../../utils/crypto.function";
import {HashingMethodsEnum} from "../../../enums/HashingMethodsEnum";
import {PaymentException} from "../../../exceptions/payment.exception";
import {PaymentGeneratedEntity} from "../../../entities/paymentGenerated.entity";

export class SimpayDirectbillingPayment extends BasePayment {
private readonly apikey: string
Expand Down
6 changes: 3 additions & 3 deletions src/sms/cashbill.sms.ts → src/payments/sms/cashbill.sms.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {BasePayment} from "../BasePayment";
import {InvalidSmsCodeException} from "../exceptions/invalidSmsCode.exception";
import {UsedSmsCodeException} from "../exceptions/usedSmsCode.exception";
import {BasePayment} from "../../BasePayment";
import {InvalidSmsCodeException} from "../../exceptions/invalidSmsCode.exception";
import {UsedSmsCodeException} from "../../exceptions/usedSmsCode.exception";

export class CashbillSms extends BasePayment {
private readonly token: string
Expand Down
8 changes: 4 additions & 4 deletions src/sms/getpay.sms.ts → src/payments/sms/getpay.sms.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {BasePayment} from "../BasePayment";
import {PaymentException} from "../exceptions/payment.exception";
import {InvalidSmsCodeException} from "../exceptions/invalidSmsCode.exception";
import {UsedSmsCodeException} from "../exceptions/usedSmsCode.exception";
import {BasePayment} from "../../BasePayment";
import {PaymentException} from "../../exceptions/payment.exception";
import {InvalidSmsCodeException} from "../../exceptions/invalidSmsCode.exception";
import {UsedSmsCodeException} from "../../exceptions/usedSmsCode.exception";

export class GetpaySms extends BasePayment {
private readonly apiKey: string
Expand Down
10 changes: 5 additions & 5 deletions src/sms/hotpay.sms.ts → src/payments/sms/hotpay.sms.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {BasePayment} from "../BasePayment";
import {objectToQueryString} from "../utils/objectToQueryString.function";
import {PaymentException} from "../exceptions/payment.exception";
import {InvalidSmsCodeException} from "../exceptions/invalidSmsCode.exception";
import {UsedSmsCodeException} from "../exceptions/usedSmsCode.exception";
import {BasePayment} from "../../BasePayment";
import {objectToQueryString} from "../../utils/objectToQueryString.function";
import {PaymentException} from "../../exceptions/payment.exception";
import {InvalidSmsCodeException} from "../../exceptions/invalidSmsCode.exception";
import {UsedSmsCodeException} from "../../exceptions/usedSmsCode.exception";

export class HotpaySms extends BasePayment {
private readonly secret: string
Expand Down
10 changes: 5 additions & 5 deletions src/sms/microsms.sms.ts → src/payments/sms/microsms.sms.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {BasePayment} from "../BasePayment";
import {objectToQueryString} from "../utils/objectToQueryString.function";
import {PaymentException} from "../exceptions/payment.exception";
import {InvalidSmsCodeException} from "../exceptions/invalidSmsCode.exception";
import {UsedSmsCodeException} from "../exceptions/usedSmsCode.exception";
import {BasePayment} from "../../BasePayment";
import {objectToQueryString} from "../../utils/objectToQueryString.function";
import {PaymentException} from "../../exceptions/payment.exception";
import {InvalidSmsCodeException} from "../../exceptions/invalidSmsCode.exception";
import {UsedSmsCodeException} from "../../exceptions/usedSmsCode.exception";

export class MicrosmsSms extends BasePayment{
private readonly userId: number;
Expand Down
Loading

0 comments on commit c8ec6dc

Please sign in to comment.