This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const payload = { | |
// Optional amount if not set will show amount in UI | |
amount: 100.00, | |
// Optional description if not set will show currency dropdown in UI | |
currency: env.CURRENCY, | |
// Optional description if not set will show description in UI | |
description: "PayMongo Transaction", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from "@mayajs/core"; | |
@Injectable() // This decorator allows this class to be injected on other modules | |
export class SampleServices { | |
constructor( // Inject other services here) {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { MongoSchema, MongoModel } from "@mayajs/mongo"; | |
const schema = MongoSchema({ | |
// Add mongo fields here | |
}); | |
export default MongoModel("Sample", schema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SampleController } from "./controllers/sample/sample.controller"; | |
export const routes = [ | |
{ | |
controllers: [SampleController], | |
middlewares: [], | |
path: "", | |
}, | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Get, Patch, Post, Delete, Put } from "@mayajs/common"; | |
import { Controller } from "@mayajs/core"; | |
@Controller({ | |
model: "./sample.model", // Name of the model for this route | |
route: "/sample", // Name of the route | |
}) | |
export class SampleController { | |
constructor( // Inject services here ) {} | |
} |