UNPKG

@test-org122/merchant-iframe

Version:

Mediator iFrame package. This is used to sandbox the connector code away from the running hypernet core.

32 lines 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MerchantConnectorRepository = void 0; const neverthrow_1 = require("neverthrow"); class MerchantConnectorRepository { constructor(ajaxUtils) { this.ajaxUtils = ajaxUtils; } getMerchantSignature(merchantUrl) { const url = new URL(merchantUrl.toString()); url.pathname = "signature"; return this.ajaxUtils.get(url).andThen((response) => { return neverthrow_1.okAsync(response); }); } getMerchantAddress(merchantUrl) { const url = new URL(merchantUrl.toString()); url.pathname = "publicKey"; return this.ajaxUtils.get(url).andThen((response) => { return neverthrow_1.okAsync(response); }); } getMerchantCode(merchantUrl) { const url = new URL(merchantUrl.toString()); url.pathname = "connector"; return this.ajaxUtils.get(url).andThen((response) => { return neverthrow_1.okAsync(response); }); } } exports.MerchantConnectorRepository = MerchantConnectorRepository; //# sourceMappingURL=MerchantConnectorRepository.js.map