@reeboot/strapi-payment-plugin 0.0.1 → 0.0.3
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/README.md +378 -119
- package/dist/_chunks/Analytics-DSJqY9ng.mjs +355 -0
- package/dist/_chunks/Analytics-nBSdLT2v.js +355 -0
- package/dist/_chunks/App-B83DZ9NG.js +70 -0
- package/dist/_chunks/App-BUSTbkyy.mjs +68 -0
- package/dist/_chunks/Customers-BpFzfglV.js +273 -0
- package/dist/_chunks/Customers-C6FH7-zG.mjs +273 -0
- package/dist/_chunks/Dashboard-CNMTzSyc.js +180 -0
- package/dist/_chunks/Dashboard-Dbwl0ZBo.mjs +180 -0
- package/dist/_chunks/Orders-CBkT2YfP.mjs +308 -0
- package/dist/_chunks/Orders-OG-pwV-B.js +308 -0
- package/dist/_chunks/Payments-BLen1P9N.js +489 -0
- package/dist/_chunks/Payments-DSDJ-HWm.mjs +489 -0
- package/dist/_chunks/Settings-Dq1xy32B.js +357 -0
- package/dist/_chunks/Settings-jmGslDsB.mjs +357 -0
- package/dist/_chunks/en-BJocyOVu.mjs +240 -0
- package/dist/_chunks/en-BkVAf_R4.js +240 -0
- package/dist/_chunks/index-BqqrpI6D.js +66 -0
- package/dist/_chunks/index-DS_PYNkf.mjs +67 -0
- package/dist/admin/index.js +2 -63
- package/dist/admin/index.mjs +2 -63
- package/dist/admin/src/components/AnalyticsChart.d.ts +19 -0
- package/dist/admin/src/components/CustomerList.d.ts +21 -0
- package/dist/admin/src/components/OrderList.d.ts +27 -0
- package/dist/admin/src/components/PaymentCard.d.ts +39 -0
- package/dist/admin/src/components/PaymentList.d.ts +19 -0
- package/dist/admin/src/components/RefundModal.d.ts +15 -0
- package/dist/admin/src/pages/Analytics.d.ts +2 -0
- package/dist/admin/src/pages/Customers.d.ts +2 -0
- package/dist/admin/src/pages/Dashboard.d.ts +2 -0
- package/dist/admin/src/pages/HomePage.d.ts +1 -1
- package/dist/admin/src/pages/Orders.d.ts +2 -0
- package/dist/admin/src/pages/Payments.d.ts +2 -0
- package/dist/admin/src/pages/Settings.d.ts +2 -0
- package/dist/admin/src/pluginId.d.ts +1 -1
- package/dist/server/index.js +1770 -992
- package/dist/server/index.mjs +1773 -995
- package/dist/server/src/bootstrap.d.ts +5 -11
- package/dist/server/src/config/index.d.ts +0 -10
- package/dist/server/src/content-types/customer/index.d.ts +69 -0
- package/dist/server/src/content-types/index.d.ts +123 -39
- package/dist/server/src/content-types/{product.d.ts → order/index.d.ts} +26 -19
- package/dist/server/src/content-types/{subscription.d.ts → payment/index.d.ts} +30 -21
- package/dist/server/src/controllers/controller.d.ts +5 -12
- package/dist/server/src/controllers/index.d.ts +29 -34
- package/dist/server/src/controllers/stripe.d.ts +104 -0
- package/dist/server/src/index.d.ts +179 -139
- package/dist/server/src/middlewares/index.d.ts +19 -1
- package/dist/server/src/policies/index.d.ts +3 -1
- package/dist/server/src/routes/{admin-routes.d.ts → admin/index.d.ts} +4 -4
- package/dist/server/src/routes/content-api/index.d.ts +21 -0
- package/dist/server/src/routes/index.d.ts +11 -16
- package/dist/server/src/services/index.d.ts +2 -38
- package/dist/server/src/services/{stripeDriver.d.ts → stripe.d.ts} +52 -59
- package/dist/server/src/types/index.d.ts +179 -0
- package/package.json +20 -25
- package/dist/_chunks/App-DD7GyuRr.mjs +0 -1424
- package/dist/_chunks/App-KZVBFRwo.js +0 -1424
- package/dist/_chunks/en-B4KWt_jN.js +0 -4
- package/dist/_chunks/en-Byx4XI2L.mjs +0 -4
- package/dist/admin/src/components/Header.d.ts +0 -2
- package/dist/admin/src/components/NavigationMenu.d.ts +0 -2
- package/dist/admin/src/components/Sidebar.d.ts +0 -2
- package/dist/admin/src/components/TransactionDetailsModal.d.ts +0 -18
- package/dist/admin/src/components/TransactionList.d.ts +0 -18
- package/dist/admin/src/pages/ConfigurationPage.d.ts +0 -2
- package/dist/admin/src/pages/DashboardPage.d.ts +0 -2
- package/dist/admin/src/pages/ProductsPage.d.ts +0 -2
- package/dist/admin/src/pages/SubscriptionsPage.d.ts +0 -2
- package/dist/admin/src/pages/TransactionsPage.d.ts +0 -2
- package/dist/server/src/controllers/product.d.ts +0 -18
- package/dist/server/src/controllers/subscription.d.ts +0 -16
- package/dist/server/src/controllers/webhook.d.ts +0 -10
- package/dist/server/src/routes/content-api.d.ts +0 -12
- package/dist/server/src/routes/product.d.ts +0 -2
- package/dist/server/src/routes/refund-routes.d.ts +0 -13
- package/dist/server/src/routes/subscription.d.ts +0 -5
- package/dist/server/src/routes/webhook.d.ts +0 -15
- package/dist/server/src/services/paypalDriver.d.ts +0 -47
- package/dist/server/src/services/product.d.ts +0 -7
- package/dist/server/src/services/service.d.ts +0 -26
- package/dist/server/src/services/subscription.d.ts +0 -9
- package/dist/server/src/services/sync.d.ts +0 -13
- package/jest.config.js +0 -13
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface TransactionDetailsModalProps {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
transaction: {
|
|
6
|
-
id: string;
|
|
7
|
-
amount: number;
|
|
8
|
-
currency: string;
|
|
9
|
-
status: string;
|
|
10
|
-
date: string;
|
|
11
|
-
customer: string;
|
|
12
|
-
paymentMethod: string;
|
|
13
|
-
gateway: string;
|
|
14
|
-
} | null;
|
|
15
|
-
onRefund: () => void;
|
|
16
|
-
}
|
|
17
|
-
declare const TransactionDetailsModal: React.FC<TransactionDetailsModalProps>;
|
|
18
|
-
export default TransactionDetailsModal;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Transaction {
|
|
3
|
-
id: string;
|
|
4
|
-
amount: number;
|
|
5
|
-
currency: string;
|
|
6
|
-
status: string;
|
|
7
|
-
date: string;
|
|
8
|
-
customer: string;
|
|
9
|
-
paymentMethod: string;
|
|
10
|
-
gateway: string;
|
|
11
|
-
}
|
|
12
|
-
interface TransactionListProps {
|
|
13
|
-
transactions: Transaction[];
|
|
14
|
-
onViewDetails: (transaction: Transaction) => void;
|
|
15
|
-
onStatusUpdate?: (transactionId: string, newStatus: string) => void;
|
|
16
|
-
}
|
|
17
|
-
declare const TransactionList: React.FC<TransactionListProps>;
|
|
18
|
-
export default TransactionList;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* controller
|
|
3
|
-
*/
|
|
4
|
-
/// <reference types="koa" />
|
|
5
|
-
declare const _default: ({ strapi, }: {
|
|
6
|
-
strapi: import("@strapi/types/dist/core").Strapi;
|
|
7
|
-
}) => {
|
|
8
|
-
create: (ctx: import("koa").Context) => Promise<void>;
|
|
9
|
-
update: (ctx: import("koa").Context) => Promise<void>;
|
|
10
|
-
find: (ctx: import("koa").Context) => Promise<void>;
|
|
11
|
-
findOne: (ctx: import("koa").Context) => Promise<import("koa").Context>;
|
|
12
|
-
delete: (ctx: import("koa").Context) => Promise<import("koa").Context>;
|
|
13
|
-
sync: (ctx: import("koa").Context) => Promise<import("koa").Context>;
|
|
14
|
-
getStripeProducts: (ctx: import("koa").Context) => Promise<void>;
|
|
15
|
-
importFromStripe: (ctx: import("koa").Context) => Promise<import("koa").Context>;
|
|
16
|
-
createPaymentLink: (ctx: import("koa").Context) => Promise<import("koa").Context>;
|
|
17
|
-
} & import("@strapi/types/dist/core/core-api/controller").Base;
|
|
18
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* controller
|
|
3
|
-
*/
|
|
4
|
-
/// <reference types="koa" />
|
|
5
|
-
declare const _default: ({ strapi, }: {
|
|
6
|
-
strapi: import("@strapi/types/dist/core").Strapi;
|
|
7
|
-
}) => {
|
|
8
|
-
create: (ctx: import("koa").Context) => Promise<void>;
|
|
9
|
-
update: (ctx: import("koa").Context) => Promise<void>;
|
|
10
|
-
find: (ctx: import("koa").Context) => Promise<void>;
|
|
11
|
-
findOne: (ctx: import("koa").Context) => Promise<import("koa").Context>;
|
|
12
|
-
delete: (ctx: import("koa").Context) => Promise<import("koa").Context>;
|
|
13
|
-
sync: (ctx: import("koa").Context) => Promise<void>;
|
|
14
|
-
cancel: (ctx: import("koa").Context) => Promise<void>;
|
|
15
|
-
} & import("@strapi/types/dist/core/core-api/controller").Base;
|
|
16
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* webhook controller
|
|
3
|
-
*/
|
|
4
|
-
/// <reference types="koa" />
|
|
5
|
-
declare const _default: ({ strapi, }: {
|
|
6
|
-
strapi: import("@strapi/types/dist/core").Strapi;
|
|
7
|
-
}) => {
|
|
8
|
-
process: (ctx: import("koa").Context) => Promise<void>;
|
|
9
|
-
} & import("@strapi/types/dist/core/core-api/controller").Base;
|
|
10
|
-
export default _default;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
initializePayment(amount: any, currency: any, orderId: any, options: any): Promise<{
|
|
3
|
-
status: string;
|
|
4
|
-
message: string;
|
|
5
|
-
}>;
|
|
6
|
-
processWebhook(payload: any, signature: any): Promise<{
|
|
7
|
-
status: string;
|
|
8
|
-
message: string;
|
|
9
|
-
}>;
|
|
10
|
-
refundPayment(transactionId: any, amount: any, options: any): Promise<{
|
|
11
|
-
status: string;
|
|
12
|
-
message: string;
|
|
13
|
-
}>;
|
|
14
|
-
getPaymentDetails(transactionId: any): Promise<{
|
|
15
|
-
status: string;
|
|
16
|
-
message: string;
|
|
17
|
-
}>;
|
|
18
|
-
createProduct(productData: any): Promise<{
|
|
19
|
-
status: string;
|
|
20
|
-
message: string;
|
|
21
|
-
}>;
|
|
22
|
-
updateProduct(productId: any, productData: any): Promise<{
|
|
23
|
-
status: string;
|
|
24
|
-
message: string;
|
|
25
|
-
}>;
|
|
26
|
-
createSubscription(customerId: any, planId: any, options: any): Promise<{
|
|
27
|
-
status: string;
|
|
28
|
-
message: string;
|
|
29
|
-
}>;
|
|
30
|
-
updateSubscription(subscriptionId: any, options: any): Promise<{
|
|
31
|
-
status: string;
|
|
32
|
-
message: string;
|
|
33
|
-
}>;
|
|
34
|
-
cancelSubscription(subscriptionId: any, reason: any): Promise<{
|
|
35
|
-
status: string;
|
|
36
|
-
message: string;
|
|
37
|
-
}>;
|
|
38
|
-
getSubscription(subscriptionId: any): Promise<{
|
|
39
|
-
status: string;
|
|
40
|
-
message: string;
|
|
41
|
-
}>;
|
|
42
|
-
getTransactions(limit: any, page: any): Promise<{
|
|
43
|
-
status: string;
|
|
44
|
-
message: string;
|
|
45
|
-
}>;
|
|
46
|
-
};
|
|
47
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const _default: ({ strapi, }: {
|
|
2
|
-
strapi: import("@strapi/types/dist/core").Strapi;
|
|
3
|
-
}) => {
|
|
4
|
-
createProduct: (productData: any) => Promise<any>;
|
|
5
|
-
updateProduct: (id: any, productData: any) => Promise<any>;
|
|
6
|
-
} & import("@strapi/types/dist/core/core-api/service").Base;
|
|
7
|
-
export default _default;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
declare const _default: ({ strapi }: {
|
|
2
|
-
strapi: any;
|
|
3
|
-
}) => {
|
|
4
|
-
initializePayment(gateway: any, amount: any, currency: any, orderId: any, options: any): Promise<any>;
|
|
5
|
-
processWebhook(gateway: any, payload: any, signature: any): Promise<any>;
|
|
6
|
-
refundPayment(gateway: any, transactionId: any, amount: any, options: any): Promise<any>;
|
|
7
|
-
getPaymentDetails(gateway: any, transactionId: any): Promise<any>;
|
|
8
|
-
getTransactions(gateway: any, status: any, limit?: number, offset?: number): Promise<{
|
|
9
|
-
data: any[];
|
|
10
|
-
meta: {
|
|
11
|
-
total: number;
|
|
12
|
-
limit: number;
|
|
13
|
-
offset: number;
|
|
14
|
-
};
|
|
15
|
-
}>;
|
|
16
|
-
saveConfiguration(configData: any): Promise<{
|
|
17
|
-
success: boolean;
|
|
18
|
-
message: string;
|
|
19
|
-
data: any;
|
|
20
|
-
}>;
|
|
21
|
-
getConfigStatus(): Promise<{
|
|
22
|
-
stripe: boolean;
|
|
23
|
-
paypal: boolean;
|
|
24
|
-
}>;
|
|
25
|
-
};
|
|
26
|
-
export default _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const _default: ({ strapi, }: {
|
|
2
|
-
strapi: import("@strapi/types/dist/core").Strapi;
|
|
3
|
-
}) => {
|
|
4
|
-
createSubscription: (subscriptionData: any) => Promise<any>;
|
|
5
|
-
updateSubscription: (id: any, subscriptionData: any) => Promise<any>;
|
|
6
|
-
cancelSubscription: (id: any) => Promise<any>;
|
|
7
|
-
syncSubscriptionStatus: (id: any) => Promise<any>;
|
|
8
|
-
} & import("@strapi/types/dist/core/core-api/service").Base;
|
|
9
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sync service for periodic synchronization
|
|
3
|
-
*/
|
|
4
|
-
declare const _default: ({ strapi, }: {
|
|
5
|
-
strapi: import("@strapi/types/dist/core").Strapi;
|
|
6
|
-
}) => {
|
|
7
|
-
syncAllProducts: () => Promise<void>;
|
|
8
|
-
syncProduct: (productId: any) => Promise<any>;
|
|
9
|
-
syncAllSubscriptions: () => Promise<void>;
|
|
10
|
-
syncSubscription: (subscriptionId: any) => Promise<any>;
|
|
11
|
-
startPeriodicSync: () => Promise<void>;
|
|
12
|
-
} & import("@strapi/types/dist/core/core-api/service").Base;
|
|
13
|
-
export default _default;
|
package/jest.config.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
preset: 'ts-jest',
|
|
3
|
-
testEnvironment: 'node',
|
|
4
|
-
testMatch: ['**/server/src/**/*.test.ts'],
|
|
5
|
-
moduleNameMapper: {
|
|
6
|
-
'^@/(.*)$': '<rootDir>/server/src/$1',
|
|
7
|
-
},
|
|
8
|
-
transform: {
|
|
9
|
-
'^.+\\.tsx?$': ['ts-jest', {
|
|
10
|
-
tsconfig: 'server/tsconfig.json',
|
|
11
|
-
}],
|
|
12
|
-
},
|
|
13
|
-
};
|