node-ecpay-aio
Version:
A production-ready ECPay AIO SDK for Node.js with TypeScript support.
41 lines (40 loc) • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PlaceOrderError = exports.CheckMacValueError = exports.ActionError = exports.QueryError = void 0;
class QueryError extends Error {
constructor(rtnMessage, rtnCode, rsp) {
super(rtnMessage);
this.name = 'ECPayReturnedQueryError';
this.code = rtnCode;
this.message = rtnMessage;
this.response = JSON.stringify(rsp);
}
}
exports.QueryError = QueryError;
class ActionError extends Error {
constructor(rtnMessage, rtnCode, rsp) {
super(rtnMessage);
this.name = 'ECPayReturnedActionError';
this.code = rtnCode;
this.message = rtnMessage;
this.response = JSON.stringify(rsp);
}
}
exports.ActionError = ActionError;
class CheckMacValueError extends Error {
constructor(message, rsp) {
super(message);
this.name = 'CheckMacValueError';
this.message = message;
this.response = JSON.stringify(rsp);
}
}
exports.CheckMacValueError = CheckMacValueError;
class PlaceOrderError extends Error {
constructor(message) {
super(message);
this.name = 'PlaceOrderError';
this.message = message;
}
}
exports.PlaceOrderError = PlaceOrderError;