refactored orchestrator and callbacks service to use pkg messsaging + envelope factory / handler
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package notifications
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/tech/sendico/pkg/model"
|
||||
)
|
||||
|
||||
type PaymentStatusUpdatedHandler = func(context.Context, *model.PaymentStatusUpdated) error
|
||||
@@ -0,0 +1,18 @@
|
||||
package notifications
|
||||
|
||||
import (
|
||||
messaging "github.com/tech/sendico/pkg/messaging/envelope"
|
||||
pinternal "github.com/tech/sendico/pkg/messaging/internal/notifications/paymentorchestrator"
|
||||
ch "github.com/tech/sendico/pkg/messaging/notifications/paymentorchestrator/handler"
|
||||
np "github.com/tech/sendico/pkg/messaging/notifications/processor"
|
||||
"github.com/tech/sendico/pkg/mlogger"
|
||||
"github.com/tech/sendico/pkg/model"
|
||||
)
|
||||
|
||||
func PaymentStatusUpdated(sender string, status *model.PaymentStatusUpdated) messaging.Envelope {
|
||||
return pinternal.NewPaymentStatusUpdatedEnvelope(sender, status)
|
||||
}
|
||||
|
||||
func NewPaymentStatusUpdatedProcessor(logger mlogger.Logger, handler ch.PaymentStatusUpdatedHandler) np.EnvelopeProcessor {
|
||||
return pinternal.NewPaymentStatusUpdatedProcessor(logger, handler)
|
||||
}
|
||||
Reference in New Issue
Block a user