feat(M05-D): 完成收款配置与幂等分账
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
FetchWechatPayTransport, parseWechatPayCredentials, WechatPayClient
|
||||
} from './payments/wechat-pay-client.js';
|
||||
import { WechatPaymentService } from './payments/wechat-payment-service.js';
|
||||
import { ProfitSharingService } from './payments/profit-sharing-service.js';
|
||||
import {
|
||||
FetchThirdPartyTransport, parseThirdPartyCredentials, ThirdPartyClient
|
||||
} from './third-party/third-party-client.js';
|
||||
@@ -33,6 +34,7 @@ const accessControl = new RbacRepository(pool);
|
||||
const orderManagementRepository = new OrderManagementRepository(pool);
|
||||
const paymentRepository = new PaymentRepository(pool);
|
||||
const wechatCredentials = parseWechatPayCredentials(config.payment.wechatCredentialsJson);
|
||||
const wechatPayClient = new WechatPayClient(new FetchWechatPayTransport());
|
||||
const thirdPartyCredentials = parseThirdPartyCredentials(config.thirdParty.credentialsJson);
|
||||
const app = await buildApp({
|
||||
config,
|
||||
@@ -104,9 +106,15 @@ const app = await buildApp({
|
||||
wechat: new WechatPaymentService(
|
||||
pool,
|
||||
paymentRepository,
|
||||
new WechatPayClient(new FetchWechatPayTransport()),
|
||||
wechatPayClient,
|
||||
wechatCredentials
|
||||
),
|
||||
profitSharing: new ProfitSharingService(
|
||||
pool,
|
||||
wechatPayClient,
|
||||
wechatCredentials,
|
||||
config.payment.profitShareMockEnabled
|
||||
),
|
||||
authRepository,
|
||||
accessControl,
|
||||
jwtSecret: config.auth.jwtSecret,
|
||||
|
||||
Reference in New Issue
Block a user