feat: add base package payment initiation and verification
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 3m39s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 3m39s
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using CMSMicroservice.Application.PackageCQ.Commands.PurchaseGoldenPackage;
|
||||
using CMSMicroservice.Application.PackageCQ.Commands.VerifyGoldenPackagePurchase;
|
||||
using CMSMicroservice.Application.PackageCQ.Commands.InitiateBasePackagePayment;
|
||||
using CMSMicroservice.Application.PackageCQ.Commands.VerifyBasePackagePayment;
|
||||
using CMSMicroservice.Application.PackageCQ.Queries.GetUserPackageStatus;
|
||||
using CMSMicroservice.Protobuf.Protos.Package;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
@@ -53,6 +55,34 @@ public class PackageProfile : IRegister
|
||||
.Map(dest => dest.LastPurchaseDate, src => src.LastPurchaseDate.HasValue
|
||||
? Timestamp.FromDateTime(src.LastPurchaseDate.Value.ToUniversalTime())
|
||||
: null);
|
||||
|
||||
// InitiateBasePackagePayment (56M پکیج پایه)
|
||||
config.NewConfig<InitiateBasePackagePaymentRequest, InitiateBasePackagePaymentCommand>()
|
||||
.Map(dest => dest.UserId, src => src.UserId);
|
||||
|
||||
config.NewConfig<InitiateBasePackagePaymentResponseDto, InitiateBasePackagePaymentResponse>()
|
||||
.Map(dest => dest.Success, src => src.Success)
|
||||
.Map(dest => dest.Message, src => src.Message)
|
||||
.Map(dest => dest.OrderId, src => src.OrderId)
|
||||
.Map(dest => dest.TransactionId, src => src.TransactionId)
|
||||
.Map(dest => dest.Amount, src => src.Amount);
|
||||
|
||||
// VerifyBasePackagePayment (تأیید پرداخت پکیج پایه)
|
||||
config.NewConfig<VerifyBasePackagePaymentRequest, VerifyBasePackagePaymentCommand>()
|
||||
.Map(dest => dest.OrderId, src => src.OrderId)
|
||||
.Map(dest => dest.TransactionId, src => src.TransactionId)
|
||||
.Map(dest => dest.PaymentSuccess, src => src.PaymentSuccess)
|
||||
.Map(dest => dest.RefId, src => src.RefId)
|
||||
.Map(dest => dest.Message, src => src.Message);
|
||||
|
||||
config.NewConfig<VerifyBasePackagePaymentResponseDto, VerifyBasePackagePaymentResponse>()
|
||||
.Map(dest => dest.Success, src => src.Success)
|
||||
.Map(dest => dest.Message, src => src.Message)
|
||||
.Map(dest => dest.OrderId, src => src.OrderId)
|
||||
.Map(dest => dest.TransactionId, src => src.TransactionId)
|
||||
.Map(dest => dest.ReferenceCode, src => src.ReferenceCode)
|
||||
.Map(dest => dest.WalletBalance, src => src.WalletBalance)
|
||||
.Map(dest => dest.DiscountBalance, src => src.DiscountBalance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ using CMSMicroservice.Application.PackageCQ.Commands.UpdatePackage;
|
||||
using CMSMicroservice.Application.PackageCQ.Commands.DeletePackage;
|
||||
using CMSMicroservice.Application.PackageCQ.Commands.PurchaseGoldenPackage;
|
||||
using CMSMicroservice.Application.PackageCQ.Commands.VerifyGoldenPackagePurchase;
|
||||
using CMSMicroservice.Application.PackageCQ.Commands.InitiateBasePackagePayment;
|
||||
using CMSMicroservice.Application.PackageCQ.Commands.VerifyBasePackagePayment;
|
||||
using CMSMicroservice.Application.PackageCQ.Queries.GetPackage;
|
||||
using CMSMicroservice.Application.PackageCQ.Queries.GetAllPackageByFilter;
|
||||
using CMSMicroservice.Application.PackageCQ.Queries.GetUserPackageStatus;
|
||||
@@ -52,4 +54,15 @@ public class PackageService : PackageContract.PackageContractBase
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<GetUserPackageStatusRequest, GetUserPackageStatusQuery, GetUserPackageStatusResponse>(request, context);
|
||||
}
|
||||
|
||||
// Base Package Payment (56M)
|
||||
public override async Task<InitiateBasePackagePaymentResponse> InitiateBasePackagePayment(InitiateBasePackagePaymentRequest request, ServerCallContext context)
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<InitiateBasePackagePaymentRequest, InitiateBasePackagePaymentCommand, InitiateBasePackagePaymentResponse>(request, context);
|
||||
}
|
||||
|
||||
public override async Task<VerifyBasePackagePaymentResponse> VerifyBasePackagePayment(VerifyBasePackagePaymentRequest request, ServerCallContext context)
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<VerifyBasePackagePaymentRequest, VerifyBasePackagePaymentCommand, VerifyBasePackagePaymentResponse>(request, context);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user