@goparrot/franchise-mcp-server
Version:
MCP Server for Franchise API
173 lines (172 loc) • 5.11 kB
JavaScript
import { dashboardBaseUrl, makeRequest } from '../../common/index.js';
/**
* Method information for dashboard payment store endpoints
*/
export const PaymentMethods = {
getPaymentStores: {
description: 'Get all payment stores for a merchant and provider',
method: 'get',
path: '/payment/api/v2/payment-stores',
pathParams: [],
queryParams: [
{
name: 'merchantId',
type: 'string',
description: 'Merchant ID',
required: true,
},
{
name: 'provider',
type: 'string',
description: 'Payment provider',
required: true,
},
],
requestType: 'GetPaymentStoresRequest',
isMultipart: false,
originalName: 'getPaymentStores',
isWrite: false,
permissions: ['merchant:api:read'],
},
get: {
description: 'Get a specific payment store by store ID',
method: 'get',
path: '/payment/api/v2/payment-stores/{storeId}',
pathParams: [
{
name: 'storeId',
type: 'string',
description: 'Store ID',
required: true,
},
],
queryParams: [],
requestType: 'GetPaymentStoreRequest',
isMultipart: false,
originalName: 'get',
isWrite: false,
permissions: ['store-payment:api:read'],
},
create: {
description: 'Create a new payment store',
method: 'post',
path: '/payment/api/v2/payment-stores',
pathParams: [],
queryParams: [],
requestType: 'CreatePaymentStoreRequest',
isMultipart: false,
originalName: 'create',
isWrite: true,
permissions: ['store-payment:api:create'],
},
patch: {
description: 'Update a payment store using JSON Patch operations',
method: 'patch',
path: '/payment/api/v2/payment-stores/{storeId}',
pathParams: [
{
name: 'storeId',
type: 'string',
description: 'Store ID',
required: true,
},
],
queryParams: [],
requestType: 'PatchPaymentStoreRequest',
isMultipart: false,
originalName: 'patch',
isWrite: true,
permissions: ['store-payment:api:update'],
},
delete: {
description: 'Delete a payment store',
method: 'delete',
path: '/payment/api/v2/payment-stores/{storeId}',
pathParams: [
{
name: 'storeId',
type: 'string',
description: 'Store ID',
required: true,
},
],
queryParams: [],
requestType: 'DeletePaymentStoreRequest',
isMultipart: false,
originalName: 'delete',
isWrite: true,
permissions: ['store-payment:api:delete'],
},
getAuthData: {
description: 'Get OAuth link for a payment provider',
method: 'get',
path: '/payment/api/v2/payment-stores/{storeId}/providers/{provider}/oauth-link',
pathParams: [
{
name: 'storeId',
type: 'string',
description: 'Store ID',
required: true,
},
{
name: 'provider',
type: 'string',
description: 'Payment provider',
required: true,
},
],
queryParams: [],
requestType: 'GetAuthDataRequest',
isMultipart: false,
originalName: 'getAuthData',
isWrite: false,
permissions: ['store-payment:api:read'],
},
};
/**
* Handlers for dashboard payment store endpoints
*/
export const PaymentHandlers = {
getPaymentStores: async (accessToken, args) => {
return makeRequest(PaymentMethods.getPaymentStores, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
get: async (accessToken, args) => {
return makeRequest(PaymentMethods.get, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
create: async (accessToken, args) => {
return makeRequest(PaymentMethods.create, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
patch: async (accessToken, args) => {
return makeRequest(PaymentMethods.patch, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
delete: async (accessToken, args) => {
return makeRequest(PaymentMethods.delete, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
getAuthData: async (accessToken, args) => {
return makeRequest(PaymentMethods.getAuthData, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
};