38 lines
1.4 KiB
Go
38 lines
1.4 KiB
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
|
|
mntxv1 "github.com/tech/sendico/pkg/proto/gateway/mntx/v1"
|
|
)
|
|
|
|
// Fake implements Client for tests.
|
|
type Fake struct {
|
|
CreateCardPayoutFn func(ctx context.Context, req *mntxv1.CardPayoutRequest) (*mntxv1.CardPayoutResponse, error)
|
|
CreateCardTokenPayoutFn func(ctx context.Context, req *mntxv1.CardTokenPayoutRequest) (*mntxv1.CardTokenPayoutResponse, error)
|
|
GetCardPayoutStatusFn func(ctx context.Context, req *mntxv1.GetCardPayoutStatusRequest) (*mntxv1.GetCardPayoutStatusResponse, error)
|
|
}
|
|
|
|
func (f *Fake) CreateCardPayout(ctx context.Context, req *mntxv1.CardPayoutRequest) (*mntxv1.CardPayoutResponse, error) {
|
|
if f.CreateCardPayoutFn != nil {
|
|
return f.CreateCardPayoutFn(ctx, req)
|
|
}
|
|
return &mntxv1.CardPayoutResponse{}, nil
|
|
}
|
|
|
|
func (f *Fake) CreateCardTokenPayout(ctx context.Context, req *mntxv1.CardTokenPayoutRequest) (*mntxv1.CardTokenPayoutResponse, error) {
|
|
if f.CreateCardTokenPayoutFn != nil {
|
|
return f.CreateCardTokenPayoutFn(ctx, req)
|
|
}
|
|
return &mntxv1.CardTokenPayoutResponse{}, nil
|
|
}
|
|
|
|
func (f *Fake) GetCardPayoutStatus(ctx context.Context, req *mntxv1.GetCardPayoutStatusRequest) (*mntxv1.GetCardPayoutStatusResponse, error) {
|
|
if f.GetCardPayoutStatusFn != nil {
|
|
return f.GetCardPayoutStatusFn(ctx, req)
|
|
}
|
|
return &mntxv1.GetCardPayoutStatusResponse{}, nil
|
|
}
|
|
|
|
func (f *Fake) Close() error { return nil }
|