feat: add manual membership payment processing with wallet and order management
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 7m8s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 7m8s
This commit is contained in:
@@ -3,6 +3,7 @@ using CMSMicroservice.WebApi.Common.Services;
|
||||
using CMSMicroservice.Application.ManualPaymentCQ.Commands.CreateManualPayment;
|
||||
using CMSMicroservice.Application.ManualPaymentCQ.Commands.ApproveManualPayment;
|
||||
using CMSMicroservice.Application.ManualPaymentCQ.Commands.RejectManualPayment;
|
||||
using CMSMicroservice.Application.ManualPaymentCQ.Commands.ProcessManualMembershipPayment;
|
||||
using CMSMicroservice.Application.ManualPaymentCQ.Queries.GetAllManualPayments;
|
||||
using Grpc.Core;
|
||||
using Mapster;
|
||||
@@ -56,4 +57,28 @@ public class ManualPaymentService : ManualPaymentContract.ManualPaymentContractB
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<GetAllManualPaymentsRequest, GetAllManualPaymentsQuery, GetAllManualPaymentsResponse>(request, context);
|
||||
}
|
||||
|
||||
public override async Task<ProcessManualMembershipPaymentResponse> ProcessManualMembershipPayment(
|
||||
ProcessManualMembershipPaymentRequest request,
|
||||
ServerCallContext context)
|
||||
{
|
||||
var command = new ProcessManualMembershipPaymentCommand
|
||||
{
|
||||
UserId = request.UserId,
|
||||
Amount = request.Amount,
|
||||
ReferenceNumber = request.ReferenceNumber,
|
||||
Description = request.Description,
|
||||
AdminUserId = request.AdminUserId
|
||||
};
|
||||
|
||||
var result = await _sender.Send(command, context.CancellationToken);
|
||||
|
||||
return new ProcessManualMembershipPaymentResponse
|
||||
{
|
||||
TransactionId = result.TransactionId,
|
||||
OrderId = result.OrderId,
|
||||
NewWalletBalance = result.NewWalletBalance,
|
||||
Message = result.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user