Integrating MerchantDriver
How to use the MerchantDriver in nodejs based app (goerli testnet)
import { MerchantDriver } from "mto-metamask-backend-driver";
const MTO_API = 'Backend server url';
const MTO_APPKEY = 'test';
const bkdDriver = new MerchantDriver({
appKey: MTO_APPKEY,
baseUrl: MTO_API
});
await bkdDriver.init();
// get user profile
const profile = await bkdDriver.getProfile();
console.log('profile', profile);
Method List
getProfile
Get merchant profile
getProfile()
updateProfile
Update merchant profile
updateProfile(body: Partial<Product>)
createProduct
Create a product by merchant
createProduct(product: Partial<Product>)
getProducts
Get product list
getProducts(query: IProductFilterQuery)
getProductById
Get a single product.
getProductById(id: number)
updateProduct
Update a product by merchant.
updateProduct(id: number, body: Partial<Product>)
deleteProduct
Delete a product by merchant.
deleteProduct(id: number)
getOrders
Get order list.
getOrders(query: IOrderFilterQuery)
getOrderById
Get a single order.
getOrderById(id: number)
updateOrder
Update a single order.
updateOrder(query: Partial<Order>)
getDisputes
Get dispute list.
getDisputes(query: IDisputeFilterQuery)
getDisputeById
Get a single dispute.
getDisputeById(id: number)
getDisputeById
Get a single dispute.
getDisputeById(id: number)
Updated almost 2 years ago