payment rails
This commit is contained in:
37
api/gateway/mntx/client/fake.go
Normal file
37
api/gateway/mntx/client/fake.go
Normal file
@@ -0,0 +1,37 @@
|
||||
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 }
|
||||
Reference in New Issue
Block a user