shipy-sdk-js
Version:
Shipy Payment Gateway SDK for JavaScript/TypeScript
31 lines (30 loc) • 991 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Shipy = void 0;
const FetchHttpClient_1 = require("./FetchHttpClient");
const CreditCard_1 = require("../services/CreditCard");
const Mobile_1 = require("../services/Mobile");
class Shipy {
constructor(apiKey, httpClient) {
this._creditCard = null;
this._mobile = null;
if (!apiKey) {
throw new Error('API key is required');
}
this.apiKey = apiKey;
this.httpClient = httpClient || new FetchHttpClient_1.FetchHttpClient('https://api.shipy.dev');
}
get creditCard() {
if (!this._creditCard) {
this._creditCard = new CreditCard_1.CreditCard(this.apiKey, this.httpClient);
}
return this._creditCard;
}
get mobile() {
if (!this._mobile) {
this._mobile = new Mobile_1.Mobile(this.apiKey, this.httpClient);
}
return this._mobile;
}
}
exports.Shipy = Shipy;