generated from PenaSide/GolangTemplate
Merge branch 'main' into staging
This commit is contained in:
commit
79df7543bb
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
main
|
||||
vendor/
|
||||
.idea/
|
||||
.vscode
|
||||
|
@ -20,4 +20,6 @@ deploy-to-prod:
|
||||
- if: "$CI_COMMIT_BRANCH == $PRODUCTION_BRANCH"
|
||||
tags:
|
||||
- prod
|
||||
after_script:
|
||||
- ls
|
||||
extends: .deploy_template
|
||||
|
@ -11,12 +11,21 @@ message MainPaymentSettings {
|
||||
string ReturnURL = 4;
|
||||
string UserID = 5;
|
||||
string ClientIP = 6;
|
||||
Customer Customer = 7;
|
||||
repeated Item Items = 8;
|
||||
}
|
||||
|
||||
message BankCardInformation {
|
||||
string Number = 1;
|
||||
string ExpiryYear = 2;
|
||||
string ExpiryMonth = 3;
|
||||
optional string CSC = 4;
|
||||
optional string CardHolderName = 5;
|
||||
message Customer {
|
||||
string FullName = 1;
|
||||
string INN = 2;
|
||||
string Email = 3;
|
||||
string Phone = 4;
|
||||
}
|
||||
|
||||
message Item {
|
||||
string Description = 1;
|
||||
string Measure = 2;
|
||||
string Quantity = 3;
|
||||
string Money = 4;
|
||||
string Currency = 5;
|
||||
}
|
@ -8,33 +8,22 @@ import "treasurer/payment.model.proto";
|
||||
option go_package = "./treasurer";
|
||||
|
||||
service TreasurerService {
|
||||
rpc GetPaymentLinkBankCard(GetBankCardPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkYooMoney(GetPaymentLinkBody) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkSberPay(GetPaymentLinkBody) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkTinkoff(GetPaymentLinkBody) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkSberbankB2B(GetPaymentLinkBody) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkSBP(GetPaymentLinkBody) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkBankCard(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkYooMoney(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkTinkoff(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkSberbankB2B(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkSBP(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkSberPay(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
}
|
||||
|
||||
message GetBankCardPaymentLinkRequest {
|
||||
MainPaymentSettings MainSettings = 1;
|
||||
BankCardInformation BankCard = 2;
|
||||
}
|
||||
|
||||
message GetPaymentLinkBody {
|
||||
message GetPaymentLinkRequest {
|
||||
MainPaymentSettings MainSettings = 1;
|
||||
}
|
||||
|
||||
message GetPhonePaymentLinkRequest {
|
||||
MainPaymentSettings MainSettings = 1;
|
||||
string Phone = 2;
|
||||
}
|
||||
|
||||
message GetLoginPaymentLinkRequest {
|
||||
MainPaymentSettings MainSettings = 1;
|
||||
string Login = 2;
|
||||
}
|
||||
|
||||
message GetB2BPaymentLinkRequest {
|
||||
MainPaymentSettings MainSettings = 1;
|
||||
string PaymentPurpose = 2;
|
||||
|
@ -1,9 +1,9 @@
|
||||
version: "3.3"
|
||||
|
||||
services:
|
||||
customer-app-staging:
|
||||
hostname: customer-service-staging
|
||||
container_name: customer-service-staging
|
||||
customer-appv1.0.0:
|
||||
hostname: customer-servicev1.0.0
|
||||
container_name: customer-servicev1.0.0
|
||||
image: $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||
tty: true
|
||||
environment:
|
||||
@ -11,8 +11,8 @@ services:
|
||||
- HTTP_PORT=8065
|
||||
|
||||
- GRPC_HOST=0.0.0.0
|
||||
- GRPC_PORT=9085
|
||||
- GRPC_DOMEN=http://customer-service:9085
|
||||
- GRPC_PORT=9065
|
||||
- GRPC_DOMEN=10.8.0.8:9065
|
||||
|
||||
- MONGO_HOST=10.8.0.8
|
||||
- MONGO_PORT=27017
|
||||
@ -31,13 +31,27 @@ services:
|
||||
- PAYMENT_MICROSERVICE_GRPC_HOST=10.8.0.8:9085
|
||||
- VERIFICATION_MICROSERVICE_USER_URL=http://10.8.0.8:7035/verification
|
||||
- TEMPLATEGEN_MICROSERVICE_URL=10.6.0.17
|
||||
- CODEWORD_MICROSERVICE_GRPC_HOST=10.8.0.8:59665
|
||||
- API_URL=https://api.smtp.bz/v1/smtp/send
|
||||
- MAIL_SENDER=noreply@noreply.pena.digital
|
||||
- MAIL_API_KEY=8tv2xcsfCMBX3TCQxzgeeEwAEYyQrPUp0ggw
|
||||
- MAIL_AUTH_USERNAME=team@pena.digital
|
||||
- MAIL_AUTH_PASSWORD=AyMfwqA9LkQH
|
||||
- MAIL_ADDRESS=sells@pena.digital
|
||||
|
||||
|
||||
- JWT_PUBLIC_KEY=$JWT_PUBLIC_KEY
|
||||
- JWT_ISSUER=pena-auth-service
|
||||
- JWT_AUDIENCE=pena
|
||||
- PUBLIC_KEY=$USER_PKEY
|
||||
- PRIVATE_KEY=$USER_PRIVATEKEY
|
||||
- ADMIN_FRONT_URL=https://admin.pena
|
||||
- TRASH_LOG_HOST=10.8.0.15:7113
|
||||
- MODULE_LOGGER=customer-main
|
||||
- NOTIFICATION_CHANNEL=-1002017928045
|
||||
- NOTIFICATION_BOT_TOKEN=6414077478:AAFk03HezovLT2kO_i9OYswH8Weirsgp9GU
|
||||
ports:
|
||||
- 10.8.0.8:8065:8065
|
||||
- 10.8.0.8:9065:9065
|
||||
- 10.8.0.8:8066:8065
|
||||
- 10.8.0.8:9066:9065
|
||||
networks:
|
||||
- default
|
||||
|
@ -44,6 +44,7 @@ services:
|
||||
- JWT_AUDIENCE=pena
|
||||
- PUBLIC_KEY=$USER_PKEY
|
||||
- PRIVATE_KEY=$USER_PRIVATEKEY
|
||||
- ADMIN_FRONT_URL=https://sadmin.pena
|
||||
- TRASH_LOG_HOST=10.8.0.15:7113
|
||||
- MODULE_LOGGER=customer-staging
|
||||
ports:
|
||||
|
5
go.sum
5
go.sum
@ -97,7 +97,7 @@ github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ
|
||||
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/pioz/faker v1.7.3 h1:Tez8Emuq0UN+/d6mo3a9m/9ZZ/zdfJk0c5RtRatrceM=
|
||||
github.com/pioz/faker v1.7.3/go.mod h1:xSpay5w/oz1a6+ww0M3vfpe40pSIykeUPeWEc3TvVlc=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
@ -296,9 +296,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/tucnak/telebot.v2 v2.5.0 h1:i+NynLo443Vp+Zn3Gv9JBjh3Z/PaiKAQwcnhNI7y6Po=
|
||||
gopkg.in/tucnak/telebot.v2 v2.5.0/go.mod h1:BgaIIx50PSRS9pG59JH+geT82cfvoJU/IaI5TJdN3v8=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
|
@ -22,6 +22,7 @@ import (
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/server"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/closer"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/kafka"
|
||||
tb "gopkg.in/tucnak/telebot.v2"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -124,12 +125,28 @@ func Run(config *models.Config, logger *zap.Logger, build Build) (appErr error)
|
||||
MongoDB: mongoDB,
|
||||
})
|
||||
|
||||
notificationBot, err := tb.NewBot(tb.Settings{
|
||||
Token: config.Service.NotificationBotToken,
|
||||
Verbose: false,
|
||||
ParseMode: tb.ModeHTML,
|
||||
Poller: &tb.LongPoller{
|
||||
Timeout: time.Second,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
//logger.Emit(json.Token(err))
|
||||
return err
|
||||
}
|
||||
|
||||
services := initialize.NewServices(initialize.ServicesDeps{
|
||||
Logger: logger,
|
||||
Repositories: repositories,
|
||||
Clients: clients,
|
||||
ConfigurationGRPC: &config.GRPC,
|
||||
Brokers: brokers,
|
||||
Notifier: notificationBot,
|
||||
NotificationChannel: config.Service.NotificationChannel,
|
||||
AdminURL: config.Service.AdminURL,
|
||||
})
|
||||
|
||||
rpcControllers := initialize.NewRpcControllers(initialize.RpcControllersDeps{
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/callback"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/history"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/wallet"
|
||||
tb "gopkg.in/tucnak/telebot.v2"
|
||||
)
|
||||
|
||||
type ServicesDeps struct {
|
||||
@ -15,6 +16,9 @@ type ServicesDeps struct {
|
||||
Clients *Clients
|
||||
Brokers *Brokers
|
||||
ConfigurationGRPC *models.ConfigurationGRPC
|
||||
Notifier *tb.Bot
|
||||
NotificationChannel int64
|
||||
AdminURL string
|
||||
}
|
||||
|
||||
type Services struct {
|
||||
@ -55,6 +59,9 @@ func NewServices(deps ServicesDeps) *Services {
|
||||
AccountRepository: deps.Repositories.AccountRepository,
|
||||
WalletService: walletService,
|
||||
HistoryService: historyService,
|
||||
Notifier: deps.Notifier,
|
||||
NotifyChannel: deps.NotificationChannel,
|
||||
AdminURL: deps.AdminURL,
|
||||
}),
|
||||
TariffBrokerService: tariffBrokerService,
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ func NewPaymentClient(deps PaymentClientDeps) *PaymentClient {
|
||||
}
|
||||
}
|
||||
|
||||
func (receiver *PaymentClient) GetPaymentLinkBankCard(ctx context.Context, request *treasurer.GetBankCardPaymentLinkRequest) (string, errors.Error) {
|
||||
func (receiver *PaymentClient) GetPaymentLinkBankCard(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||
if connectErr != nil {
|
||||
receiver.logger.Error("failed to connect on <GetPaymentLinkBankCard> of <PaymentClient>", zap.Error(connectErr))
|
||||
@ -59,7 +59,7 @@ func (receiver *PaymentClient) GetPaymentLinkBankCard(ctx context.Context, reque
|
||||
return response.RedirectURL, nil
|
||||
}
|
||||
|
||||
func (receiver *PaymentClient) GetPaymentLinkYooMoney(ctx context.Context, request *treasurer.GetPaymentLinkBody) (string, errors.Error) {
|
||||
func (receiver *PaymentClient) GetPaymentLinkYooMoney(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||
if connectErr != nil {
|
||||
receiver.logger.Error("failed to connect on <GetPaymentLinkYooMoney> of <PaymentClient>", zap.Error(connectErr))
|
||||
@ -80,7 +80,7 @@ func (receiver *PaymentClient) GetPaymentLinkYooMoney(ctx context.Context, reque
|
||||
return response.RedirectURL, nil
|
||||
}
|
||||
|
||||
func (receiver *PaymentClient) GetPaymentLinkSberPay(ctx context.Context, request *treasurer.GetPaymentLinkBody) (string, errors.Error) {
|
||||
func (receiver *PaymentClient) GetPaymentLinkSberPay(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||
if connectErr != nil {
|
||||
receiver.logger.Error("failed to connect on <GetPaymentLinkSberPay> of <PaymentClient>", zap.Error(connectErr))
|
||||
@ -101,7 +101,7 @@ func (receiver *PaymentClient) GetPaymentLinkSberPay(ctx context.Context, reques
|
||||
return response.RedirectURL, nil
|
||||
}
|
||||
|
||||
func (receiver *PaymentClient) GetPaymentLinkSBP(ctx context.Context, request *treasurer.GetPaymentLinkBody) (string, errors.Error) {
|
||||
func (receiver *PaymentClient) GetPaymentLinkSBP(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||
if connectErr != nil {
|
||||
receiver.logger.Error("failed to connect on <GetPaymentLinkSBP> of <PaymentClient>", zap.Error(connectErr))
|
||||
@ -122,7 +122,7 @@ func (receiver *PaymentClient) GetPaymentLinkSBP(ctx context.Context, request *t
|
||||
return response.RedirectURL, nil
|
||||
}
|
||||
|
||||
func (receiver *PaymentClient) GetPaymentLinkTinkoff(ctx context.Context, request *treasurer.GetPaymentLinkBody) (string, errors.Error) {
|
||||
func (receiver *PaymentClient) GetPaymentLinkTinkoff(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||
if connectErr != nil {
|
||||
receiver.logger.Error("failed to connect on <GetPaymentLinkTinkoff> of <PaymentClient>", zap.Error(connectErr))
|
||||
@ -143,7 +143,7 @@ func (receiver *PaymentClient) GetPaymentLinkTinkoff(ctx context.Context, reques
|
||||
return response.RedirectURL, nil
|
||||
}
|
||||
|
||||
func (receiver *PaymentClient) GetPaymentLinkSberbankB2B(ctx context.Context, request *treasurer.GetPaymentLinkBody) (string, errors.Error) {
|
||||
func (receiver *PaymentClient) GetPaymentLinkSberbankB2B(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||
if connectErr != nil {
|
||||
receiver.logger.Error("failed to connect on <GetPaymentLinkSberbankB2B> of <PaymentClient>", zap.Error(connectErr))
|
||||
|
@ -56,7 +56,7 @@ func (receiver *VerificationClient) GetVerification(ctx context.Context, token,
|
||||
if err != nil {
|
||||
fmt.Println("AAAAAAAAAAAa", err, verifURL, response)
|
||||
if response.StatusCode == 404 {
|
||||
return nil, errors.New(err, errors.ErrNotFound)
|
||||
return &models.Verification{},nil
|
||||
}
|
||||
return nil, errors.New(err, errors.ErrInternalError)
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ func (receiver *WalletController) GetPaymentLink(ctx context.Context, request *m
|
||||
}
|
||||
|
||||
func (receiver *WalletController) GetPaymentLinkBankCard(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := receiver.paymentClient.GetPaymentLinkBankCard(ctx, &treasurer.GetBankCardPaymentLinkRequest{
|
||||
link, err := receiver.paymentClient.GetPaymentLinkBankCard(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
@ -145,7 +145,7 @@ func (receiver *WalletController) GetPaymentLinkBankCard(ctx context.Context, re
|
||||
}
|
||||
|
||||
func (receiver *WalletController) GetPaymentLinkYooMoney(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := receiver.paymentClient.GetPaymentLinkYooMoney(ctx, &treasurer.GetPaymentLinkBody{
|
||||
link, err := receiver.paymentClient.GetPaymentLinkYooMoney(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
@ -164,7 +164,7 @@ func (receiver *WalletController) GetPaymentLinkYooMoney(ctx context.Context, re
|
||||
}
|
||||
|
||||
func (receiver *WalletController) GetPaymentLinkSberPay(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := receiver.paymentClient.GetPaymentLinkSberPay(ctx, &treasurer.GetPaymentLinkBody{
|
||||
link, err := receiver.paymentClient.GetPaymentLinkSberPay(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
@ -183,7 +183,7 @@ func (receiver *WalletController) GetPaymentLinkSberPay(ctx context.Context, req
|
||||
}
|
||||
|
||||
func (receiver *WalletController) GetPaymentLinkTinkoff(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := receiver.paymentClient.GetPaymentLinkTinkoff(ctx, &treasurer.GetPaymentLinkBody{
|
||||
link, err := receiver.paymentClient.GetPaymentLinkTinkoff(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
@ -202,7 +202,7 @@ func (receiver *WalletController) GetPaymentLinkTinkoff(ctx context.Context, req
|
||||
}
|
||||
|
||||
func (receiver *WalletController) GetPaymentLinkSBP(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := receiver.paymentClient.GetPaymentLinkSBP(ctx, &treasurer.GetPaymentLinkBody{
|
||||
link, err := receiver.paymentClient.GetPaymentLinkSBP(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
@ -221,7 +221,7 @@ func (receiver *WalletController) GetPaymentLinkSBP(ctx context.Context, request
|
||||
}
|
||||
|
||||
func (receiver *WalletController) GetPaymentLinkB2B(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := receiver.paymentClient.GetPaymentLinkSberbankB2B(ctx, &treasurer.GetPaymentLinkBody{
|
||||
link, err := receiver.paymentClient.GetPaymentLinkSberbankB2B(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
|
1007
internal/interface/swagger/api.2.go
Normal file
1007
internal/interface/swagger/api.2.go
Normal file
File diff suppressed because it is too large
Load Diff
193
internal/interface/swagger/money.go
Normal file
193
internal/interface/swagger/money.go
Normal file
@ -0,0 +1,193 @@
|
||||
package swagger
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
||||
utils "penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils/transfer"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/treasurer"
|
||||
)
|
||||
|
||||
func (api *API2) GetPaymentLink(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
if _, userErr := api.clients.auth.GetUser(ctx, request.UserID); userErr != nil {
|
||||
api.logger.Error("failed to get user on <GetPaymentLink> on <PaymentService>",
|
||||
zap.Error(userErr),
|
||||
zap.String("userID", request.UserID),
|
||||
)
|
||||
|
||||
return "", userErr
|
||||
}
|
||||
|
||||
switch request.Body.Type {
|
||||
case models.PaymentTypeBankCard:
|
||||
return api.GetPaymentLinkBankCard(ctx, request)
|
||||
case models.PaymentTypeYoomoney:
|
||||
return api.GetPaymentLinkYooMoney(ctx, request)
|
||||
case models.PaymentTypeSberPay:
|
||||
return api.GetPaymentLinkSberPay(ctx, request)
|
||||
case models.PaymentTypeTinkoff:
|
||||
return api.GetPaymentLinkTinkoff(ctx, request)
|
||||
case models.PaymentTypeSBP:
|
||||
return api.GetPaymentLinkSBP(ctx, request)
|
||||
}
|
||||
|
||||
return "", errors.NewWithMessage("invalid payment method type", errors.ErrInvalidArgs)
|
||||
}
|
||||
|
||||
func (api *API2) GetPaymentLinkBankCard(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := api.clients.payment.GetPaymentLinkBankCard(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
UserID: request.UserID,
|
||||
ClientIP: request.ClientIP,
|
||||
CallbackHostGRPC: []string{api.grpc.Domen},
|
||||
ReturnURL: request.Body.ReturnURL,
|
||||
Customer: &treasurer.Customer{
|
||||
FullName: request.Customer.FullName,
|
||||
INN: request.Customer.INN,
|
||||
Email: request.Customer.Email,
|
||||
Phone: request.Customer.Phone,
|
||||
},
|
||||
Items: utils.ReceiptItemsToProto(request.Items),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
api.logger.Error("failed to get bankcard payment link on <GetPaymentLinkBankCard> of <PaymentService>", zap.Error(err))
|
||||
return "", err
|
||||
}
|
||||
|
||||
return link, nil
|
||||
}
|
||||
|
||||
func (api *API2) GetPaymentLinkYooMoney(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := api.clients.payment.GetPaymentLinkYooMoney(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
UserID: request.UserID,
|
||||
ClientIP: request.ClientIP,
|
||||
CallbackHostGRPC: []string{api.grpc.Domen},
|
||||
ReturnURL: request.Body.ReturnURL,
|
||||
Customer: &treasurer.Customer{
|
||||
FullName: request.Customer.FullName,
|
||||
INN: request.Customer.INN,
|
||||
Email: request.Customer.Email,
|
||||
Phone: request.Customer.Phone,
|
||||
},
|
||||
Items: utils.ReceiptItemsToProto(request.Items),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
api.logger.Error("failed to get yoomoney payment link on <GetPaymentLinkYooMoney> of <PaymentService>", zap.Error(err))
|
||||
return "", err
|
||||
}
|
||||
|
||||
return link, nil
|
||||
}
|
||||
|
||||
func (api *API2) GetPaymentLinkSberPay(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := api.clients.payment.GetPaymentLinkSberPay(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
UserID: request.UserID,
|
||||
ClientIP: request.ClientIP,
|
||||
CallbackHostGRPC: []string{api.grpc.Domen},
|
||||
ReturnURL: request.Body.ReturnURL,
|
||||
Customer: &treasurer.Customer{
|
||||
FullName: request.Customer.FullName,
|
||||
INN: request.Customer.INN,
|
||||
Email: request.Customer.Email,
|
||||
Phone: request.Customer.Phone,
|
||||
},
|
||||
Items: utils.ReceiptItemsToProto(request.Items),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
api.logger.Error("failed to get sberpay payment link on <GetPaymentLinkSberPay> of <PaymentService>", zap.Error(err))
|
||||
return "", err
|
||||
}
|
||||
|
||||
return link, nil
|
||||
}
|
||||
|
||||
func (api *API2) GetPaymentLinkSberB2B(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := api.clients.payment.GetPaymentLinkSberbankB2B(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
UserID: request.UserID,
|
||||
ClientIP: request.ClientIP,
|
||||
CallbackHostGRPC: []string{api.grpc.Domen},
|
||||
ReturnURL: request.Body.ReturnURL,
|
||||
Customer: &treasurer.Customer{
|
||||
FullName: request.Customer.FullName,
|
||||
INN: request.Customer.INN,
|
||||
Email: request.Customer.Email,
|
||||
Phone: request.Customer.Phone,
|
||||
},
|
||||
Items: utils.ReceiptItemsToProto(request.Items),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
api.logger.Error("failed to get sberpay payment link on <GetPaymentLinkSberPay> of <PaymentService>", zap.Error(err))
|
||||
return "", err
|
||||
}
|
||||
|
||||
return link, nil
|
||||
}
|
||||
|
||||
func (api *API2) GetPaymentLinkSBP(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := api.clients.payment.GetPaymentLinkSBP(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
UserID: request.UserID,
|
||||
ClientIP: request.ClientIP,
|
||||
CallbackHostGRPC: []string{api.grpc.Domen},
|
||||
ReturnURL: request.Body.ReturnURL,
|
||||
Customer: &treasurer.Customer{
|
||||
FullName: request.Customer.FullName,
|
||||
INN: request.Customer.INN,
|
||||
Email: request.Customer.Email,
|
||||
Phone: request.Customer.Phone,
|
||||
},
|
||||
Items: utils.ReceiptItemsToProto(request.Items),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
api.logger.Error("failed to get sberpay payment link on <GetPaymentLinkSberPay> of <PaymentService>", zap.Error(err))
|
||||
return "", err
|
||||
}
|
||||
|
||||
return link, nil
|
||||
}
|
||||
|
||||
func (api *API2) GetPaymentLinkTinkoff(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := api.clients.payment.GetPaymentLinkTinkoff(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
UserID: request.UserID,
|
||||
ClientIP: request.ClientIP,
|
||||
CallbackHostGRPC: []string{api.grpc.Domen},
|
||||
ReturnURL: request.Body.ReturnURL,
|
||||
Customer: &treasurer.Customer{
|
||||
FullName: request.Customer.FullName,
|
||||
INN: request.Customer.INN,
|
||||
Email: request.Customer.Email,
|
||||
Phone: request.Customer.Phone,
|
||||
},
|
||||
Items: utils.ReceiptItemsToProto(request.Items),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
api.logger.Error("failed to get tinkoff payment link on <GetPaymentLinkTinkoff> of <PaymentService>", zap.Error(err))
|
||||
return "", err
|
||||
}
|
||||
|
||||
return link, nil
|
||||
}
|
@ -41,6 +41,9 @@ type ServiceConfiguration struct {
|
||||
PubKey string `env:"PUBLIC_KEY"`
|
||||
PrivKey string `env:"PRIVATE_KEY"`
|
||||
ModuleLogger string `env:"MODULE_LOGGER"`
|
||||
NotificationBotToken string `env:"NOTIFICATION_BOT_TOKEN"`
|
||||
NotificationChannel int64 `env:"NOTIFICATION_CHANNEL"`
|
||||
AdminURL string `env:"ADMIN_FRONT_URL"`
|
||||
}
|
||||
|
||||
type KafkaConfiguration struct {
|
||||
|
@ -5,29 +5,28 @@ type GetPaymentLinkBody struct {
|
||||
Currency string `json:"currency"`
|
||||
Amount int64 `json:"amount"`
|
||||
ReturnURL string `json:"returnUrl,omitempty"`
|
||||
PhoneNumber string `json:"phoneNumber,omitempty"`
|
||||
Login string `json:"login,omitempty"`
|
||||
BankCard *BankCard `json:"bankCard,omitempty"`
|
||||
}
|
||||
|
||||
type GetPaymentLinkRequest struct {
|
||||
Body *GetPaymentLinkBody
|
||||
ClientIP string
|
||||
UserID string
|
||||
Customer Customer
|
||||
Items []Item
|
||||
}
|
||||
|
||||
type Customer struct {
|
||||
FullName, INN, Email, Phone string
|
||||
}
|
||||
|
||||
type Item struct {
|
||||
Description, Measure, Quantity, Money, Currency string
|
||||
}
|
||||
|
||||
type GetPaymentLinkResponse struct {
|
||||
Link string `json:"link"`
|
||||
}
|
||||
|
||||
type BankCard struct {
|
||||
Number string `json:"number"`
|
||||
ExpiryYear string `json:"expiryYear"`
|
||||
ExpiryMonth string `json:"expiryMonth"`
|
||||
CSC *string `json:"csc,omitempty"`
|
||||
CardHolderName *string `json:"cardholder,omitempty"`
|
||||
}
|
||||
|
||||
type PaymentType string
|
||||
|
||||
const (
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: broker/models.proto
|
||||
|
||||
|
306
internal/proto/codeword_rpc/promo.pb.go
Normal file
306
internal/proto/codeword_rpc/promo.pb.go
Normal file
@ -0,0 +1,306 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: codeword/promo.proto
|
||||
|
||||
package codeword_rpc
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Time struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
From int64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"`
|
||||
To int64 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Time) Reset() {
|
||||
*x = Time{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_codeword_promo_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Time) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Time) ProtoMessage() {}
|
||||
|
||||
func (x *Time) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_codeword_promo_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Time.ProtoReflect.Descriptor instead.
|
||||
func (*Time) Descriptor() ([]byte, []int) {
|
||||
return file_codeword_promo_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Time) GetFrom() int64 {
|
||||
if x != nil {
|
||||
return x.From
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Time) GetTo() int64 {
|
||||
if x != nil {
|
||||
return x.To
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type PromoActivationResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
|
||||
Users []*PromoActivationResp_UserTime `protobuf:"bytes,2,rep,name=Users,proto3" json:"Users,omitempty"`
|
||||
}
|
||||
|
||||
func (x *PromoActivationResp) Reset() {
|
||||
*x = PromoActivationResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_codeword_promo_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PromoActivationResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PromoActivationResp) ProtoMessage() {}
|
||||
|
||||
func (x *PromoActivationResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_codeword_promo_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PromoActivationResp.ProtoReflect.Descriptor instead.
|
||||
func (*PromoActivationResp) Descriptor() ([]byte, []int) {
|
||||
return file_codeword_promo_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *PromoActivationResp) GetID() string {
|
||||
if x != nil {
|
||||
return x.ID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PromoActivationResp) GetUsers() []*PromoActivationResp_UserTime {
|
||||
if x != nil {
|
||||
return x.Users
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type PromoActivationResp_UserTime struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"`
|
||||
Time int64 `protobuf:"varint,2,opt,name=Time,proto3" json:"Time,omitempty"`
|
||||
}
|
||||
|
||||
func (x *PromoActivationResp_UserTime) Reset() {
|
||||
*x = PromoActivationResp_UserTime{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_codeword_promo_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PromoActivationResp_UserTime) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PromoActivationResp_UserTime) ProtoMessage() {}
|
||||
|
||||
func (x *PromoActivationResp_UserTime) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_codeword_promo_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PromoActivationResp_UserTime.ProtoReflect.Descriptor instead.
|
||||
func (*PromoActivationResp_UserTime) Descriptor() ([]byte, []int) {
|
||||
return file_codeword_promo_proto_rawDescGZIP(), []int{1, 0}
|
||||
}
|
||||
|
||||
func (x *PromoActivationResp_UserTime) GetUserID() string {
|
||||
if x != nil {
|
||||
return x.UserID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PromoActivationResp_UserTime) GetTime() int64 {
|
||||
if x != nil {
|
||||
return x.Time
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_codeword_promo_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_codeword_promo_proto_rawDesc = []byte{
|
||||
0x0a, 0x14, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x6f,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64,
|
||||
0x22, 0x2a, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02,
|
||||
0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x74, 0x6f, 0x22, 0x9b, 0x01, 0x0a,
|
||||
0x13, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x02, 0x49, 0x44, 0x12, 0x3c, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x50,
|
||||
0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
|
||||
0x73, 0x70, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x05, 0x55, 0x73, 0x65,
|
||||
0x72, 0x73, 0x1a, 0x36, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16,
|
||||
0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
|
||||
0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x5d, 0x0a, 0x10, 0x50, 0x72,
|
||||
0x6f, 0x6d, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49,
|
||||
0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74,
|
||||
0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0e, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x77,
|
||||
0x6f, 0x72, 0x64, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x1d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x77,
|
||||
0x6f, 0x72, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x30, 0x01, 0x42, 0x10, 0x5a, 0x0e, 0x2e, 0x2f, 0x63,
|
||||
0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_codeword_promo_proto_rawDescOnce sync.Once
|
||||
file_codeword_promo_proto_rawDescData = file_codeword_promo_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_codeword_promo_proto_rawDescGZIP() []byte {
|
||||
file_codeword_promo_proto_rawDescOnce.Do(func() {
|
||||
file_codeword_promo_proto_rawDescData = protoimpl.X.CompressGZIP(file_codeword_promo_proto_rawDescData)
|
||||
})
|
||||
return file_codeword_promo_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_codeword_promo_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_codeword_promo_proto_goTypes = []interface{}{
|
||||
(*Time)(nil), // 0: codeword.Time
|
||||
(*PromoActivationResp)(nil), // 1: codeword.PromoActivationResp
|
||||
(*PromoActivationResp_UserTime)(nil), // 2: codeword.PromoActivationResp.UserTime
|
||||
}
|
||||
var file_codeword_promo_proto_depIdxs = []int32{
|
||||
2, // 0: codeword.PromoActivationResp.Users:type_name -> codeword.PromoActivationResp.UserTime
|
||||
0, // 1: codeword.PromoCodeService.GetAllPromoActivations:input_type -> codeword.Time
|
||||
1, // 2: codeword.PromoCodeService.GetAllPromoActivations:output_type -> codeword.PromoActivationResp
|
||||
2, // [2:3] is the sub-list for method output_type
|
||||
1, // [1:2] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_codeword_promo_proto_init() }
|
||||
func file_codeword_promo_proto_init() {
|
||||
if File_codeword_promo_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_codeword_promo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Time); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_codeword_promo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PromoActivationResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_codeword_promo_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PromoActivationResp_UserTime); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_codeword_promo_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_codeword_promo_proto_goTypes,
|
||||
DependencyIndexes: file_codeword_promo_proto_depIdxs,
|
||||
MessageInfos: file_codeword_promo_proto_msgTypes,
|
||||
}.Build()
|
||||
File_codeword_promo_proto = out.File
|
||||
file_codeword_promo_proto_rawDesc = nil
|
||||
file_codeword_promo_proto_goTypes = nil
|
||||
file_codeword_promo_proto_depIdxs = nil
|
||||
}
|
134
internal/proto/codeword_rpc/promo_grpc.pb.go
Normal file
134
internal/proto/codeword_rpc/promo_grpc.pb.go
Normal file
@ -0,0 +1,134 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: codeword/promo.proto
|
||||
|
||||
package codeword_rpc
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
PromoCodeService_GetAllPromoActivations_FullMethodName = "/codeword.PromoCodeService/GetAllPromoActivations"
|
||||
)
|
||||
|
||||
// PromoCodeServiceClient is the client API for PromoCodeService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type PromoCodeServiceClient interface {
|
||||
GetAllPromoActivations(ctx context.Context, in *Time, opts ...grpc.CallOption) (PromoCodeService_GetAllPromoActivationsClient, error)
|
||||
}
|
||||
|
||||
type promoCodeServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPromoCodeServiceClient(cc grpc.ClientConnInterface) PromoCodeServiceClient {
|
||||
return &promoCodeServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *promoCodeServiceClient) GetAllPromoActivations(ctx context.Context, in *Time, opts ...grpc.CallOption) (PromoCodeService_GetAllPromoActivationsClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &PromoCodeService_ServiceDesc.Streams[0], PromoCodeService_GetAllPromoActivations_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &promoCodeServiceGetAllPromoActivationsClient{stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type PromoCodeService_GetAllPromoActivationsClient interface {
|
||||
Recv() (*PromoActivationResp, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type promoCodeServiceGetAllPromoActivationsClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *promoCodeServiceGetAllPromoActivationsClient) Recv() (*PromoActivationResp, error) {
|
||||
m := new(PromoActivationResp)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// PromoCodeServiceServer is the server API for PromoCodeService service.
|
||||
// All implementations should embed UnimplementedPromoCodeServiceServer
|
||||
// for forward compatibility
|
||||
type PromoCodeServiceServer interface {
|
||||
GetAllPromoActivations(*Time, PromoCodeService_GetAllPromoActivationsServer) error
|
||||
}
|
||||
|
||||
// UnimplementedPromoCodeServiceServer should be embedded to have forward compatible implementations.
|
||||
type UnimplementedPromoCodeServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedPromoCodeServiceServer) GetAllPromoActivations(*Time, PromoCodeService_GetAllPromoActivationsServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method GetAllPromoActivations not implemented")
|
||||
}
|
||||
|
||||
// UnsafePromoCodeServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PromoCodeServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePromoCodeServiceServer interface {
|
||||
mustEmbedUnimplementedPromoCodeServiceServer()
|
||||
}
|
||||
|
||||
func RegisterPromoCodeServiceServer(s grpc.ServiceRegistrar, srv PromoCodeServiceServer) {
|
||||
s.RegisterService(&PromoCodeService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PromoCodeService_GetAllPromoActivations_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(Time)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(PromoCodeServiceServer).GetAllPromoActivations(m, &promoCodeServiceGetAllPromoActivationsServer{stream})
|
||||
}
|
||||
|
||||
type PromoCodeService_GetAllPromoActivationsServer interface {
|
||||
Send(*PromoActivationResp) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type promoCodeServiceGetAllPromoActivationsServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *promoCodeServiceGetAllPromoActivationsServer) Send(m *PromoActivationResp) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
// PromoCodeService_ServiceDesc is the grpc.ServiceDesc for PromoCodeService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PromoCodeService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "codeword.PromoCodeService",
|
||||
HandlerType: (*PromoCodeServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "GetAllPromoActivations",
|
||||
Handler: _PromoCodeService_GetAllPromoActivations_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "codeword/promo.proto",
|
||||
}
|
@ -1,4 +1,8 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: customer/service.proto
|
||||
|
||||
package customer
|
||||
|
||||
@ -15,6 +19,10 @@ import (
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
CustomerService_InsertHistory_FullMethodName = "/customer.CustomerService/InsertHistory"
|
||||
)
|
||||
|
||||
// CustomerServiceClient is the client API for CustomerService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
@ -33,7 +41,7 @@ func NewCustomerServiceClient(cc grpc.ClientConnInterface) CustomerServiceClient
|
||||
|
||||
func (c *customerServiceClient) InsertHistory(ctx context.Context, in *History, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/customer.CustomerService/InsertHistory", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CustomerService_InsertHistory_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -91,7 +99,7 @@ func _CustomerService_InsertHistory_Handler(srv interface{}, ctx context.Context
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/customer.CustomerService/InsertHistory",
|
||||
FullMethod: CustomerService_InsertHistory_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CustomerServiceServer).InsertHistory(ctx, req.(*History))
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: discount/audit.model.proto
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: discount/discount.model.proto
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: discount/service.proto
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: discount/service.proto
|
||||
|
||||
@ -19,6 +19,18 @@ import (
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
DiscountService_GetAllDiscounts_FullMethodName = "/discount.DiscountService/GetAllDiscounts"
|
||||
DiscountService_GetUserDiscounts_FullMethodName = "/discount.DiscountService/GetUserDiscounts"
|
||||
DiscountService_DetermineDiscounts_FullMethodName = "/discount.DiscountService/DetermineDiscounts"
|
||||
DiscountService_ApplyDiscounts_FullMethodName = "/discount.DiscountService/ApplyDiscounts"
|
||||
DiscountService_GetDiscountByID_FullMethodName = "/discount.DiscountService/GetDiscountByID"
|
||||
DiscountService_CreateDiscount_FullMethodName = "/discount.DiscountService/CreateDiscount"
|
||||
DiscountService_ReplaceDiscount_FullMethodName = "/discount.DiscountService/ReplaceDiscount"
|
||||
DiscountService_UpdateDiscount_FullMethodName = "/discount.DiscountService/UpdateDiscount"
|
||||
DiscountService_DeleteDiscount_FullMethodName = "/discount.DiscountService/DeleteDiscount"
|
||||
)
|
||||
|
||||
// DiscountServiceClient is the client API for DiscountService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
@ -44,7 +56,7 @@ func NewDiscountServiceClient(cc grpc.ClientConnInterface) DiscountServiceClient
|
||||
|
||||
func (c *discountServiceClient) GetAllDiscounts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Discounts, error) {
|
||||
out := new(Discounts)
|
||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/GetAllDiscounts", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, DiscountService_GetAllDiscounts_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -53,7 +65,7 @@ func (c *discountServiceClient) GetAllDiscounts(ctx context.Context, in *emptypb
|
||||
|
||||
func (c *discountServiceClient) GetUserDiscounts(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discounts, error) {
|
||||
out := new(Discounts)
|
||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/GetUserDiscounts", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, DiscountService_GetUserDiscounts_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -62,7 +74,7 @@ func (c *discountServiceClient) GetUserDiscounts(ctx context.Context, in *GetDis
|
||||
|
||||
func (c *discountServiceClient) DetermineDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*Discounts, error) {
|
||||
out := new(Discounts)
|
||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/DetermineDiscounts", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, DiscountService_DetermineDiscounts_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -71,7 +83,7 @@ func (c *discountServiceClient) DetermineDiscounts(ctx context.Context, in *Appl
|
||||
|
||||
func (c *discountServiceClient) ApplyDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*ApplyDiscountResponse, error) {
|
||||
out := new(ApplyDiscountResponse)
|
||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/ApplyDiscounts", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, DiscountService_ApplyDiscounts_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -80,7 +92,7 @@ func (c *discountServiceClient) ApplyDiscounts(ctx context.Context, in *ApplyDis
|
||||
|
||||
func (c *discountServiceClient) GetDiscountByID(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) {
|
||||
out := new(Discount)
|
||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/GetDiscountByID", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, DiscountService_GetDiscountByID_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -89,7 +101,7 @@ func (c *discountServiceClient) GetDiscountByID(ctx context.Context, in *GetDisc
|
||||
|
||||
func (c *discountServiceClient) CreateDiscount(ctx context.Context, in *CreateDiscountRequest, opts ...grpc.CallOption) (*Discount, error) {
|
||||
out := new(Discount)
|
||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/CreateDiscount", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, DiscountService_CreateDiscount_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -98,7 +110,7 @@ func (c *discountServiceClient) CreateDiscount(ctx context.Context, in *CreateDi
|
||||
|
||||
func (c *discountServiceClient) ReplaceDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) {
|
||||
out := new(Discount)
|
||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/ReplaceDiscount", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, DiscountService_ReplaceDiscount_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -107,7 +119,7 @@ func (c *discountServiceClient) ReplaceDiscount(ctx context.Context, in *Discoun
|
||||
|
||||
func (c *discountServiceClient) UpdateDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) {
|
||||
out := new(Discount)
|
||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/UpdateDiscount", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, DiscountService_UpdateDiscount_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -116,7 +128,7 @@ func (c *discountServiceClient) UpdateDiscount(ctx context.Context, in *Discount
|
||||
|
||||
func (c *discountServiceClient) DeleteDiscount(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) {
|
||||
out := new(Discount)
|
||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/DeleteDiscount", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, DiscountService_DeleteDiscount_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -191,7 +203,7 @@ func _DiscountService_GetAllDiscounts_Handler(srv interface{}, ctx context.Conte
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/discount.DiscountService/GetAllDiscounts",
|
||||
FullMethod: DiscountService_GetAllDiscounts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiscountServiceServer).GetAllDiscounts(ctx, req.(*emptypb.Empty))
|
||||
@ -209,7 +221,7 @@ func _DiscountService_GetUserDiscounts_Handler(srv interface{}, ctx context.Cont
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/discount.DiscountService/GetUserDiscounts",
|
||||
FullMethod: DiscountService_GetUserDiscounts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiscountServiceServer).GetUserDiscounts(ctx, req.(*GetDiscountByIDRequest))
|
||||
@ -227,7 +239,7 @@ func _DiscountService_DetermineDiscounts_Handler(srv interface{}, ctx context.Co
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/discount.DiscountService/DetermineDiscounts",
|
||||
FullMethod: DiscountService_DetermineDiscounts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiscountServiceServer).DetermineDiscounts(ctx, req.(*ApplyDiscountRequest))
|
||||
@ -245,7 +257,7 @@ func _DiscountService_ApplyDiscounts_Handler(srv interface{}, ctx context.Contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/discount.DiscountService/ApplyDiscounts",
|
||||
FullMethod: DiscountService_ApplyDiscounts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiscountServiceServer).ApplyDiscounts(ctx, req.(*ApplyDiscountRequest))
|
||||
@ -263,7 +275,7 @@ func _DiscountService_GetDiscountByID_Handler(srv interface{}, ctx context.Conte
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/discount.DiscountService/GetDiscountByID",
|
||||
FullMethod: DiscountService_GetDiscountByID_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiscountServiceServer).GetDiscountByID(ctx, req.(*GetDiscountByIDRequest))
|
||||
@ -281,7 +293,7 @@ func _DiscountService_CreateDiscount_Handler(srv interface{}, ctx context.Contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/discount.DiscountService/CreateDiscount",
|
||||
FullMethod: DiscountService_CreateDiscount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiscountServiceServer).CreateDiscount(ctx, req.(*CreateDiscountRequest))
|
||||
@ -299,7 +311,7 @@ func _DiscountService_ReplaceDiscount_Handler(srv interface{}, ctx context.Conte
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/discount.DiscountService/ReplaceDiscount",
|
||||
FullMethod: DiscountService_ReplaceDiscount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiscountServiceServer).ReplaceDiscount(ctx, req.(*DiscountOptional))
|
||||
@ -317,7 +329,7 @@ func _DiscountService_UpdateDiscount_Handler(srv interface{}, ctx context.Contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/discount.DiscountService/UpdateDiscount",
|
||||
FullMethod: DiscountService_UpdateDiscount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiscountServiceServer).UpdateDiscount(ctx, req.(*DiscountOptional))
|
||||
@ -335,7 +347,7 @@ func _DiscountService_DeleteDiscount_Handler(srv interface{}, ctx context.Contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/discount.DiscountService/DeleteDiscount",
|
||||
FullMethod: DiscountService_DeleteDiscount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiscountServiceServer).DeleteDiscount(ctx, req.(*GetDiscountByIDRequest))
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: google/api/annotations.proto
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: google/api/http.proto
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: callback/service.proto
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: callback/service.proto
|
||||
|
||||
@ -19,6 +19,11 @@ import (
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
PaymentCallbackService_OnSuccess_FullMethodName = "/payment_callback.PaymentCallbackService/OnSuccess"
|
||||
PaymentCallbackService_OnFailure_FullMethodName = "/payment_callback.PaymentCallbackService/OnFailure"
|
||||
)
|
||||
|
||||
// PaymentCallbackServiceClient is the client API for PaymentCallbackService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
@ -37,7 +42,7 @@ func NewPaymentCallbackServiceClient(cc grpc.ClientConnInterface) PaymentCallbac
|
||||
|
||||
func (c *paymentCallbackServiceClient) OnSuccess(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/payment_callback.PaymentCallbackService/OnSuccess", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, PaymentCallbackService_OnSuccess_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -46,7 +51,7 @@ func (c *paymentCallbackServiceClient) OnSuccess(ctx context.Context, in *Event,
|
||||
|
||||
func (c *paymentCallbackServiceClient) OnFailure(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/payment_callback.PaymentCallbackService/OnFailure", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, PaymentCallbackService_OnFailure_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -93,7 +98,7 @@ func _PaymentCallbackService_OnSuccess_Handler(srv interface{}, ctx context.Cont
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/payment_callback.PaymentCallbackService/OnSuccess",
|
||||
FullMethod: PaymentCallbackService_OnSuccess_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentCallbackServiceServer).OnSuccess(ctx, req.(*Event))
|
||||
@ -111,7 +116,7 @@ func _PaymentCallbackService_OnFailure_Handler(srv interface{}, ctx context.Cont
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/payment_callback.PaymentCallbackService/OnFailure",
|
||||
FullMethod: PaymentCallbackService_OnFailure_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentCallbackServiceServer).OnFailure(ctx, req.(*Event))
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: treasurer/payment.model.proto
|
||||
|
||||
@ -31,6 +31,8 @@ type MainPaymentSettings struct {
|
||||
ReturnURL string `protobuf:"bytes,4,opt,name=ReturnURL,proto3" json:"ReturnURL,omitempty"`
|
||||
UserID string `protobuf:"bytes,5,opt,name=UserID,proto3" json:"UserID,omitempty"`
|
||||
ClientIP string `protobuf:"bytes,6,opt,name=ClientIP,proto3" json:"ClientIP,omitempty"`
|
||||
Customer *Customer `protobuf:"bytes,7,opt,name=Customer,proto3" json:"Customer,omitempty"`
|
||||
Items []*Item `protobuf:"bytes,8,rep,name=Items,proto3" json:"Items,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) Reset() {
|
||||
@ -107,20 +109,33 @@ func (x *MainPaymentSettings) GetClientIP() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type BankCardInformation struct {
|
||||
func (x *MainPaymentSettings) GetCustomer() *Customer {
|
||||
if x != nil {
|
||||
return x.Customer
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetItems() []*Item {
|
||||
if x != nil {
|
||||
return x.Items
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Customer struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Number string `protobuf:"bytes,1,opt,name=Number,proto3" json:"Number,omitempty"`
|
||||
ExpiryYear string `protobuf:"bytes,2,opt,name=ExpiryYear,proto3" json:"ExpiryYear,omitempty"`
|
||||
ExpiryMonth string `protobuf:"bytes,3,opt,name=ExpiryMonth,proto3" json:"ExpiryMonth,omitempty"`
|
||||
CSC *string `protobuf:"bytes,4,opt,name=CSC,proto3,oneof" json:"CSC,omitempty"`
|
||||
CardHolderName *string `protobuf:"bytes,5,opt,name=CardHolderName,proto3,oneof" json:"CardHolderName,omitempty"`
|
||||
FullName string `protobuf:"bytes,1,opt,name=FullName,proto3" json:"FullName,omitempty"`
|
||||
INN string `protobuf:"bytes,2,opt,name=INN,proto3" json:"INN,omitempty"`
|
||||
Email string `protobuf:"bytes,3,opt,name=Email,proto3" json:"Email,omitempty"`
|
||||
Phone string `protobuf:"bytes,4,opt,name=Phone,proto3" json:"Phone,omitempty"`
|
||||
}
|
||||
|
||||
func (x *BankCardInformation) Reset() {
|
||||
*x = BankCardInformation{}
|
||||
func (x *Customer) Reset() {
|
||||
*x = Customer{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_payment_model_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -128,13 +143,13 @@ func (x *BankCardInformation) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *BankCardInformation) String() string {
|
||||
func (x *Customer) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BankCardInformation) ProtoMessage() {}
|
||||
func (*Customer) ProtoMessage() {}
|
||||
|
||||
func (x *BankCardInformation) ProtoReflect() protoreflect.Message {
|
||||
func (x *Customer) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_payment_model_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -146,42 +161,114 @@ func (x *BankCardInformation) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BankCardInformation.ProtoReflect.Descriptor instead.
|
||||
func (*BankCardInformation) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use Customer.ProtoReflect.Descriptor instead.
|
||||
func (*Customer) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_payment_model_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *BankCardInformation) GetNumber() string {
|
||||
func (x *Customer) GetFullName() string {
|
||||
if x != nil {
|
||||
return x.Number
|
||||
return x.FullName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *BankCardInformation) GetExpiryYear() string {
|
||||
func (x *Customer) GetINN() string {
|
||||
if x != nil {
|
||||
return x.ExpiryYear
|
||||
return x.INN
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *BankCardInformation) GetExpiryMonth() string {
|
||||
func (x *Customer) GetEmail() string {
|
||||
if x != nil {
|
||||
return x.ExpiryMonth
|
||||
return x.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *BankCardInformation) GetCSC() string {
|
||||
if x != nil && x.CSC != nil {
|
||||
return *x.CSC
|
||||
func (x *Customer) GetPhone() string {
|
||||
if x != nil {
|
||||
return x.Phone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *BankCardInformation) GetCardHolderName() string {
|
||||
if x != nil && x.CardHolderName != nil {
|
||||
return *x.CardHolderName
|
||||
type Item struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Description string `protobuf:"bytes,1,opt,name=Description,proto3" json:"Description,omitempty"`
|
||||
Measure string `protobuf:"bytes,2,opt,name=Measure,proto3" json:"Measure,omitempty"`
|
||||
Quantity string `protobuf:"bytes,3,opt,name=Quantity,proto3" json:"Quantity,omitempty"`
|
||||
Money string `protobuf:"bytes,4,opt,name=Money,proto3" json:"Money,omitempty"`
|
||||
Currency string `protobuf:"bytes,5,opt,name=Currency,proto3" json:"Currency,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Item) Reset() {
|
||||
*x = Item{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_payment_model_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Item) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Item) ProtoMessage() {}
|
||||
|
||||
func (x *Item) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_payment_model_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Item.ProtoReflect.Descriptor instead.
|
||||
func (*Item) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_payment_model_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Item) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Item) GetMeasure() string {
|
||||
if x != nil {
|
||||
return x.Measure
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Item) GetQuantity() string {
|
||||
if x != nil {
|
||||
return x.Quantity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Item) GetMoney() string {
|
||||
if x != nil {
|
||||
return x.Money
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Item) GetCurrency() string {
|
||||
if x != nil {
|
||||
return x.Currency
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@ -191,7 +278,7 @@ var File_treasurer_payment_model_proto protoreflect.FileDescriptor
|
||||
var file_treasurer_payment_model_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x79, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x09, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x22, 0xc7, 0x01, 0x0a, 0x13, 0x4d,
|
||||
0x09, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x22, 0x9f, 0x02, 0x0a, 0x13, 0x4d,
|
||||
0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x16,
|
||||
@ -204,20 +291,28 @@ var file_treasurer_payment_model_proto_rawDesc = []byte{
|
||||
0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6c, 0x69, 0x65,
|
||||
0x6e, 0x74, 0x49, 0x50, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x6c, 0x69, 0x65,
|
||||
0x6e, 0x74, 0x49, 0x50, 0x22, 0xce, 0x01, 0x0a, 0x13, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72,
|
||||
0x64, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, 0x75,
|
||||
0x6d, 0x62, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x59, 0x65,
|
||||
0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79,
|
||||
0x59, 0x65, 0x61, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x4d, 0x6f,
|
||||
0x6e, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x78, 0x70, 0x69, 0x72,
|
||||
0x79, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x12, 0x15, 0x0a, 0x03, 0x43, 0x53, 0x43, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x43, 0x53, 0x43, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a,
|
||||
0x0e, 0x43, 0x61, 0x72, 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0e, 0x43, 0x61, 0x72, 0x64, 0x48, 0x6f, 0x6c,
|
||||
0x64, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x43,
|
||||
0x53, 0x43, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x43, 0x61, 0x72, 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x65,
|
||||
0x72, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x74, 0x72, 0x65, 0x61, 0x73,
|
||||
0x6e, 0x74, 0x49, 0x50, 0x12, 0x2f, 0x0a, 0x08, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72,
|
||||
0x65, 0x72, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x52, 0x08, 0x43, 0x75, 0x73,
|
||||
0x74, 0x6f, 0x6d, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x08,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72,
|
||||
0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x64, 0x0a, 0x08,
|
||||
0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x46, 0x75, 0x6c, 0x6c,
|
||||
0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x46, 0x75, 0x6c, 0x6c,
|
||||
0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x49, 0x4e, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x03, 0x49, 0x4e, 0x4e, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x50, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x50, 0x68, 0x6f,
|
||||
0x6e, 0x65, 0x22, 0x90, 0x01, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x44,
|
||||
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||
0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74,
|
||||
0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74,
|
||||
0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x05, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x75, 0x72,
|
||||
0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x75, 0x72,
|
||||
0x72, 0x65, 0x6e, 0x63, 0x79, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x74, 0x72, 0x65, 0x61, 0x73,
|
||||
0x75, 0x72, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
@ -233,17 +328,20 @@ func file_treasurer_payment_model_proto_rawDescGZIP() []byte {
|
||||
return file_treasurer_payment_model_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_treasurer_payment_model_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_treasurer_payment_model_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_treasurer_payment_model_proto_goTypes = []interface{}{
|
||||
(*MainPaymentSettings)(nil), // 0: treasurer.MainPaymentSettings
|
||||
(*BankCardInformation)(nil), // 1: treasurer.BankCardInformation
|
||||
(*Customer)(nil), // 1: treasurer.Customer
|
||||
(*Item)(nil), // 2: treasurer.Item
|
||||
}
|
||||
var file_treasurer_payment_model_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
1, // 0: treasurer.MainPaymentSettings.Customer:type_name -> treasurer.Customer
|
||||
2, // 1: treasurer.MainPaymentSettings.Items:type_name -> treasurer.Item
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_treasurer_payment_model_proto_init() }
|
||||
@ -265,7 +363,19 @@ func file_treasurer_payment_model_proto_init() {
|
||||
}
|
||||
}
|
||||
file_treasurer_payment_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BankCardInformation); i {
|
||||
switch v := v.(*Customer); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_treasurer_payment_model_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Item); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@ -277,14 +387,13 @@ func file_treasurer_payment_model_proto_init() {
|
||||
}
|
||||
}
|
||||
}
|
||||
file_treasurer_payment_model_proto_msgTypes[1].OneofWrappers = []interface{}{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_treasurer_payment_model_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: treasurer/service.proto
|
||||
|
||||
@ -27,7 +27,6 @@ type GetBankCardPaymentLinkRequest struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
MainSettings *MainPaymentSettings `protobuf:"bytes,1,opt,name=MainSettings,proto3" json:"MainSettings,omitempty"`
|
||||
BankCard *BankCardInformation `protobuf:"bytes,2,opt,name=BankCard,proto3" json:"BankCard,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetBankCardPaymentLinkRequest) Reset() {
|
||||
@ -69,14 +68,7 @@ func (x *GetBankCardPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetBankCardPaymentLinkRequest) GetBankCard() *BankCardInformation {
|
||||
if x != nil {
|
||||
return x.BankCard
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetPaymentLinkBody struct {
|
||||
type GetPaymentLinkRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@ -84,8 +76,8 @@ type GetPaymentLinkBody struct {
|
||||
MainSettings *MainPaymentSettings `protobuf:"bytes,1,opt,name=MainSettings,proto3" json:"MainSettings,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetPaymentLinkBody) Reset() {
|
||||
*x = GetPaymentLinkBody{}
|
||||
func (x *GetPaymentLinkRequest) Reset() {
|
||||
*x = GetPaymentLinkRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -93,13 +85,13 @@ func (x *GetPaymentLinkBody) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetPaymentLinkBody) String() string {
|
||||
func (x *GetPaymentLinkRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetPaymentLinkBody) ProtoMessage() {}
|
||||
func (*GetPaymentLinkRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetPaymentLinkBody) ProtoReflect() protoreflect.Message {
|
||||
func (x *GetPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -111,128 +103,18 @@ func (x *GetPaymentLinkBody) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetPaymentLinkBody.ProtoReflect.Descriptor instead.
|
||||
func (*GetPaymentLinkBody) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use GetPaymentLinkRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetPaymentLinkRequest) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetPaymentLinkBody) GetMainSettings() *MainPaymentSettings {
|
||||
func (x *GetPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
||||
if x != nil {
|
||||
return x.MainSettings
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetPhonePaymentLinkRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
MainSettings *MainPaymentSettings `protobuf:"bytes,1,opt,name=MainSettings,proto3" json:"MainSettings,omitempty"`
|
||||
Phone string `protobuf:"bytes,2,opt,name=Phone,proto3" json:"Phone,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetPhonePaymentLinkRequest) Reset() {
|
||||
*x = GetPhonePaymentLinkRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetPhonePaymentLinkRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetPhonePaymentLinkRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetPhonePaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_service_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetPhonePaymentLinkRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetPhonePaymentLinkRequest) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_service_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *GetPhonePaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
||||
if x != nil {
|
||||
return x.MainSettings
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetPhonePaymentLinkRequest) GetPhone() string {
|
||||
if x != nil {
|
||||
return x.Phone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetLoginPaymentLinkRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
MainSettings *MainPaymentSettings `protobuf:"bytes,1,opt,name=MainSettings,proto3" json:"MainSettings,omitempty"`
|
||||
Login string `protobuf:"bytes,2,opt,name=Login,proto3" json:"Login,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetLoginPaymentLinkRequest) Reset() {
|
||||
*x = GetLoginPaymentLinkRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetLoginPaymentLinkRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetLoginPaymentLinkRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetLoginPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_service_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetLoginPaymentLinkRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetLoginPaymentLinkRequest) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_service_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *GetLoginPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
||||
if x != nil {
|
||||
return x.MainSettings
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetLoginPaymentLinkRequest) GetLogin() string {
|
||||
if x != nil {
|
||||
return x.Login
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetB2BPaymentLinkRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@ -246,7 +128,7 @@ type GetB2BPaymentLinkRequest struct {
|
||||
func (x *GetB2BPaymentLinkRequest) Reset() {
|
||||
*x = GetB2BPaymentLinkRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_service_proto_msgTypes[4]
|
||||
mi := &file_treasurer_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -259,7 +141,7 @@ func (x *GetB2BPaymentLinkRequest) String() string {
|
||||
func (*GetB2BPaymentLinkRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetB2BPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_service_proto_msgTypes[4]
|
||||
mi := &file_treasurer_service_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -272,7 +154,7 @@ func (x *GetB2BPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetB2BPaymentLinkRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetB2BPaymentLinkRequest) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_service_proto_rawDescGZIP(), []int{4}
|
||||
return file_treasurer_service_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *GetB2BPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
||||
@ -307,7 +189,7 @@ type GetPaymentLinkResponse struct {
|
||||
func (x *GetPaymentLinkResponse) Reset() {
|
||||
*x = GetPaymentLinkResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_service_proto_msgTypes[5]
|
||||
mi := &file_treasurer_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -320,7 +202,7 @@ func (x *GetPaymentLinkResponse) String() string {
|
||||
func (*GetPaymentLinkResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetPaymentLinkResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_service_proto_msgTypes[5]
|
||||
mi := &file_treasurer_service_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -333,7 +215,7 @@ func (x *GetPaymentLinkResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetPaymentLinkResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetPaymentLinkResponse) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_service_proto_rawDescGZIP(), []int{5}
|
||||
return file_treasurer_service_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *GetPaymentLinkResponse) GetRedirectURL() string {
|
||||
@ -352,91 +234,73 @@ var file_treasurer_service_proto_rawDesc = []byte{
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x1a, 0x1d, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x79,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x22, 0x9f, 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72, 0x64,
|
||||
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73,
|
||||
0x75, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65,
|
||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61,
|
||||
0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73,
|
||||
0x75, 0x72, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66,
|
||||
0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61,
|
||||
0x72, 0x64, 0x22, 0x58, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e,
|
||||
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e,
|
||||
0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50,
|
||||
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c,
|
||||
0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x76, 0x0a, 0x1a,
|
||||
0x47, 0x65, 0x74, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c,
|
||||
0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61,
|
||||
0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69,
|
||||
0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73,
|
||||
0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x50,
|
||||
0x68, 0x6f, 0x6e, 0x65, 0x22, 0x76, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
|
||||
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73,
|
||||
0x75, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65,
|
||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0xb8, 0x01, 0x0a,
|
||||
0x18, 0x47, 0x65, 0x74, 0x42, 0x32, 0x42, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
|
||||
0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69,
|
||||
0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e,
|
||||
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52,
|
||||
0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x26, 0x0a,
|
||||
0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x75,
|
||||
0x72, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x56, 0x61, 0x74, 0x44, 0x61, 0x74, 0x61,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x07,
|
||||
0x56, 0x61, 0x74, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3a, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x61,
|
||||
0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x55, 0x52, 0x4c,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74,
|
||||
0x55, 0x52, 0x4c, 0x32, 0xcd, 0x04, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65,
|
||||
0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x67, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50,
|
||||
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61,
|
||||
0x72, 0x64, 0x12, 0x28, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47,
|
||||
0x65, 0x74, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72, 0x64, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e,
|
||||
0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74,
|
||||
0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x12, 0x5c, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c,
|
||||
0x69, 0x6e, 0x6b, 0x59, 0x6f, 0x6f, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x1d, 0x2e, 0x74, 0x72,
|
||||
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x65,
|
||||
0x22, 0x63, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72, 0x64, 0x50,
|
||||
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
|
||||
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75,
|
||||
0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53,
|
||||
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74,
|
||||
0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x5b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42,
|
||||
0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72,
|
||||
0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74,
|
||||
0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x73, 0x22, 0xb8, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x42, 0x32, 0x42, 0x50, 0x61, 0x79,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
||||
0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65,
|
||||
0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74,
|
||||
0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69,
|
||||
0x6e, 0x67, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x75,
|
||||
0x72, 0x70, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x50, 0x61, 0x79,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x50, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x56,
|
||||
0x61, 0x74, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67,
|
||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,
|
||||
0x6d, 0x70, 0x74, 0x79, 0x52, 0x07, 0x56, 0x61, 0x74, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3a, 0x0a,
|
||||
0x16, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x64, 0x69, 0x72,
|
||||
0x65, 0x63, 0x74, 0x55, 0x52, 0x4c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65,
|
||||
0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x55, 0x52, 0x4c, 0x32, 0xd4, 0x04, 0x0a, 0x10, 0x54, 0x72,
|
||||
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f,
|
||||
0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b,
|
||||
0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72, 0x64, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73,
|
||||
0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c,
|
||||
0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x65,
|
||||
0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e,
|
||||
0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
||||
0x5b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e,
|
||||
0x6b, 0x53, 0x62, 0x65, 0x72, 0x50, 0x61, 0x79, 0x12, 0x1d, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73,
|
||||
0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c,
|
||||
0x69, 0x6e, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75,
|
||||
0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
|
||||
0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x15,
|
||||
0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x54, 0x69,
|
||||
0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x12, 0x1d, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65,
|
||||
0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b,
|
||||
0x42, 0x6f, 0x64, 0x79, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72,
|
||||
0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x19, 0x47, 0x65, 0x74,
|
||||
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x62, 0x65, 0x72, 0x62,
|
||||
0x61, 0x6e, 0x6b, 0x42, 0x32, 0x42, 0x12, 0x1d, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72,
|
||||
0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e,
|
||||
0x6b, 0x42, 0x6f, 0x64, 0x79, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65,
|
||||
0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x11, 0x47, 0x65,
|
||||
0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x42, 0x50, 0x12,
|
||||
0x1d, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50,
|
||||
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x1a, 0x21,
|
||||
0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61,
|
||||
0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x00, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72,
|
||||
0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x5f, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e,
|
||||
0x6b, 0x59, 0x6f, 0x6f, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61,
|
||||
0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x72,
|
||||
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||
0x12, 0x5e, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
|
||||
0x6e, 0x6b, 0x54, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61,
|
||||
0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x72,
|
||||
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||
0x12, 0x62, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
|
||||
0x6e, 0x6b, 0x53, 0x62, 0x65, 0x72, 0x62, 0x61, 0x6e, 0x6b, 0x42, 0x32, 0x42, 0x12, 0x20, 0x2e,
|
||||
0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x21, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50,
|
||||
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x42, 0x50, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61,
|
||||
0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x72,
|
||||
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||
0x12, 0x5e, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
|
||||
0x6e, 0x6b, 0x53, 0x62, 0x65, 0x72, 0x50, 0x61, 0x79, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61,
|
||||
0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x72,
|
||||
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||
0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -451,43 +315,37 @@ func file_treasurer_service_proto_rawDescGZIP() []byte {
|
||||
return file_treasurer_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_treasurer_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_treasurer_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_treasurer_service_proto_goTypes = []interface{}{
|
||||
(*GetBankCardPaymentLinkRequest)(nil), // 0: treasurer.GetBankCardPaymentLinkRequest
|
||||
(*GetPaymentLinkBody)(nil), // 1: treasurer.GetPaymentLinkBody
|
||||
(*GetPhonePaymentLinkRequest)(nil), // 2: treasurer.GetPhonePaymentLinkRequest
|
||||
(*GetLoginPaymentLinkRequest)(nil), // 3: treasurer.GetLoginPaymentLinkRequest
|
||||
(*GetB2BPaymentLinkRequest)(nil), // 4: treasurer.GetB2BPaymentLinkRequest
|
||||
(*GetPaymentLinkResponse)(nil), // 5: treasurer.GetPaymentLinkResponse
|
||||
(*MainPaymentSettings)(nil), // 6: treasurer.MainPaymentSettings
|
||||
(*BankCardInformation)(nil), // 7: treasurer.BankCardInformation
|
||||
(*emptypb.Empty)(nil), // 8: google.protobuf.Empty
|
||||
(*GetPaymentLinkRequest)(nil), // 1: treasurer.GetPaymentLinkRequest
|
||||
(*GetB2BPaymentLinkRequest)(nil), // 2: treasurer.GetB2BPaymentLinkRequest
|
||||
(*GetPaymentLinkResponse)(nil), // 3: treasurer.GetPaymentLinkResponse
|
||||
(*MainPaymentSettings)(nil), // 4: treasurer.MainPaymentSettings
|
||||
(*emptypb.Empty)(nil), // 5: google.protobuf.Empty
|
||||
}
|
||||
var file_treasurer_service_proto_depIdxs = []int32{
|
||||
6, // 0: treasurer.GetBankCardPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
7, // 1: treasurer.GetBankCardPaymentLinkRequest.BankCard:type_name -> treasurer.BankCardInformation
|
||||
6, // 2: treasurer.GetPaymentLinkBody.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
6, // 3: treasurer.GetPhonePaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
6, // 4: treasurer.GetLoginPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
6, // 5: treasurer.GetB2BPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
8, // 6: treasurer.GetB2BPaymentLinkRequest.VatData:type_name -> google.protobuf.Empty
|
||||
0, // 7: treasurer.TreasurerService.GetPaymentLinkBankCard:input_type -> treasurer.GetBankCardPaymentLinkRequest
|
||||
1, // 8: treasurer.TreasurerService.GetPaymentLinkYooMoney:input_type -> treasurer.GetPaymentLinkBody
|
||||
1, // 9: treasurer.TreasurerService.GetPaymentLinkSberPay:input_type -> treasurer.GetPaymentLinkBody
|
||||
1, // 10: treasurer.TreasurerService.GetPaymentLinkTinkoff:input_type -> treasurer.GetPaymentLinkBody
|
||||
1, // 11: treasurer.TreasurerService.GetPaymentLinkSberbankB2B:input_type -> treasurer.GetPaymentLinkBody
|
||||
1, // 12: treasurer.TreasurerService.GetPaymentLinkSBP:input_type -> treasurer.GetPaymentLinkBody
|
||||
5, // 13: treasurer.TreasurerService.GetPaymentLinkBankCard:output_type -> treasurer.GetPaymentLinkResponse
|
||||
5, // 14: treasurer.TreasurerService.GetPaymentLinkYooMoney:output_type -> treasurer.GetPaymentLinkResponse
|
||||
5, // 15: treasurer.TreasurerService.GetPaymentLinkSberPay:output_type -> treasurer.GetPaymentLinkResponse
|
||||
5, // 16: treasurer.TreasurerService.GetPaymentLinkTinkoff:output_type -> treasurer.GetPaymentLinkResponse
|
||||
5, // 17: treasurer.TreasurerService.GetPaymentLinkSberbankB2B:output_type -> treasurer.GetPaymentLinkResponse
|
||||
5, // 18: treasurer.TreasurerService.GetPaymentLinkSBP:output_type -> treasurer.GetPaymentLinkResponse
|
||||
13, // [13:19] is the sub-list for method output_type
|
||||
7, // [7:13] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
4, // 0: treasurer.GetBankCardPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
4, // 1: treasurer.GetPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
4, // 2: treasurer.GetB2BPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
5, // 3: treasurer.GetB2BPaymentLinkRequest.VatData:type_name -> google.protobuf.Empty
|
||||
1, // 4: treasurer.TreasurerService.GetPaymentLinkBankCard:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 5: treasurer.TreasurerService.GetPaymentLinkYooMoney:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 6: treasurer.TreasurerService.GetPaymentLinkTinkoff:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 7: treasurer.TreasurerService.GetPaymentLinkSberbankB2B:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 8: treasurer.TreasurerService.GetPaymentLinkSBP:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 9: treasurer.TreasurerService.GetPaymentLinkSberPay:input_type -> treasurer.GetPaymentLinkRequest
|
||||
3, // 10: treasurer.TreasurerService.GetPaymentLinkBankCard:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 11: treasurer.TreasurerService.GetPaymentLinkYooMoney:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 12: treasurer.TreasurerService.GetPaymentLinkTinkoff:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 13: treasurer.TreasurerService.GetPaymentLinkSberbankB2B:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 14: treasurer.TreasurerService.GetPaymentLinkSBP:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 15: treasurer.TreasurerService.GetPaymentLinkSberPay:output_type -> treasurer.GetPaymentLinkResponse
|
||||
10, // [10:16] is the sub-list for method output_type
|
||||
4, // [4:10] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_treasurer_service_proto_init() }
|
||||
@ -510,7 +368,7 @@ func file_treasurer_service_proto_init() {
|
||||
}
|
||||
}
|
||||
file_treasurer_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetPaymentLinkBody); i {
|
||||
switch v := v.(*GetPaymentLinkRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@ -522,30 +380,6 @@ func file_treasurer_service_proto_init() {
|
||||
}
|
||||
}
|
||||
file_treasurer_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetPhonePaymentLinkRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_treasurer_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetLoginPaymentLinkRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_treasurer_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetB2BPaymentLinkRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -557,7 +391,7 @@ func file_treasurer_service_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_treasurer_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_treasurer_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetPaymentLinkResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -576,7 +410,7 @@ func file_treasurer_service_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_treasurer_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: treasurer/service.proto
|
||||
|
||||
@ -18,16 +18,25 @@ import (
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
TreasurerService_GetPaymentLinkBankCard_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkBankCard"
|
||||
TreasurerService_GetPaymentLinkYooMoney_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkYooMoney"
|
||||
TreasurerService_GetPaymentLinkTinkoff_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkTinkoff"
|
||||
TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B"
|
||||
TreasurerService_GetPaymentLinkSBP_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkSBP"
|
||||
TreasurerService_GetPaymentLinkSberPay_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkSberPay"
|
||||
)
|
||||
|
||||
// TreasurerServiceClient is the client API for TreasurerService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type TreasurerServiceClient interface {
|
||||
GetPaymentLinkBankCard(ctx context.Context, in *GetBankCardPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkYooMoney(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSberPay(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkTinkoff(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSberbankB2B(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSBP(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkBankCard(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkYooMoney(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkTinkoff(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSberbankB2B(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSBP(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSberPay(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
}
|
||||
|
||||
type treasurerServiceClient struct {
|
||||
@ -38,54 +47,54 @@ func NewTreasurerServiceClient(cc grpc.ClientConnInterface) TreasurerServiceClie
|
||||
return &treasurerServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkBankCard(ctx context.Context, in *GetBankCardPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
func (c *treasurerServiceClient) GetPaymentLinkBankCard(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkBankCard", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkBankCard_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkYooMoney(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
func (c *treasurerServiceClient) GetPaymentLinkYooMoney(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkYooMoney", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkYooMoney_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkSberPay(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
func (c *treasurerServiceClient) GetPaymentLinkTinkoff(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSberPay", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkTinkoff_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkTinkoff(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
func (c *treasurerServiceClient) GetPaymentLinkSberbankB2B(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkTinkoff", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkSberbankB2B(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
func (c *treasurerServiceClient) GetPaymentLinkSBP(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSBP_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkSBP(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
func (c *treasurerServiceClient) GetPaymentLinkSberPay(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSBP", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSberPay_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -96,36 +105,36 @@ func (c *treasurerServiceClient) GetPaymentLinkSBP(ctx context.Context, in *GetP
|
||||
// All implementations should embed UnimplementedTreasurerServiceServer
|
||||
// for forward compatibility
|
||||
type TreasurerServiceServer interface {
|
||||
GetPaymentLinkBankCard(context.Context, *GetBankCardPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkYooMoney(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSberPay(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkTinkoff(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSberbankB2B(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSBP(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkBankCard(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkYooMoney(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkTinkoff(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSberbankB2B(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSBP(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSberPay(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedTreasurerServiceServer should be embedded to have forward compatible implementations.
|
||||
type UnimplementedTreasurerServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkBankCard(context.Context, *GetBankCardPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkBankCard(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkBankCard not implemented")
|
||||
}
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkYooMoney(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error) {
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkYooMoney(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkYooMoney not implemented")
|
||||
}
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSberPay(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSberPay not implemented")
|
||||
}
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkTinkoff(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error) {
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkTinkoff(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkTinkoff not implemented")
|
||||
}
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSberbankB2B(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error) {
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSberbankB2B(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSberbankB2B not implemented")
|
||||
}
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSBP(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error) {
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSBP(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSBP not implemented")
|
||||
}
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSberPay(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSberPay not implemented")
|
||||
}
|
||||
|
||||
// UnsafeTreasurerServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TreasurerServiceServer will
|
||||
@ -139,7 +148,7 @@ func RegisterTreasurerServiceServer(s grpc.ServiceRegistrar, srv TreasurerServic
|
||||
}
|
||||
|
||||
func _TreasurerService_GetPaymentLinkBankCard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetBankCardPaymentLinkRequest)
|
||||
in := new(GetPaymentLinkRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -148,16 +157,16 @@ func _TreasurerService_GetPaymentLinkBankCard_Handler(srv interface{}, ctx conte
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkBankCard",
|
||||
FullMethod: TreasurerService_GetPaymentLinkBankCard_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkBankCard(ctx, req.(*GetBankCardPaymentLinkRequest))
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkBankCard(ctx, req.(*GetPaymentLinkRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TreasurerService_GetPaymentLinkYooMoney_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPaymentLinkBody)
|
||||
in := new(GetPaymentLinkRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -166,34 +175,16 @@ func _TreasurerService_GetPaymentLinkYooMoney_Handler(srv interface{}, ctx conte
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkYooMoney",
|
||||
FullMethod: TreasurerService_GetPaymentLinkYooMoney_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkYooMoney(ctx, req.(*GetPaymentLinkBody))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TreasurerService_GetPaymentLinkSberPay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPaymentLinkBody)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberPay(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSberPay",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberPay(ctx, req.(*GetPaymentLinkBody))
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkYooMoney(ctx, req.(*GetPaymentLinkRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TreasurerService_GetPaymentLinkTinkoff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPaymentLinkBody)
|
||||
in := new(GetPaymentLinkRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -202,16 +193,16 @@ func _TreasurerService_GetPaymentLinkTinkoff_Handler(srv interface{}, ctx contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkTinkoff",
|
||||
FullMethod: TreasurerService_GetPaymentLinkTinkoff_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkTinkoff(ctx, req.(*GetPaymentLinkBody))
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkTinkoff(ctx, req.(*GetPaymentLinkRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TreasurerService_GetPaymentLinkSberbankB2B_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPaymentLinkBody)
|
||||
in := new(GetPaymentLinkRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -220,16 +211,16 @@ func _TreasurerService_GetPaymentLinkSberbankB2B_Handler(srv interface{}, ctx co
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B",
|
||||
FullMethod: TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberbankB2B(ctx, req.(*GetPaymentLinkBody))
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberbankB2B(ctx, req.(*GetPaymentLinkRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TreasurerService_GetPaymentLinkSBP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPaymentLinkBody)
|
||||
in := new(GetPaymentLinkRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -238,10 +229,28 @@ func _TreasurerService_GetPaymentLinkSBP_Handler(srv interface{}, ctx context.Co
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSBP",
|
||||
FullMethod: TreasurerService_GetPaymentLinkSBP_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSBP(ctx, req.(*GetPaymentLinkBody))
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSBP(ctx, req.(*GetPaymentLinkRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TreasurerService_GetPaymentLinkSberPay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPaymentLinkRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberPay(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TreasurerService_GetPaymentLinkSberPay_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberPay(ctx, req.(*GetPaymentLinkRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@ -261,10 +270,6 @@ var TreasurerService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetPaymentLinkYooMoney",
|
||||
Handler: _TreasurerService_GetPaymentLinkYooMoney_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPaymentLinkSberPay",
|
||||
Handler: _TreasurerService_GetPaymentLinkSberPay_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPaymentLinkTinkoff",
|
||||
Handler: _TreasurerService_GetPaymentLinkTinkoff_Handler,
|
||||
@ -277,6 +282,10 @@ var TreasurerService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetPaymentLinkSBP",
|
||||
Handler: _TreasurerService_GetPaymentLinkSBP_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPaymentLinkSberPay",
|
||||
Handler: _TreasurerService_GetPaymentLinkSberPay_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "treasurer/service.proto",
|
||||
|
@ -3,10 +3,12 @@ package callback
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"fmt"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
||||
tb "gopkg.in/tucnak/telebot.v2"
|
||||
)
|
||||
|
||||
type accountRepository interface {
|
||||
@ -26,6 +28,9 @@ type PaymentCallbackServiceDeps struct {
|
||||
AccountRepository accountRepository
|
||||
WalletService walletService
|
||||
HistoryService historyService
|
||||
Notifier *tb.Bot
|
||||
NotifyChannel int64
|
||||
AdminURL string
|
||||
}
|
||||
|
||||
type PaymentCallbackService struct {
|
||||
@ -33,6 +38,9 @@ type PaymentCallbackService struct {
|
||||
accountRepository accountRepository
|
||||
walletService walletService
|
||||
historyService historyService
|
||||
notifier *tb.Bot
|
||||
notifyChannel int64
|
||||
adminURL string
|
||||
}
|
||||
|
||||
func NewPaymentCallbackService(deps PaymentCallbackServiceDeps) *PaymentCallbackService {
|
||||
@ -57,6 +65,9 @@ func NewPaymentCallbackService(deps PaymentCallbackServiceDeps) *PaymentCallback
|
||||
accountRepository: deps.AccountRepository,
|
||||
walletService: deps.WalletService,
|
||||
historyService: deps.HistoryService,
|
||||
notifier: deps.Notifier,
|
||||
notifyChannel: deps.NotifyChannel,
|
||||
adminURL: deps.AdminURL,
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,7 +107,11 @@ func (receiver *PaymentCallbackService) SuccessEvent(ctx context.Context, event
|
||||
return err
|
||||
}
|
||||
//}()
|
||||
|
||||
go func () {
|
||||
if _, err := receiver.notifier.Send(tb.ChatID(receiver.notifyChannel), fmt.Sprintf(`Внесены деньги %.2f, пользователем %s`,float64(event.Amount/100), receiver.adminURL + "/users/" + account.UserID)); err != nil {
|
||||
fmt.Println("TBOER", err)
|
||||
}
|
||||
}()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
162
internal/service/payment/payment.go
Normal file
162
internal/service/payment/payment.go
Normal file
@ -0,0 +1,162 @@
|
||||
package payment
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/treasurer"
|
||||
)
|
||||
|
||||
type paymentClient interface {
|
||||
GetPaymentLinkBankCard(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error)
|
||||
GetPaymentLinkYooMoney(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error)
|
||||
GetPaymentLinkSberPay(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error)
|
||||
GetPaymentLinkTinkoff(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error)
|
||||
GetPaymentLinkSberbankB2B(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error)
|
||||
}
|
||||
|
||||
type authClient interface {
|
||||
GetUser(ctx context.Context, userID string) (*models.User, errors.Error)
|
||||
}
|
||||
|
||||
type Deps struct {
|
||||
Logger *zap.Logger
|
||||
ConfigurationGRPC *models.ConfigurationGRPC
|
||||
PaymentClient paymentClient
|
||||
AuthClient authClient
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
logger *zap.Logger
|
||||
configurationGRPC *models.ConfigurationGRPC
|
||||
paymentClient paymentClient
|
||||
authClient authClient
|
||||
}
|
||||
|
||||
func New(deps Deps) *Service {
|
||||
if deps.Logger == nil {
|
||||
log.Panicln("logger is nil on <New (payment service)>")
|
||||
}
|
||||
|
||||
if deps.ConfigurationGRPC == nil {
|
||||
log.Panicln("ConfigurationGRPC is nil on <New (payment service)>")
|
||||
}
|
||||
|
||||
if deps.PaymentClient == nil {
|
||||
log.Panicln("PaymentClient is nil on <New (payment service)>")
|
||||
}
|
||||
|
||||
if deps.AuthClient == nil {
|
||||
log.Panicln("AuthClient is nil on <New (payment service)>")
|
||||
}
|
||||
|
||||
return &Service{
|
||||
logger: deps.Logger,
|
||||
paymentClient: deps.PaymentClient,
|
||||
authClient: deps.AuthClient,
|
||||
configurationGRPC: deps.ConfigurationGRPC,
|
||||
}
|
||||
}
|
||||
|
||||
func (receiver *Service) GetPaymentLink(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
if _, userErr := receiver.authClient.GetUser(ctx, request.UserID); userErr != nil {
|
||||
receiver.logger.Error("failed to get user on <GetPaymentLink> on <PaymentService>",
|
||||
zap.Error(userErr),
|
||||
zap.String("userID", request.UserID),
|
||||
)
|
||||
|
||||
return "", userErr
|
||||
}
|
||||
|
||||
switch request.Body.Type {
|
||||
case models.PaymentTypeBankCard:
|
||||
return receiver.GetPaymentLinkBankCard(ctx, request)
|
||||
case models.PaymentTypeYoomoney:
|
||||
return receiver.GetPaymentLinkYooMoney(ctx, request)
|
||||
case models.PaymentTypeSberPay:
|
||||
return receiver.GetPaymentLinkSberPay(ctx, request)
|
||||
case models.PaymentTypeTinkoff:
|
||||
return receiver.GetPaymentLinkTinkoff(ctx, request)
|
||||
}
|
||||
|
||||
return "", errors.NewWithMessage("invalid payment method type", errors.ErrInvalidArgs)
|
||||
}
|
||||
|
||||
func (receiver *Service) GetPaymentLinkBankCard(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := receiver.paymentClient.GetPaymentLinkBankCard(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
UserID: request.UserID,
|
||||
ClientIP: request.ClientIP,
|
||||
CallbackHostGRPC: []string{receiver.configurationGRPC.Domen},
|
||||
ReturnURL: request.Body.ReturnURL,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
receiver.logger.Error("failed to get bankcard payment link on <GetPaymentLinkBankCard> of <PaymentService>", zap.Error(err))
|
||||
return "", err
|
||||
}
|
||||
|
||||
return link, nil
|
||||
}
|
||||
|
||||
func (receiver *Service) GetPaymentLinkYooMoney(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := receiver.paymentClient.GetPaymentLinkYooMoney(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
UserID: request.UserID,
|
||||
ClientIP: request.ClientIP,
|
||||
CallbackHostGRPC: []string{receiver.configurationGRPC.Domen},
|
||||
ReturnURL: request.Body.ReturnURL,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
receiver.logger.Error("failed to get yoomoney payment link on <GetPaymentLinkYooMoney> of <PaymentService>", zap.Error(err))
|
||||
return "", err
|
||||
}
|
||||
|
||||
return link, nil
|
||||
}
|
||||
|
||||
func (receiver *Service) GetPaymentLinkSberPay(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := receiver.paymentClient.GetPaymentLinkSberPay(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
UserID: request.UserID,
|
||||
ClientIP: request.ClientIP,
|
||||
CallbackHostGRPC: []string{receiver.configurationGRPC.Domen},
|
||||
ReturnURL: request.Body.ReturnURL,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
receiver.logger.Error("failed to get sberpay payment link on <GetPaymentLinkSberPay> of <PaymentService>", zap.Error(err))
|
||||
return "", err
|
||||
}
|
||||
|
||||
return link, nil
|
||||
}
|
||||
|
||||
func (receiver *Service) GetPaymentLinkTinkoff(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||
link, err := receiver.paymentClient.GetPaymentLinkTinkoff(ctx, &treasurer.GetPaymentLinkRequest{
|
||||
MainSettings: &treasurer.MainPaymentSettings{
|
||||
Currency: request.Body.Currency,
|
||||
Amount: request.Body.Amount,
|
||||
UserID: request.UserID,
|
||||
ClientIP: request.ClientIP,
|
||||
CallbackHostGRPC: []string{receiver.configurationGRPC.Domen},
|
||||
ReturnURL: request.Body.ReturnURL,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
receiver.logger.Error("failed to get tinkoff payment link on <GetPaymentLinkTinkoff> of <PaymentService>", zap.Error(err))
|
||||
return "", err
|
||||
}
|
||||
|
||||
return link, nil
|
||||
}
|
@ -10,5 +10,22 @@ func ValidateGetPaymentLinkBody(request *models.GetPaymentLinkBody) errors.Error
|
||||
return errors.NewWithMessage("request body is empty", errors.ErrInvalidArgs)
|
||||
}
|
||||
|
||||
switch request.Type {
|
||||
case models.PaymentTypeBankCard:
|
||||
return validateBankcardPayment(request)
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func validateMobilePayment(request *models.GetPaymentLinkBody) errors.Error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateLoginPayment(request *models.GetPaymentLinkBody) errors.Error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateBankcardPayment(request *models.GetPaymentLinkBody) errors.Error {
|
||||
return nil
|
||||
}
|
||||
|
22
internal/utils/transfer/payment.go
Normal file
22
internal/utils/transfer/payment.go
Normal file
@ -0,0 +1,22 @@
|
||||
package transfer
|
||||
import(
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/treasurer"
|
||||
)
|
||||
func ReceiptItemToProto(in models.Item) *treasurer.Item {
|
||||
return &treasurer.Item{
|
||||
Description: in.Description,
|
||||
Measure: in.Measure,
|
||||
Quantity: in.Quantity,
|
||||
Money: in.Money,
|
||||
Currency: in.Currency,
|
||||
}
|
||||
}
|
||||
|
||||
func ReceiptItemsToProto(in []models.Item) []*treasurer.Item {
|
||||
result := make([]*treasurer.Item, len(in), len(in))
|
||||
for i, item := range in {
|
||||
result[i] = ReceiptItemToProto(item)
|
||||
}
|
||||
return result
|
||||
}
|
@ -2,7 +2,6 @@ package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/go-resty/resty/v2"
|
||||
)
|
||||
@ -36,7 +35,9 @@ func makeRequest[T any, R any](url string, requestMethod func(url string) (*rest
|
||||
if responseInstance.IsError() {
|
||||
responseBody, parseErr := parseResponse[R](responseInstance.Body(), responseInstance.RawResponse)
|
||||
if parseErr != nil {
|
||||
return nil, parseErr
|
||||
return &Response[T,R]{
|
||||
StatusCode: responseInstance.StatusCode(),
|
||||
},parseErr
|
||||
}
|
||||
|
||||
return &Response[T, R]{
|
||||
@ -44,11 +45,12 @@ func makeRequest[T any, R any](url string, requestMethod func(url string) (*rest
|
||||
Error: responseBody,
|
||||
}, nil
|
||||
}
|
||||
fmt.Println("OOOOO", responseInstance.RawResponse)
|
||||
|
||||
responseBody, parseErr := parseResponse[T](responseInstance.Body(), responseInstance.RawResponse)
|
||||
if parseErr != nil {
|
||||
return nil, parseErr
|
||||
return &Response[T,R]{
|
||||
StatusCode: responseInstance.StatusCode(),
|
||||
},parseErr
|
||||
}
|
||||
|
||||
return &Response[T, R]{
|
||||
|
Loading…
Reference in New Issue
Block a user