UNPKG

mysterium-vpn-js

Version:
59 lines (58 loc) 2.51 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PaymentAPI = void 0; class PaymentAPI { constructor(http) { this.http = http; } gateways(optionsCurrency = 'MYST') { return __awaiter(this, void 0, void 0, function* () { return yield this.http.get('/v2/payment-order-gateways', { optionsCurrency }); }); } createOrder(id, gateway, req) { return __awaiter(this, void 0, void 0, function* () { return yield this.http.post(`/v2/identities/${id}/${gateway}/payment-order`, req); }); } orders(id) { return __awaiter(this, void 0, void 0, function* () { return yield this.http.get(`/v2/identities/${id}/payment-order`); }); } order(id, orderId) { return __awaiter(this, void 0, void 0, function* () { return yield this.http.get(`/v2/identities/${id}/payment-order/${orderId}`); }); } invoice(id, orderId) { return __awaiter(this, void 0, void 0, function* () { return yield this.http.getFile(`/v2/identities/${id}/payment-order/${orderId}/invoice`); }); } registrationPayment(id) { return __awaiter(this, void 0, void 0, function* () { return this.http.get(`/v2/identities/${id}/registration-payment`); }); } changeBeneficiaryAsync({ identity, address, }) { return __awaiter(this, void 0, void 0, function* () { return this.http.post(`/identities/${identity}/beneficiary-async`, { address }); }); } getBeneficiaryAsync(identity) { return __awaiter(this, void 0, void 0, function* () { return this.http.get(`/identities/${identity}/beneficiary-async`); }); } } exports.PaymentAPI = PaymentAPI;