add user login
This commit is contained in:
@@ -31,15 +31,11 @@ func NewPaymentMethodService(paymentMethodProcessor processor.PaymentMethodProce
|
||||
}
|
||||
|
||||
func (s *PaymentMethodServiceImpl) CreatePaymentMethod(ctx context.Context, contextInfo *appcontext.ContextInfo, req *contract.CreatePaymentMethodRequest) *contract.Response {
|
||||
// Convert contract to model
|
||||
modelReq := mappers.CreatePaymentMethodContractToModel(req)
|
||||
|
||||
// Set organization ID from context if not provided
|
||||
if modelReq.OrganizationID == uuid.Nil && contextInfo != nil {
|
||||
modelReq.OrganizationID = contextInfo.OrganizationID
|
||||
}
|
||||
|
||||
// Process request
|
||||
response, err := s.paymentMethodProcessor.CreatePaymentMethod(ctx, modelReq)
|
||||
if err != nil {
|
||||
return contract.BuildErrorResponse([]*contract.ResponseError{
|
||||
@@ -47,7 +43,6 @@ func (s *PaymentMethodServiceImpl) CreatePaymentMethod(ctx context.Context, cont
|
||||
})
|
||||
}
|
||||
|
||||
// Convert model to contract
|
||||
contractResponse := mappers.PaymentMethodResponseToContract(response)
|
||||
return contract.BuildSuccessResponse(contractResponse)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user