@lskjs/billing
Version:
LSK.js module for adding billing in cabinet
116 lines (110 loc) • 4.91 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _coingateV = require("coingate-v2");
var _BillingProvider2 = _interopRequireDefault(require("../BillingProvider"));
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // npm audit error
// We have realization of this billing provider, just text us https://t.me/lskjs
var CoingateBillingProvider = /*#__PURE__*/function (_BillingProvider) {
(0, _inherits2["default"])(CoingateBillingProvider, _BillingProvider);
var _super = _createSuper(CoingateBillingProvider);
function CoingateBillingProvider() {
(0, _classCallCheck2["default"])(this, CoingateBillingProvider);
return _super.apply(this, arguments);
}
(0, _createClass2["default"])(CoingateBillingProvider, [{
key: "init",
value: function () {
var _init = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return this.init();
case 2:
if (this.config.sandbox) {
this.client = (0, _coingateV.client)(this.config.token);
} else {
this.client = (0, _coingateV.testClient)(this.config.token);
}
case 3:
case "end":
return _context.stop();
}
}, _callee, this);
}));
function init() {
return _init.apply(this, arguments);
}
return init;
}()
/**
* Docs: https://developer.coingate.com/docs/create-order
*/
}, {
key: "createOrder",
value: function createOrder() {
var _this$client;
return (_this$client = this.client).createOrder.apply(_this$client, arguments);
}
/**
* Docs: https://developer.coingate.com/docs/get-order
*/
}, {
key: "getOrder",
value: function getOrder() {
var _this$client2;
return (_this$client2 = this.client).getOrder.apply(_this$client2, arguments);
}
/**
* Docs: https://developer.coingate.com/docs/list-orders
*/
}, {
key: "listOrders",
value: function listOrders() {
var _this$client3;
return (_this$client3 = this.client).listOrders.apply(_this$client3, arguments);
}
/**
* Docs: https://developer.coingate.com/docs/get-rate
*/
}, {
key: "getExchangeRate",
value: function getExchangeRate() {
var _this$client4;
return (_this$client4 = this.client).getExchangeRate.apply(_this$client4, arguments);
}
/**
* Docs: https://developer.coingate.com/docs/list-rates
*/
}, {
key: "listExchangeRates",
value: function listExchangeRates() {
var _this$client5;
return (_this$client5 = this.client).listExchangeRates.apply(_this$client5, arguments);
}
/**
* Docs: https://developer.coingate.com/docs/ping
*/
}, {
key: "ping",
value: function ping() {
var _this$client6;
return (_this$client6 = this.client).ping.apply(_this$client6, arguments);
}
}]);
return CoingateBillingProvider;
}(_BillingProvider2["default"]);
exports["default"] = CoingateBillingProvider;
//# sourceMappingURL=CoingateBillingProvider.js.map