45 lines
1.6 KiB
Go
45 lines
1.6 KiB
Go
package payment
|
|
|
|
import "context"
|
|
|
|
func (s *Service) StartConfigTestPayment(ctx context.Context, configID uint64, req StartConfigTestPaymentRequest, adminID uint64, clientIP string) (*ConfigTestPaymentDTO, error) {
|
|
if s.repo == nil {
|
|
return nil, ErrDependencyUnavailable
|
|
}
|
|
return s.repo.StartConfigTestPayment(ctx, configID, req, adminID, clientIP)
|
|
}
|
|
|
|
func (s *Service) ListConfigTestPayments(ctx context.Context, query ConfigTestPaymentQuery) (*ConfigTestPaymentListResponse, error) {
|
|
if s.repo == nil {
|
|
return nil, ErrDependencyUnavailable
|
|
}
|
|
return s.repo.ListConfigTestPayments(ctx, query)
|
|
}
|
|
|
|
func (s *Service) GetConfigTestPayment(ctx context.Context, id uint64) (*ConfigTestPaymentDTO, error) {
|
|
if s.repo == nil {
|
|
return nil, ErrDependencyUnavailable
|
|
}
|
|
return s.repo.GetConfigTestPayment(ctx, id)
|
|
}
|
|
|
|
func (s *Service) RefreshConfigTestPayment(ctx context.Context, id uint64) (*ConfigTestPaymentDTO, error) {
|
|
if s.repo == nil {
|
|
return nil, ErrDependencyUnavailable
|
|
}
|
|
return s.repo.RefreshConfigTestPayment(ctx, id)
|
|
}
|
|
|
|
func (s *Service) HandleConfigTestNotify(ctx context.Context, provider string, notifyToken string, params map[string]string, rawPayload string, contentType string, authorization string) (*NotifyResult, error) {
|
|
if s.repo == nil {
|
|
return nil, ErrDependencyUnavailable
|
|
}
|
|
return s.repo.HandleConfigTestNotify(ctx, provider, notifyToken, params, rawPayload, contentType, authorization)
|
|
}
|
|
func (s *Service) RecordConfigTestNotifyAck(ctx context.Context, provider string, notifyToken string, ack string) error {
|
|
if s.repo == nil {
|
|
return ErrDependencyUnavailable
|
|
}
|
|
return s.repo.RecordConfigTestNotifyAck(ctx, provider, notifyToken, ack)
|
|
}
|