netopia-client
Version:
A fully-typed, TypeScript-based client for the Netopia payments API V2.
35 lines (34 loc) • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NetopiaError = void 0;
exports.missingField = missingField;
exports.invalidPayment = invalidPayment;
exports.invalidBrowser = invalidBrowser;
exports.invalidOrder = invalidOrder;
exports.invalidProducts = invalidProducts;
exports.failedPaymentStart = failedPaymentStart;
class NetopiaError extends Error {
constructor(message) {
super(message);
this.name = "NetopiaError";
}
}
exports.NetopiaError = NetopiaError;
function missingField(fieldName) {
return new NetopiaError(`Missing required field: ${fieldName}`);
}
function invalidPayment(message) {
return new NetopiaError(`Invalid payment data: ${message}`);
}
function invalidBrowser(message) {
return new NetopiaError(`Invalid browser data: ${message}`);
}
function invalidOrder(message) {
return new NetopiaError(`Invalid order data: ${message}`);
}
function invalidProducts(message) {
return new NetopiaError(`Invalid product data: ${message}`);
}
function failedPaymentStart(message) {
return new NetopiaError(`Failed to start payment: ${message}`);
}