@riocrypto/common 1.0.444 → 1.0.445
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/models/kushki-payment.d.ts +16 -0
- package/build/models/kushki-payment.js +36 -0
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -156,6 +156,7 @@ export * from "./models/order";
|
|
|
156
156
|
export * from "./models/partner";
|
|
157
157
|
export * from "./models/user";
|
|
158
158
|
export * from "./models/ccxt-order";
|
|
159
|
+
export * from "./models/kushki-payment";
|
|
159
160
|
export * from "./clients/bitstamp-client";
|
|
160
161
|
export * from "./clients/ccxt-client";
|
|
161
162
|
export * from "./clients/fixer-client";
|
package/build/index.js
CHANGED
|
@@ -173,6 +173,7 @@ __exportStar(require("./models/order"), exports);
|
|
|
173
173
|
__exportStar(require("./models/partner"), exports);
|
|
174
174
|
__exportStar(require("./models/user"), exports);
|
|
175
175
|
__exportStar(require("./models/ccxt-order"), exports);
|
|
176
|
+
__exportStar(require("./models/kushki-payment"), exports);
|
|
176
177
|
__exportStar(require("./clients/bitstamp-client"), exports);
|
|
177
178
|
__exportStar(require("./clients/ccxt-client"), exports);
|
|
178
179
|
__exportStar(require("./clients/fixer-client"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
interface KushkiPaymentAttrs {
|
|
3
|
+
orderId: string;
|
|
4
|
+
kushkiTransactionReference: string;
|
|
5
|
+
status: string;
|
|
6
|
+
}
|
|
7
|
+
interface KushkiPaymentDoc extends mongoose.Document {
|
|
8
|
+
orderId: string;
|
|
9
|
+
status: string;
|
|
10
|
+
kushkiTransactionReference: string;
|
|
11
|
+
}
|
|
12
|
+
interface KushkiPaymentModel extends mongoose.Model<KushkiPaymentDoc> {
|
|
13
|
+
build(attrs: KushkiPaymentAttrs): KushkiPaymentDoc;
|
|
14
|
+
}
|
|
15
|
+
declare const buildKushkiPayment: (mongoose: typeof mongoose) => KushkiPaymentModel | undefined;
|
|
16
|
+
export { buildKushkiPayment, KushkiPaymentDoc };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildKushkiPayment = void 0;
|
|
4
|
+
const buildKushkiPayment = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.KushkiPayment) {
|
|
7
|
+
return mongoose.model("KushkiPayment");
|
|
8
|
+
}
|
|
9
|
+
const KushkiPaymentSchema = new mongoose.Schema({
|
|
10
|
+
orderId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
kushkiTransactionReference: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
status: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
}, {
|
|
23
|
+
toJSON: {
|
|
24
|
+
transform(doc, ret) {
|
|
25
|
+
ret.id = ret._id;
|
|
26
|
+
delete ret._id;
|
|
27
|
+
delete ret.__v;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
KushkiPaymentSchema.statics.build = (attrs) => {
|
|
32
|
+
return new KushkiPayment(attrs);
|
|
33
|
+
};
|
|
34
|
+
const KushkiPayment = mongoose.model("KushkiPayment", KushkiPaymentSchema);
|
|
35
|
+
};
|
|
36
|
+
exports.buildKushkiPayment = buildKushkiPayment;
|