Merge pull request 'dev' (#9) from dev into staging
Reviewed-on: https://gitea.pena/PenaSide/treasurer/pulls/9
This commit is contained in:
commit
fe902d9823
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gitea.pena/PenaSide/common/closer"
|
||||
"gitea.pena/PenaSide/common/mongo"
|
||||
"gitea.pena/PenaSide/treasurer/internal/server/grpc"
|
||||
"gitea.pena/PenaSide/treasurer/internal/server/http"
|
||||
@ -11,7 +12,6 @@ import (
|
||||
|
||||
"gitea.pena/PenaSide/treasurer/internal/initialize"
|
||||
"gitea.pena/PenaSide/treasurer/internal/worker"
|
||||
"gitea.pena/PenaSide/treasurer/pkg/closer"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@ -72,8 +72,9 @@ func Run(ctx context.Context, config initialize.Config, logger *zap.Logger) (app
|
||||
}
|
||||
|
||||
controllers, err := initialize.NewControllers(initialize.ControllersDeps{
|
||||
Logger: logger,
|
||||
Services: *services,
|
||||
Logger: logger,
|
||||
Services: *services,
|
||||
Repositories: *repositories,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -65,6 +65,10 @@ func (c *CallbackClient) SendOnSuccess(ctx context.Context, host string, event *
|
||||
return errors.NewWithError(fmt.Errorf("failed to send success callback: %w", err), errors.ErrInternalError)
|
||||
}
|
||||
|
||||
if err := c.SendOnCartPurchase(ctx, host, event); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -107,3 +111,43 @@ func (c *CallbackClient) SendOnFailure(ctx context.Context, host string, event *
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *CallbackClient) SendOnCartPurchase(ctx context.Context, host string, event *models.Event) errors.Error {
|
||||
connection, err := grpc.Dial(host, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
if err != nil {
|
||||
c.logger.Error("failed to connect on <SendOnCartPurchase> of <CallbackClient>", zap.Error(err), zap.String("host", host))
|
||||
return errors.NewWithError(fmt.Errorf("failed connect to callback service: %w", err), errors.ErrInternalError)
|
||||
}
|
||||
defer func() {
|
||||
if closeErr := connection.Close(); closeErr != nil {
|
||||
c.logger.Error("failed to close connection on <SendOnCartPurchase> of <CallbackClient>", zap.Error(closeErr))
|
||||
}
|
||||
}()
|
||||
|
||||
client := payment_callback.NewPaymentCallbackServiceClient(connection)
|
||||
|
||||
if _, err := client.OnCartPurchase(ctx, &payment_callback.Event{
|
||||
Key: event.Key,
|
||||
Message: event.Message,
|
||||
Payment: &payment_callback.Payment{
|
||||
ID: event.Payment.ID,
|
||||
UserID: event.Payment.UserID,
|
||||
PaymentID: event.Payment.PaymentID,
|
||||
IdempotencePaymentID: event.Payment.IdempotencePaymentID,
|
||||
Amount: event.Payment.Amount,
|
||||
Currency: event.Payment.Currency,
|
||||
Type: string(event.Payment.Type),
|
||||
Status: string(event.Payment.Status),
|
||||
Completed: event.Payment.Completed,
|
||||
},
|
||||
}); err != nil {
|
||||
c.logger.Error("failed to send cart purchase callback on <SendOnCartPurchase> of <CallbackClient>",
|
||||
zap.Error(err),
|
||||
zap.String("host", host),
|
||||
zap.Any("event", event),
|
||||
)
|
||||
return errors.NewWithError(fmt.Errorf("failed to cart purchase callback: %w", err), errors.ErrInternalError)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -5,7 +5,10 @@ import (
|
||||
"fmt"
|
||||
"gitea.pena/PenaSide/treasurer/internal/models/yandex"
|
||||
"gitea.pena/PenaSide/treasurer/internal/payment_provider"
|
||||
"gitea.pena/PenaSide/treasurer/internal/repository"
|
||||
"gitea.pena/PenaSide/treasurer/internal/utils"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@ -16,15 +19,18 @@ import (
|
||||
)
|
||||
|
||||
type PaymentControllerDeps struct {
|
||||
Logger *zap.Logger
|
||||
PaymentProviders []payment_provider.PaymentProvider
|
||||
Logger *zap.Logger
|
||||
PaymentProviders []payment_provider.PaymentProvider
|
||||
PaymentMethodRepository *repository.PaymentMethodRepository
|
||||
}
|
||||
|
||||
type PaymentController struct {
|
||||
logger *zap.Logger
|
||||
paymentProviders []payment_provider.PaymentProvider
|
||||
providerMap map[models.PaymentType][]payment_provider.PaymentProvider
|
||||
mu sync.RWMutex
|
||||
logger *zap.Logger
|
||||
paymentProviders []payment_provider.PaymentProvider
|
||||
paymentMethodRepository *repository.PaymentMethodRepository
|
||||
providerMap map[models.PaymentType][]payment_provider.PaymentProvider
|
||||
mu sync.RWMutex
|
||||
treasurer.UnimplementedTreasurerServiceServer
|
||||
}
|
||||
|
||||
func NewPaymentController(deps PaymentControllerDeps) (*PaymentController, errors.Error) {
|
||||
@ -37,9 +43,10 @@ func NewPaymentController(deps PaymentControllerDeps) (*PaymentController, error
|
||||
}
|
||||
|
||||
controller := &PaymentController{
|
||||
logger: deps.Logger,
|
||||
paymentProviders: deps.PaymentProviders,
|
||||
providerMap: make(map[models.PaymentType][]payment_provider.PaymentProvider),
|
||||
logger: deps.Logger,
|
||||
paymentProviders: deps.PaymentProviders,
|
||||
providerMap: make(map[models.PaymentType][]payment_provider.PaymentProvider),
|
||||
paymentMethodRepository: deps.PaymentMethodRepository,
|
||||
}
|
||||
|
||||
for _, provider := range deps.PaymentProviders {
|
||||
@ -89,6 +96,11 @@ func (r *PaymentController) createPayment(ctx context.Context, paymentType model
|
||||
},
|
||||
Items: utils.ProtoItems2ReceiptItems(in.MainSettings.Items),
|
||||
}),
|
||||
"save_payment_method": strconv.FormatBool(in.MainSettings.Auto),
|
||||
"recurrent": strconv.FormatBool(in.MainSettings.Recurrent),
|
||||
"fromWalletAddress": in.MainSettings.FromWalletAddress,
|
||||
"toWalletAddress": in.MainSettings.ToWalletAddress,
|
||||
"cryptoAmount": fmt.Sprintf("%f", in.MainSettings.CryptoAmount),
|
||||
}
|
||||
link, err := provider.CreateInvoice(ctx, request)
|
||||
if err != nil {
|
||||
@ -124,3 +136,21 @@ func (r *PaymentController) GetPaymentLinkSberPay(ctx context.Context, in *treas
|
||||
func (r *PaymentController) GetPaymentLinkSberbankB2B(ctx context.Context, in *treasurer.GetPaymentLinkRequest) (*treasurer.GetPaymentLinkResponse, error) {
|
||||
return r.createPayment(ctx, models.PaymentTypeSberB2B, in)
|
||||
}
|
||||
|
||||
func (r *PaymentController) GetPaymentLinkAlchemy(ctx context.Context, in *treasurer.GetPaymentLinkRequest) (*treasurer.GetPaymentLinkResponse, error) {
|
||||
return r.createPayment(ctx, models.PaymentTypeAlchemy, in)
|
||||
}
|
||||
|
||||
func (r *PaymentController) DeleteSavedPaymentMethods(ctx context.Context, in *treasurer.DeleteSavedPaymentMethodsRequest) (*emptypb.Empty, error) {
|
||||
if in.UserID == "" {
|
||||
r.logger.Error("empty user id provided")
|
||||
return nil, errors.GRPC("user id is required", errors.NewWithMessage("user id is required", errors.ErrInvalidArgs))
|
||||
}
|
||||
|
||||
err := r.paymentMethodRepository.DeleteByUserID(ctx, in.UserID)
|
||||
if err != nil {
|
||||
r.logger.Error("failed to delete payment methods", zap.Error(err), zap.String("userId", in.UserID))
|
||||
return nil, errors.GRPC("failed to delete payment methods", errors.NewWithMessage("failed to delete payment methods", errors.ErrInternalError))
|
||||
}
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
@ -6,16 +6,17 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
HttpURL string `env:"HTTP_URL" envDefault:"0.0.0.0:8080"`
|
||||
HttpDomain string `env:"HTTP_DOMAIN" envDefault:"http://localhost:8080"`
|
||||
GrpcURL string `env:"GRPC_URL,required" envDefault:"localhost:9000"`
|
||||
YooMoneyStoreID string `env:"YOOMONEY_STORE_ID" envDefault:"storeid"`
|
||||
YooMoneySecretKey string `env:"YOOMONEY_SECRET_KEY" envDefault:"secret"`
|
||||
IsMock bool `env:"IS_MOCK" envDefault:"false"`
|
||||
MockServiceHost string `env:"MOCK_SERVICE_HOST" envDefault:"http://treasurer-mock:8080"`
|
||||
YooMoneyWebhooksURL string `env:"YOOMONEY_WEBHOOKS_URL" envDefault:"http://treasurer-mock:8080/webhooks"`
|
||||
YooMoneyPaymentsURL string `env:"YOOMONEY_PAYMENTS_URL" envDefault:"http://treasurer-mock:8080/payments"`
|
||||
Database mongo.Configuration
|
||||
HttpURL string `env:"HTTP_URL" envDefault:"0.0.0.0:8080"`
|
||||
HttpDomain string `env:"HTTP_DOMAIN" envDefault:"http://localhost:8080"`
|
||||
GrpcURL string `env:"GRPC_URL,required" envDefault:"localhost:9000"`
|
||||
YooMoneyStoreID string `env:"YOOMONEY_STORE_ID" envDefault:"storeid"`
|
||||
YooMoneySecretKey string `env:"YOOMONEY_SECRET_KEY" envDefault:"secret"`
|
||||
IsMock bool `env:"IS_MOCK" envDefault:"false"`
|
||||
MockServiceHost string `env:"MOCK_SERVICE_HOST" envDefault:"http://treasurer-mock:8080"`
|
||||
YooMoneyWebhooksURL string `env:"YOOMONEY_WEBHOOKS_URL" envDefault:"http://treasurer-mock:8080/webhooks"`
|
||||
YooMoneyPaymentsURL string `env:"YOOMONEY_PAYMENTS_URL" envDefault:"http://treasurer-mock:8080/payments"`
|
||||
AlchemyWalletAddress string `env:"ALCHEMY_WALLET_ADDRESS" envDefault:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"`
|
||||
Database mongo.Configuration
|
||||
}
|
||||
|
||||
func LoadConfig() (*Config, error) {
|
||||
|
@ -9,8 +9,9 @@ import (
|
||||
)
|
||||
|
||||
type ControllersDeps struct {
|
||||
Logger *zap.Logger
|
||||
Services Services
|
||||
Logger *zap.Logger
|
||||
Services Services
|
||||
Repositories Repositories
|
||||
}
|
||||
|
||||
type Controllers struct {
|
||||
@ -30,8 +31,9 @@ func NewControllers(deps ControllersDeps) (*Controllers, errors.Error) {
|
||||
}
|
||||
|
||||
paymentControllerGRPC, err := grpc.NewPaymentController(grpc.PaymentControllerDeps{
|
||||
Logger: deps.Logger,
|
||||
PaymentProviders: deps.Services.PaymentProviders,
|
||||
Logger: deps.Logger,
|
||||
PaymentProviders: deps.Services.PaymentProviders,
|
||||
PaymentMethodRepository: deps.Repositories.PaymentMethod,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -13,7 +13,8 @@ type RepositoriesDeps struct {
|
||||
}
|
||||
|
||||
type Repositories struct {
|
||||
Payment *repository.PaymentRepository
|
||||
Payment *repository.PaymentRepository
|
||||
PaymentMethod *repository.PaymentMethodRepository
|
||||
}
|
||||
|
||||
func NewRepositories(deps RepositoriesDeps) (*Repositories, errors.Error) {
|
||||
@ -25,5 +26,10 @@ func NewRepositories(deps RepositoriesDeps) (*Repositories, errors.Error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Repositories{Payment: paymentRepository}, nil
|
||||
paymentMethod := repository.NewPaymentMethodRepository(repository.PaymentMethodRepositoryDeps{
|
||||
Logger: deps.Logger,
|
||||
Collection: deps.Database.Collection("payment_methods"),
|
||||
})
|
||||
|
||||
return &Repositories{Payment: paymentRepository, PaymentMethod: paymentMethod}, nil
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package initialize
|
||||
import (
|
||||
"gitea.pena/PenaSide/treasurer/internal/errors"
|
||||
"gitea.pena/PenaSide/treasurer/internal/payment_provider"
|
||||
"gitea.pena/PenaSide/treasurer/internal/payment_provider/alchemy"
|
||||
"gitea.pena/PenaSide/treasurer/internal/payment_provider/yoomoney"
|
||||
"gitea.pena/PenaSide/treasurer/internal/service/callback"
|
||||
"gitea.pena/PenaSide/treasurer/internal/service/mock"
|
||||
@ -99,13 +100,22 @@ func NewServices(deps ServicesDeps) (*Services, errors.Error) {
|
||||
WebhooksURL: deps.Config.YooMoneyWebhooksURL,
|
||||
PaymentsURL: deps.Config.YooMoneyPaymentsURL,
|
||||
},
|
||||
Repository: deps.Repositories.Payment,
|
||||
CallbackService: callbackService,
|
||||
Repository: deps.Repositories.Payment,
|
||||
CallbackService: callbackService,
|
||||
PaymentMethodRepository: deps.Repositories.PaymentMethod,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
alchemyProvider := alchemy.New(alchemy.Deps{
|
||||
Repository: deps.Repositories.Payment,
|
||||
Logger: deps.Logger,
|
||||
Config: &alchemy.Config{
|
||||
WalletAddress: deps.Config.AlchemyWalletAddress,
|
||||
},
|
||||
})
|
||||
|
||||
return &Services{
|
||||
Callback: callbackService,
|
||||
Payment: paymentService,
|
||||
@ -113,6 +123,6 @@ func NewServices(deps ServicesDeps) (*Services, errors.Error) {
|
||||
Status: statusService,
|
||||
//YandexWebhook: yandexWebhookService,
|
||||
Mock: mockService,
|
||||
PaymentProviders: []payment_provider.PaymentProvider{yooMoneyProvider},
|
||||
PaymentProviders: []payment_provider.PaymentProvider{yooMoneyProvider, alchemyProvider},
|
||||
}, nil
|
||||
}
|
||||
|
39
internal/models/alchemy/webhook.go
Normal file
39
internal/models/alchemy/webhook.go
Normal file
@ -0,0 +1,39 @@
|
||||
package alchemy
|
||||
|
||||
type AlchemyAddressActivityWebhook struct {
|
||||
CreatedAt string `json:"createdAt"`
|
||||
Event struct {
|
||||
Activity []struct {
|
||||
Asset string `json:"asset"`
|
||||
BlockNum string `json:"blockNum"`
|
||||
Category string `json:"category"`
|
||||
//Erc1155Metadata interface{} `json:"erc1155Metadata"`
|
||||
//Erc721TokenId interface{} `json:"erc721TokenId"`
|
||||
FromAddress string `json:"fromAddress"`
|
||||
Hash string `json:"hash"`
|
||||
Log struct {
|
||||
Address string `json:"address"`
|
||||
BlockHash string `json:"blockHash"`
|
||||
BlockNumber string `json:"blockNumber"`
|
||||
Data string `json:"data"`
|
||||
LogIndex string `json:"logIndex"`
|
||||
Removed bool `json:"removed"`
|
||||
Topics []string `json:"topics"`
|
||||
TransactionHash string `json:"transactionHash"`
|
||||
TransactionIndex string `json:"transactionIndex"`
|
||||
} `json:"log"`
|
||||
RawContract struct {
|
||||
Address string `json:"address"`
|
||||
Decimals int `json:"decimals"`
|
||||
RawValue string `json:"rawValue"`
|
||||
} `json:"rawContract"`
|
||||
ToAddress string `json:"toAddress"`
|
||||
//TypeTraceAddress interface{} `json:"typeTraceAddress"`
|
||||
Value float64 `json:"value"`
|
||||
} `json:"activity"`
|
||||
Network string `json:"network"`
|
||||
} `json:"event"`
|
||||
ID string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
WebhookId string `json:"webhookId"`
|
||||
}
|
@ -29,6 +29,10 @@ type Payment struct {
|
||||
Запрос будет отправляться по протоколу GRPC
|
||||
*/
|
||||
CallbackHostGRPC []string `json:"callbackHostGrpc" bson:"callbackHostGrpc"`
|
||||
|
||||
ToWalletAddress string `json:"toWalletAddress" bson:"toWalletAddress"` // for crypto our
|
||||
FromWalletAddress string `json:"fromWalletAddress" bson:"fromWalletAddress"` // for crypto them
|
||||
CryptoAmount float64 `json:"cryptoAmount" bson:"cryptoAmount"` // for crypto
|
||||
}
|
||||
|
||||
func (p *Payment) Sanitize() *Payment {
|
||||
@ -58,6 +62,8 @@ type CreatePayment[T any] struct {
|
||||
UserID string
|
||||
ClientIP string
|
||||
Requisites T
|
||||
Auto bool
|
||||
Recurrent bool
|
||||
}
|
||||
|
||||
type BankCard struct {
|
||||
@ -78,6 +84,7 @@ const (
|
||||
PaymentTypeMobile PaymentType = "mobile"
|
||||
PaymentTypeSBP PaymentType = "sbp"
|
||||
PaymentTypeSberB2B PaymentType = "b2bSberbank"
|
||||
PaymentTypeAlchemy PaymentType = "alchemy"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,5 +1,7 @@
|
||||
package yandex
|
||||
|
||||
import "time"
|
||||
|
||||
// Payment description https://yookassa.ru/developers/api#payment_object
|
||||
type Payment struct {
|
||||
ID string `json:"id" bson:"id"`
|
||||
@ -8,7 +10,7 @@ type Payment struct {
|
||||
Confirmation *ConfirmationRedirect `json:"confirmation" bson:"confirmation"`
|
||||
IncomeAmount *Amount `json:"income_amount,omitempty" bson:"income_amount,omitempty"`
|
||||
Description string `json:"description,omitempty" bson:"description,omitempty"`
|
||||
PaymentMethod any `json:"payment_method,omitempty" bson:"payment_method,omitempty"`
|
||||
PaymentMethod *PaymentMethod `json:"payment_method,omitempty" bson:"payment_method,omitempty"`
|
||||
Recipient Recipient `json:"recipient" bson:"recipient"`
|
||||
CapturedAt string `json:"captured_at,omitempty" bson:"captured_at,omitempty"`
|
||||
ExpiresAt string `json:"expires_at,omitempty" bson:"expires_at,omitempty"`
|
||||
@ -42,3 +44,31 @@ const (
|
||||
PaymentStatusSuccessfully PaymentStatus = "succeeded"
|
||||
PaymentStatusCanceled PaymentStatus = "canceled"
|
||||
)
|
||||
|
||||
type PaymentMethod struct {
|
||||
ID string `json:"_id" bson:"_id,omitempty"`
|
||||
UserID string `json:"userId" bson:"userId"`
|
||||
Type string `json:"type" bson:"type"`
|
||||
MethodID string `json:"id" bson:"id"`
|
||||
Saved bool `json:"saved" bson:"saved"`
|
||||
Card *Card `json:"card,omitempty" bson:"card,omitempty"`
|
||||
Title string `json:"title" bson:"title"`
|
||||
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
|
||||
}
|
||||
|
||||
type Card struct {
|
||||
First6 string `json:"first6" bson:"first6"`
|
||||
Last4 string `json:"last4" bson:"last4"`
|
||||
ExpiryMonth string `json:"expiry_month" bson:"expiry_month"`
|
||||
ExpiryYear string `json:"expiry_year" bson:"expiry_year"`
|
||||
CardType string `json:"card_type" bson:"card_type"`
|
||||
CardProduct *CardProduct `json:"card_product,omitempty" bson:"card_product,omitempty"`
|
||||
IssuerCountry string `json:"issuer_country" bson:"issuer_country"`
|
||||
IssuerName string `json:"issuer_name" bson:"issuer_name"`
|
||||
}
|
||||
|
||||
type CardProduct struct {
|
||||
Code string `json:"code" bson:"code"`
|
||||
Name string `json:"name" bson:"name"`
|
||||
}
|
||||
|
@ -10,33 +10,41 @@ type CreatePaymentRequest[T any] struct {
|
||||
ClientIP string `json:"client_ip,omitempty"`
|
||||
Deal any `json:"deal,omitempty"`
|
||||
MerchantCustomerID any `json:"merchant_customer_id,omitempty"`
|
||||
Receipt Receipt `json:"receipt,omitempty"`
|
||||
Receipt Receipt `json:"receipt,omitempty"`
|
||||
SavePaymentMethod bool `json:"save_payment_method"`
|
||||
}
|
||||
|
||||
type Receipt struct {
|
||||
Customer Customer `json:"customer,omitempty"`
|
||||
Items []Item `json:"items,omitempty"`
|
||||
TaxSystemCode int `json:"tax_system_code,omitempty"`
|
||||
Customer Customer `json:"customer,omitempty"`
|
||||
Items []Item `json:"items,omitempty"`
|
||||
TaxSystemCode int `json:"tax_system_code,omitempty"`
|
||||
}
|
||||
|
||||
type Item struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
Amount ReceiptAmount `json:"amount,omitempty"`
|
||||
VatCode int `json:"vat_code,omitempty"`
|
||||
Quantity int64 `json:"quantity,omitempty"`
|
||||
Measure string `json:"measure,omitempty"`
|
||||
PaymentSubject string `json:"payment_subject,omitempty"`
|
||||
PaymentMode string `json:"payment_mode,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Amount ReceiptAmount `json:"amount,omitempty"`
|
||||
VatCode int `json:"vat_code,omitempty"`
|
||||
Quantity int64 `json:"quantity,omitempty"`
|
||||
Measure string `json:"measure,omitempty"`
|
||||
PaymentSubject string `json:"payment_subject,omitempty"`
|
||||
PaymentMode string `json:"payment_mode,omitempty"`
|
||||
}
|
||||
|
||||
type ReceiptAmount struct {
|
||||
Value string `json:"value,omitempty"`
|
||||
Value string `json:"value,omitempty"`
|
||||
Currency string `json:"currency,omitempty"`
|
||||
}
|
||||
|
||||
type Customer struct {
|
||||
FullName string `json:"full_name,omitempty"`
|
||||
INN string `json:"inn,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
INN string `json:"inn,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
}
|
||||
|
||||
type CreateRecurrentPayment struct {
|
||||
Amount Amount `json:"amount"`
|
||||
Capture bool `json:"capture"`
|
||||
PaymentMethodID string `json:"payment_method_id"`
|
||||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
124
internal/payment_provider/alchemy/provider.go
Normal file
124
internal/payment_provider/alchemy/provider.go
Normal file
@ -0,0 +1,124 @@
|
||||
package alchemy
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"gitea.pena/PenaSide/treasurer/internal/errors"
|
||||
"gitea.pena/PenaSide/treasurer/internal/models"
|
||||
"gitea.pena/PenaSide/treasurer/internal/models/alchemy"
|
||||
"gitea.pena/PenaSide/treasurer/internal/repository"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/google/uuid"
|
||||
"go.uber.org/zap"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
const ProviderName = "alchemy"
|
||||
|
||||
type Config struct {
|
||||
WalletAddress string `json:"walletAddress"`
|
||||
}
|
||||
|
||||
type Provider struct {
|
||||
repository *repository.PaymentRepository
|
||||
logger *zap.Logger
|
||||
config *Config
|
||||
}
|
||||
|
||||
type Deps struct {
|
||||
Repository *repository.PaymentRepository
|
||||
Logger *zap.Logger
|
||||
Config *Config
|
||||
}
|
||||
|
||||
func New(deps Deps) *Provider {
|
||||
return &Provider{
|
||||
logger: deps.Logger,
|
||||
config: deps.Config,
|
||||
repository: deps.Repository,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Provider) GetName() string {
|
||||
return ProviderName
|
||||
}
|
||||
|
||||
func (p *Provider) GetSupportedPaymentMethods() []models.PaymentType {
|
||||
return []models.PaymentType{models.PaymentTypeAlchemy}
|
||||
}
|
||||
|
||||
func (p *Provider) CreateInvoice(ctx context.Context, req map[string]string) (string, errors.Error) {
|
||||
amountStr := req["cryptoAmount"]
|
||||
fromWallet := req["fromWalletAddress"]
|
||||
if amountStr == "" || fromWallet == "" {
|
||||
p.logger.Error("amount or fromWallet address is empty", zap.String("fromWalletAddress", fromWallet), zap.String("cryptoAmount", amountStr))
|
||||
return "", errors.NewWithMessage("cryptoAmount and fromWalletAddress required", errors.ErrInvalidArgs)
|
||||
}
|
||||
|
||||
cryptoAmount, err := strconv.ParseFloat(amountStr, 64)
|
||||
if err != nil {
|
||||
p.logger.Error("failed to parse cryptoAmount from wallet address", zap.Error(err))
|
||||
return "", errors.NewWithMessage("invalid cryptoAmount", errors.ErrInvalidArgs)
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
payment := &models.Payment{
|
||||
PaymentID: uuid.NewString(),
|
||||
UserID: req["user_id"],
|
||||
ClientIP: req["client_ip"],
|
||||
Currency: req["currency"],
|
||||
Type: models.PaymentTypeAlchemy,
|
||||
Status: models.PaymentStatusWaiting,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
ToWalletAddress: p.config.WalletAddress,
|
||||
FromWalletAddress: fromWallet,
|
||||
CryptoAmount: cryptoAmount,
|
||||
}
|
||||
|
||||
var callbackHosts []string
|
||||
if val, ok := req["callback_host_grpc"]; ok && val != "" {
|
||||
callbackHosts = strings.Split(val, ",")
|
||||
}
|
||||
payment.CallbackHostGRPC = callbackHosts
|
||||
|
||||
_, err = p.repository.Insert(ctx, payment)
|
||||
if err != nil {
|
||||
p.logger.Error("failed to insert payment into database", zap.Error(err))
|
||||
return "", errors.NewWithMessage(fmt.Sprintf("failed to insert payment into database: %v", err), errors.ErrInternalError)
|
||||
}
|
||||
|
||||
return p.config.WalletAddress, nil
|
||||
}
|
||||
|
||||
func (p *Provider) RegisterWebhookHandlers(router fiber.Router) {
|
||||
router.Post("/webhook/alchemy", p.handleWebhook)
|
||||
}
|
||||
|
||||
func (p *Provider) handleWebhook(ctx *fiber.Ctx) error {
|
||||
var payload alchemy.AlchemyAddressActivityWebhook
|
||||
if err := ctx.BodyParser(&payload); err != nil {
|
||||
return ctx.Status(fiber.StatusBadRequest).SendString(fmt.Sprintf("failed to parse Alchemy webhook: %s", err.Error()))
|
||||
}
|
||||
|
||||
for _, act := range payload.Event.Activity {
|
||||
if act.ToAddress != p.config.WalletAddress {
|
||||
continue
|
||||
}
|
||||
// todo нужно подумать как сделать так если сумма оплаты оказалась чуть больше ожидаемой...
|
||||
payment, err := p.repository.FindByWalletsAndAmount(ctx.Context(), act.ToAddress, act.FromAddress, act.Value)
|
||||
if err != nil {
|
||||
if err.Type() == errors.ErrNotFound {
|
||||
return ctx.Status(fiber.StatusNotFound).SendString(fmt.Sprintf("payment not found: %s", err.Error()))
|
||||
}
|
||||
return ctx.Status(fiber.StatusInternalServerError).SendString(fmt.Sprintf("internal error while searching payment: %s", err.Error()))
|
||||
}
|
||||
_, err = p.repository.SetPaymentStatus(ctx.Context(), payment.PaymentID, models.PaymentStatusSuccessfully)
|
||||
if err != nil {
|
||||
return ctx.Status(fiber.StatusInternalServerError).SendString(fmt.Sprintf("failed to set payment complete: %s", err.Error()))
|
||||
}
|
||||
}
|
||||
return ctx.SendStatus(fiber.StatusOK)
|
||||
}
|
@ -29,27 +29,30 @@ type Config struct {
|
||||
}
|
||||
|
||||
type Provider struct {
|
||||
logger *zap.Logger
|
||||
config *Config
|
||||
httpClient *resty.Client
|
||||
repository *repository.PaymentRepository
|
||||
callbackService *callback.Service
|
||||
logger *zap.Logger
|
||||
config *Config
|
||||
httpClient *resty.Client
|
||||
repository *repository.PaymentRepository
|
||||
callbackService *callback.Service
|
||||
paymentMethodRepository *repository.PaymentMethodRepository
|
||||
}
|
||||
|
||||
type Deps struct {
|
||||
Logger *zap.Logger
|
||||
Config *Config
|
||||
Repository *repository.PaymentRepository
|
||||
CallbackService *callback.Service
|
||||
Logger *zap.Logger
|
||||
Config *Config
|
||||
Repository *repository.PaymentRepository
|
||||
CallbackService *callback.Service
|
||||
PaymentMethodRepository *repository.PaymentMethodRepository
|
||||
}
|
||||
|
||||
func New(deps Deps) (*Provider, errors.Error) {
|
||||
return &Provider{
|
||||
logger: deps.Logger,
|
||||
config: deps.Config,
|
||||
httpClient: resty.New(),
|
||||
repository: deps.Repository,
|
||||
callbackService: deps.CallbackService,
|
||||
logger: deps.Logger,
|
||||
config: deps.Config,
|
||||
httpClient: resty.New(),
|
||||
repository: deps.Repository,
|
||||
callbackService: deps.CallbackService,
|
||||
paymentMethodRepository: deps.PaymentMethodRepository,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -76,6 +79,11 @@ func (p *Provider) CreateInvoice(ctx context.Context, req map[string]string) (st
|
||||
p.logger.Error("failed to create payment yandex receipt by parse map", zap.Error(err))
|
||||
return "", errors.NewWithMessage("failed to parse input request by parse map", errors.ErrInvalidArgs)
|
||||
}
|
||||
|
||||
if request.Recurrent {
|
||||
return p.CreateRecurrentPayment(ctx, request)
|
||||
}
|
||||
|
||||
idempotenceKey := uuid.New().String()
|
||||
|
||||
yandexPayment, err := p.httpClient.R().
|
||||
@ -100,8 +108,9 @@ func (p *Provider) CreateInvoice(ctx context.Context, req map[string]string) (st
|
||||
ReturnURL: request.ReturnURL,
|
||||
Enforce: true,
|
||||
},
|
||||
Capture: true,
|
||||
ClientIP: request.ClientIP,
|
||||
Capture: true,
|
||||
ClientIP: request.ClientIP,
|
||||
SavePaymentMethod: request.Auto,
|
||||
}).
|
||||
Post(p.config.PaymentsURL)
|
||||
|
||||
@ -163,6 +172,42 @@ func (p *Provider) handleWebhook(ctx *fiber.Ctx) error {
|
||||
p.logger.Error("failed to set payment complete", zap.Error(err))
|
||||
return errors.HTTP(ctx, err)
|
||||
}
|
||||
|
||||
if notification.Object.PaymentMethod != nil && notification.Object.PaymentMethod.Saved {
|
||||
method := &yandex.PaymentMethod{
|
||||
UserID: payment.UserID,
|
||||
MethodID: notification.Object.PaymentMethod.ID,
|
||||
Type: notification.Object.PaymentMethod.Type,
|
||||
Title: notification.Object.PaymentMethod.Title,
|
||||
Saved: notification.Object.PaymentMethod.Saved,
|
||||
}
|
||||
|
||||
if notification.Object.PaymentMethod.Card != nil {
|
||||
method.Card = &yandex.Card{
|
||||
First6: notification.Object.PaymentMethod.Card.First6,
|
||||
Last4: notification.Object.PaymentMethod.Card.Last4,
|
||||
ExpiryMonth: notification.Object.PaymentMethod.Card.ExpiryMonth,
|
||||
ExpiryYear: notification.Object.PaymentMethod.Card.ExpiryYear,
|
||||
CardType: notification.Object.PaymentMethod.Card.CardType,
|
||||
IssuerName: notification.Object.PaymentMethod.Card.IssuerName,
|
||||
IssuerCountry: notification.Object.PaymentMethod.Card.IssuerCountry,
|
||||
}
|
||||
}
|
||||
|
||||
if notification.Object.PaymentMethod.Card.CardProduct != nil {
|
||||
method.Card.CardProduct = &yandex.CardProduct{
|
||||
Code: notification.Object.PaymentMethod.Card.CardProduct.Code,
|
||||
Name: notification.Object.PaymentMethod.Card.CardProduct.Name,
|
||||
}
|
||||
}
|
||||
|
||||
if err := p.paymentMethodRepository.Save(ctx.Context(), method); err != nil {
|
||||
p.logger.Error("failed to save payment method", zap.Error(err),
|
||||
zap.String("userId", payment.UserID), zap.String("methodId", method.MethodID))
|
||||
// todo стоит ли возвращать ошибку?
|
||||
}
|
||||
}
|
||||
|
||||
case yandex.WebhookEventPaymentCanceled:
|
||||
payment, err = p.repository.SetPaymentStatus(ctx.Context(), notification.Object.ID, models.PaymentStatusCanceled)
|
||||
if err != nil {
|
||||
@ -210,3 +255,77 @@ func (p *Provider) handleWebhook(ctx *fiber.Ctx) error {
|
||||
|
||||
return ctx.SendStatus(http.StatusOK)
|
||||
}
|
||||
|
||||
func (p *Provider) CreateRecurrentPayment(ctx context.Context, request *models.CreatePayment[yandex.Receipt]) (string, errors.Error) {
|
||||
methods, err := p.paymentMethodRepository.GetByUserID(ctx, request.UserID)
|
||||
if err != nil {
|
||||
p.logger.Error("failed to get payment methods", zap.Error(err), zap.String("userId", request.UserID))
|
||||
return "", errors.NewWithError(err, errors.ErrInternalError)
|
||||
}
|
||||
|
||||
if len(methods) == 0 {
|
||||
p.logger.Warn("no saved payment methods found", zap.String("userId", request.UserID))
|
||||
return "", errors.NewWithMessage("no saved payment methods found", errors.ErrInvalidArgs)
|
||||
}
|
||||
|
||||
for _, method := range methods {
|
||||
idempotenceKey := uuid.New().String()
|
||||
|
||||
yandexPayment, err := p.httpClient.R().
|
||||
SetContext(ctx).
|
||||
SetHeader("Content-Type", "application/json").
|
||||
SetHeader("Idempotence-Key", idempotenceKey).
|
||||
SetHeader("Authorization", utils.ConvertYoomoneySercetsToAuth("Basic", p.config.StoreID, p.config.SecretKey)).
|
||||
SetBody(&yandex.CreateRecurrentPayment{
|
||||
Amount: yandex.Amount{
|
||||
Value: utils.ConvertAmountToStringFloat(request.Amount),
|
||||
Currency: request.Currency,
|
||||
},
|
||||
PaymentMethodID: method.MethodID,
|
||||
Capture: true,
|
||||
}).
|
||||
Post(p.config.PaymentsURL)
|
||||
|
||||
if err != nil {
|
||||
p.logger.Error("failed to create recurrent payment", zap.Error(err), zap.String("userId", request.UserID))
|
||||
return "", errors.NewWithError(fmt.Errorf("failed to create recurrent payment"), errors.ErrInternalError)
|
||||
}
|
||||
|
||||
if yandexPayment.StatusCode() != http.StatusOK {
|
||||
p.logger.Error("unexpected status code from yandex", zap.Int("statusCode", yandexPayment.StatusCode()), zap.String("userId", request.UserID))
|
||||
return "", errors.NewWithError(fmt.Errorf("unexpected status code: %d", yandexPayment.StatusCode()), errors.ErrInternalError)
|
||||
}
|
||||
|
||||
var payment yandex.Payment
|
||||
if err := json.Unmarshal(yandexPayment.Body(), &payment); err != nil {
|
||||
p.logger.Error("failed to unmarshal payment response", zap.Error(err), zap.String("userId", request.UserID), zap.String("methodId", method.MethodID))
|
||||
return "", errors.NewWithError(err, errors.ErrInternalError)
|
||||
}
|
||||
if payment.Status != yandex.PaymentStatusSuccessfully {
|
||||
p.logger.Error("payment not succeeded", zap.String("userId", request.UserID), zap.String("status", string(payment.Status)))
|
||||
continue
|
||||
}
|
||||
|
||||
_, err = p.repository.Insert(ctx, &models.Payment{
|
||||
UserID: request.UserID,
|
||||
PaymentID: payment.ID,
|
||||
IdempotencePaymentID: idempotenceKey,
|
||||
ClientIP: request.ClientIP,
|
||||
Currency: request.Currency,
|
||||
Amount: request.Amount,
|
||||
Type: request.Type,
|
||||
Status: models.PaymentStatusMap[string(payment.Status)],
|
||||
Completed: false,
|
||||
RawPaymentBody: payment,
|
||||
CallbackHostGRPC: request.CallbackHostGRPC,
|
||||
})
|
||||
if err != nil {
|
||||
p.logger.Error("failed to save payment to database", zap.Error(err))
|
||||
return "", errors.NewWithError(fmt.Errorf("failed to save payment to database: %w", err), errors.ErrInternalError)
|
||||
}
|
||||
|
||||
return payment.ID, nil
|
||||
}
|
||||
|
||||
return "", errors.NewWithMessage("failed to create recurrent payment with any saved method", errors.ErrInternalError)
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: callback/service.proto
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.14.0
|
||||
// source: service.proto
|
||||
|
||||
package payment_callback
|
||||
|
||||
@ -10,7 +10,6 @@ import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
_ "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
@ -35,7 +34,7 @@ type Event struct {
|
||||
func (x *Event) Reset() {
|
||||
*x = Event{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_callback_service_proto_msgTypes[0]
|
||||
mi := &file_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -48,7 +47,7 @@ func (x *Event) String() string {
|
||||
func (*Event) ProtoMessage() {}
|
||||
|
||||
func (x *Event) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_callback_service_proto_msgTypes[0]
|
||||
mi := &file_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -61,7 +60,7 @@ func (x *Event) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use Event.ProtoReflect.Descriptor instead.
|
||||
func (*Event) Descriptor() ([]byte, []int) {
|
||||
return file_callback_service_proto_rawDescGZIP(), []int{0}
|
||||
return file_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Event) GetKey() string {
|
||||
@ -104,7 +103,7 @@ type Payment struct {
|
||||
func (x *Payment) Reset() {
|
||||
*x = Payment{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_callback_service_proto_msgTypes[1]
|
||||
mi := &file_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -117,7 +116,7 @@ func (x *Payment) String() string {
|
||||
func (*Payment) ProtoMessage() {}
|
||||
|
||||
func (x *Payment) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_callback_service_proto_msgTypes[1]
|
||||
mi := &file_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -130,7 +129,7 @@ func (x *Payment) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use Payment.ProtoReflect.Descriptor instead.
|
||||
func (*Payment) Descriptor() ([]byte, []int) {
|
||||
return file_callback_service_proto_rawDescGZIP(), []int{1}
|
||||
return file_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Payment) GetID() string {
|
||||
@ -196,90 +195,94 @@ func (x *Payment) GetCompleted() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
var File_callback_service_proto protoreflect.FileDescriptor
|
||||
var File_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_callback_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x16, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e,
|
||||
0x74, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74,
|
||||
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
|
||||
0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x68, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e,
|
||||
0x74, 0x12, 0x10, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x33, 0x0a,
|
||||
0x07, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
|
||||
0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63,
|
||||
0x6b, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x22, 0x81, 0x02, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e,
|
||||
0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x16,
|
||||
0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
|
||||
0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e,
|
||||
0x74, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x49, 0x44, 0x12, 0x32, 0x0a, 0x14, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65,
|
||||
0x6e, 0x63, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x14, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x50,
|
||||
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75,
|
||||
0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65,
|
||||
0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x70,
|
||||
0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x43, 0x6f, 0x6d,
|
||||
0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x32, 0x98, 0x01, 0x0a, 0x16, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x3e, 0x0a, 0x09, 0x4f, 0x6e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x17,
|
||||
0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63,
|
||||
0x6b, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
|
||||
0x00, 0x12, 0x3e, 0x0a, 0x09, 0x4f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x17,
|
||||
0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63,
|
||||
0x6b, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
|
||||
0x00, 0x42, 0x14, 0x5a, 0x12, 0x2e, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63,
|
||||
0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
var file_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x10, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63,
|
||||
0x6b, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x68,
|
||||
0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63,
|
||||
0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52,
|
||||
0x07, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x81, 0x02, 0x0a, 0x07, 0x50, 0x61, 0x79,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x02, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09,
|
||||
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x09, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x32, 0x0a, 0x14, 0x49, 0x64,
|
||||
0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f,
|
||||
0x74, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x16,
|
||||
0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
|
||||
0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e,
|
||||
0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e,
|
||||
0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c,
|
||||
0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x09, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x32, 0xdd, 0x01, 0x0a,
|
||||
0x16, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x4f, 0x6e, 0x53, 0x75, 0x63,
|
||||
0x63, 0x65, 0x73, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63,
|
||||
0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||
0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x09, 0x4f, 0x6e, 0x46, 0x61, 0x69,
|
||||
0x6c, 0x75, 0x72, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63,
|
||||
0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||
0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x4f, 0x6e, 0x43, 0x61, 0x72,
|
||||
0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x61, 0x79, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x45, 0x76, 0x65,
|
||||
0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x14, 0x5a, 0x12,
|
||||
0x2e, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61,
|
||||
0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_callback_service_proto_rawDescOnce sync.Once
|
||||
file_callback_service_proto_rawDescData = file_callback_service_proto_rawDesc
|
||||
file_service_proto_rawDescOnce sync.Once
|
||||
file_service_proto_rawDescData = file_service_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_callback_service_proto_rawDescGZIP() []byte {
|
||||
file_callback_service_proto_rawDescOnce.Do(func() {
|
||||
file_callback_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_callback_service_proto_rawDescData)
|
||||
func file_service_proto_rawDescGZIP() []byte {
|
||||
file_service_proto_rawDescOnce.Do(func() {
|
||||
file_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_proto_rawDescData)
|
||||
})
|
||||
return file_callback_service_proto_rawDescData
|
||||
return file_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_callback_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_callback_service_proto_goTypes = []interface{}{
|
||||
var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_service_proto_goTypes = []interface{}{
|
||||
(*Event)(nil), // 0: payment_callback.Event
|
||||
(*Payment)(nil), // 1: payment_callback.Payment
|
||||
(*emptypb.Empty)(nil), // 2: google.protobuf.Empty
|
||||
}
|
||||
var file_callback_service_proto_depIdxs = []int32{
|
||||
var file_service_proto_depIdxs = []int32{
|
||||
1, // 0: payment_callback.Event.Payment:type_name -> payment_callback.Payment
|
||||
0, // 1: payment_callback.PaymentCallbackService.OnSuccess:input_type -> payment_callback.Event
|
||||
0, // 2: payment_callback.PaymentCallbackService.OnFailure:input_type -> payment_callback.Event
|
||||
2, // 3: payment_callback.PaymentCallbackService.OnSuccess:output_type -> google.protobuf.Empty
|
||||
2, // 4: payment_callback.PaymentCallbackService.OnFailure:output_type -> google.protobuf.Empty
|
||||
3, // [3:5] is the sub-list for method output_type
|
||||
1, // [1:3] is the sub-list for method input_type
|
||||
0, // 3: payment_callback.PaymentCallbackService.OnCartPurchase:input_type -> payment_callback.Event
|
||||
2, // 4: payment_callback.PaymentCallbackService.OnSuccess:output_type -> google.protobuf.Empty
|
||||
2, // 5: payment_callback.PaymentCallbackService.OnFailure:output_type -> google.protobuf.Empty
|
||||
2, // 6: payment_callback.PaymentCallbackService.OnCartPurchase:output_type -> google.protobuf.Empty
|
||||
4, // [4:7] is the sub-list for method output_type
|
||||
1, // [1:4] 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_callback_service_proto_init() }
|
||||
func file_callback_service_proto_init() {
|
||||
if File_callback_service_proto != nil {
|
||||
func init() { file_service_proto_init() }
|
||||
func file_service_proto_init() {
|
||||
if File_service_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_callback_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Event); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -291,7 +294,7 @@ func file_callback_service_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_callback_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Payment); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -308,18 +311,18 @@ func file_callback_service_proto_init() {
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_callback_service_proto_rawDesc,
|
||||
RawDescriptor: file_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_callback_service_proto_goTypes,
|
||||
DependencyIndexes: file_callback_service_proto_depIdxs,
|
||||
MessageInfos: file_callback_service_proto_msgTypes,
|
||||
GoTypes: file_service_proto_goTypes,
|
||||
DependencyIndexes: file_service_proto_depIdxs,
|
||||
MessageInfos: file_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_callback_service_proto = out.File
|
||||
file_callback_service_proto_rawDesc = nil
|
||||
file_callback_service_proto_goTypes = nil
|
||||
file_callback_service_proto_depIdxs = nil
|
||||
File_service_proto = out.File
|
||||
file_service_proto_rawDesc = nil
|
||||
file_service_proto_goTypes = nil
|
||||
file_service_proto_depIdxs = nil
|
||||
}
|
||||
|
@ -1,8 +1,4 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: callback/service.proto
|
||||
|
||||
package payment_callback
|
||||
|
||||
@ -19,17 +15,13 @@ 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.
|
||||
type PaymentCallbackServiceClient interface {
|
||||
OnSuccess(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
OnFailure(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
OnCartPurchase(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type paymentCallbackServiceClient struct {
|
||||
@ -42,7 +34,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, PaymentCallbackService_OnSuccess_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/payment_callback.PaymentCallbackService/OnSuccess", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -51,7 +43,16 @@ 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, PaymentCallbackService_OnFailure_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/payment_callback.PaymentCallbackService/OnFailure", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *paymentCallbackServiceClient) OnCartPurchase(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/payment_callback.PaymentCallbackService/OnCartPurchase", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -59,14 +60,16 @@ func (c *paymentCallbackServiceClient) OnFailure(ctx context.Context, in *Event,
|
||||
}
|
||||
|
||||
// PaymentCallbackServiceServer is the server API for PaymentCallbackService service.
|
||||
// All implementations should embed UnimplementedPaymentCallbackServiceServer
|
||||
// All implementations must embed UnimplementedPaymentCallbackServiceServer
|
||||
// for forward compatibility
|
||||
type PaymentCallbackServiceServer interface {
|
||||
OnSuccess(context.Context, *Event) (*emptypb.Empty, error)
|
||||
OnFailure(context.Context, *Event) (*emptypb.Empty, error)
|
||||
OnCartPurchase(context.Context, *Event) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedPaymentCallbackServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedPaymentCallbackServiceServer should be embedded to have forward compatible implementations.
|
||||
// UnimplementedPaymentCallbackServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedPaymentCallbackServiceServer struct {
|
||||
}
|
||||
|
||||
@ -76,6 +79,11 @@ func (UnimplementedPaymentCallbackServiceServer) OnSuccess(context.Context, *Eve
|
||||
func (UnimplementedPaymentCallbackServiceServer) OnFailure(context.Context, *Event) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OnFailure not implemented")
|
||||
}
|
||||
func (UnimplementedPaymentCallbackServiceServer) OnCartPurchase(context.Context, *Event) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OnCartPurchase not implemented")
|
||||
}
|
||||
func (UnimplementedPaymentCallbackServiceServer) mustEmbedUnimplementedPaymentCallbackServiceServer() {
|
||||
}
|
||||
|
||||
// UnsafePaymentCallbackServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PaymentCallbackServiceServer will
|
||||
@ -98,7 +106,7 @@ func _PaymentCallbackService_OnSuccess_Handler(srv interface{}, ctx context.Cont
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PaymentCallbackService_OnSuccess_FullMethodName,
|
||||
FullMethod: "/payment_callback.PaymentCallbackService/OnSuccess",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentCallbackServiceServer).OnSuccess(ctx, req.(*Event))
|
||||
@ -116,7 +124,7 @@ func _PaymentCallbackService_OnFailure_Handler(srv interface{}, ctx context.Cont
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PaymentCallbackService_OnFailure_FullMethodName,
|
||||
FullMethod: "/payment_callback.PaymentCallbackService/OnFailure",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentCallbackServiceServer).OnFailure(ctx, req.(*Event))
|
||||
@ -124,6 +132,24 @@ func _PaymentCallbackService_OnFailure_Handler(srv interface{}, ctx context.Cont
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PaymentCallbackService_OnCartPurchase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Event)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PaymentCallbackServiceServer).OnCartPurchase(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/payment_callback.PaymentCallbackService/OnCartPurchase",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentCallbackServiceServer).OnCartPurchase(ctx, req.(*Event))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PaymentCallbackService_ServiceDesc is the grpc.ServiceDesc for PaymentCallbackService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@ -139,7 +165,11 @@ var PaymentCallbackService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "OnFailure",
|
||||
Handler: _PaymentCallbackService_OnFailure_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "OnCartPurchase",
|
||||
Handler: _PaymentCallbackService_OnCartPurchase_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "callback/service.proto",
|
||||
Metadata: "service.proto",
|
||||
}
|
||||
|
@ -1,408 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: treasurer/payment.model.proto
|
||||
|
||||
package treasurer
|
||||
|
||||
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 MainPaymentSettings struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Currency string `protobuf:"bytes,1,opt,name=Currency,proto3" json:"Currency,omitempty"`
|
||||
Amount int64 `protobuf:"varint,2,opt,name=Amount,proto3" json:"Amount,omitempty"`
|
||||
CallbackHostGRPC []string `protobuf:"bytes,3,rep,name=CallbackHostGRPC,proto3" json:"CallbackHostGRPC,omitempty"`
|
||||
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() {
|
||||
*x = MainPaymentSettings{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_payment_model_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MainPaymentSettings) ProtoMessage() {}
|
||||
|
||||
func (x *MainPaymentSettings) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_payment_model_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 MainPaymentSettings.ProtoReflect.Descriptor instead.
|
||||
func (*MainPaymentSettings) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_payment_model_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetCurrency() string {
|
||||
if x != nil {
|
||||
return x.Currency
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetAmount() int64 {
|
||||
if x != nil {
|
||||
return x.Amount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetCallbackHostGRPC() []string {
|
||||
if x != nil {
|
||||
return x.CallbackHostGRPC
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetReturnURL() string {
|
||||
if x != nil {
|
||||
return x.ReturnURL
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetUserID() string {
|
||||
if x != nil {
|
||||
return x.UserID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetClientIP() string {
|
||||
if x != nil {
|
||||
return x.ClientIP
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
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 *Customer) Reset() {
|
||||
*x = Customer{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_payment_model_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Customer) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Customer) ProtoMessage() {}
|
||||
|
||||
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))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Customer.ProtoReflect.Descriptor instead.
|
||||
func (*Customer) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_payment_model_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Customer) GetFullName() string {
|
||||
if x != nil {
|
||||
return x.FullName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Customer) GetINN() string {
|
||||
if x != nil {
|
||||
return x.INN
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Customer) GetEmail() string {
|
||||
if x != nil {
|
||||
return x.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Customer) GetPhone() string {
|
||||
if x != nil {
|
||||
return x.Phone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
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 ""
|
||||
}
|
||||
|
||||
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, 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,
|
||||
0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
|
||||
0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61,
|
||||
0x63, 0x6b, 0x48, 0x6f, 0x73, 0x74, 0x47, 0x52, 0x50, 0x43, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09,
|
||||
0x52, 0x10, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x48, 0x6f, 0x73, 0x74, 0x47, 0x52,
|
||||
0x50, 0x43, 0x12, 0x1c, 0x0a, 0x09, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x55, 0x52, 0x4c, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x55, 0x52, 0x4c,
|
||||
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, 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,
|
||||
}
|
||||
|
||||
var (
|
||||
file_treasurer_payment_model_proto_rawDescOnce sync.Once
|
||||
file_treasurer_payment_model_proto_rawDescData = file_treasurer_payment_model_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_treasurer_payment_model_proto_rawDescGZIP() []byte {
|
||||
file_treasurer_payment_model_proto_rawDescOnce.Do(func() {
|
||||
file_treasurer_payment_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_treasurer_payment_model_proto_rawDescData)
|
||||
})
|
||||
return file_treasurer_payment_model_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_treasurer_payment_model_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_treasurer_payment_model_proto_goTypes = []interface{}{
|
||||
(*MainPaymentSettings)(nil), // 0: treasurer.MainPaymentSettings
|
||||
(*Customer)(nil), // 1: treasurer.Customer
|
||||
(*Item)(nil), // 2: treasurer.Item
|
||||
}
|
||||
var file_treasurer_payment_model_proto_depIdxs = []int32{
|
||||
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() }
|
||||
func file_treasurer_payment_model_proto_init() {
|
||||
if File_treasurer_payment_model_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_treasurer_payment_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MainPaymentSettings); 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[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
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:
|
||||
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_treasurer_payment_model_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_treasurer_payment_model_proto_goTypes,
|
||||
DependencyIndexes: file_treasurer_payment_model_proto_depIdxs,
|
||||
MessageInfos: file_treasurer_payment_model_proto_msgTypes,
|
||||
}.Build()
|
||||
File_treasurer_payment_model_proto = out.File
|
||||
file_treasurer_payment_model_proto_rawDesc = nil
|
||||
file_treasurer_payment_model_proto_goTypes = nil
|
||||
file_treasurer_payment_model_proto_depIdxs = nil
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: treasurer/service.proto
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.14.0
|
||||
// source: service.proto
|
||||
|
||||
package treasurer
|
||||
|
||||
@ -32,7 +32,7 @@ type GetBankCardPaymentLinkRequest struct {
|
||||
func (x *GetBankCardPaymentLinkRequest) Reset() {
|
||||
*x = GetBankCardPaymentLinkRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_service_proto_msgTypes[0]
|
||||
mi := &file_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -45,7 +45,7 @@ func (x *GetBankCardPaymentLinkRequest) String() string {
|
||||
func (*GetBankCardPaymentLinkRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetBankCardPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_service_proto_msgTypes[0]
|
||||
mi := &file_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -58,7 +58,7 @@ func (x *GetBankCardPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetBankCardPaymentLinkRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetBankCardPaymentLinkRequest) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_service_proto_rawDescGZIP(), []int{0}
|
||||
return file_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GetBankCardPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
||||
@ -79,7 +79,7 @@ type GetPaymentLinkRequest struct {
|
||||
func (x *GetPaymentLinkRequest) Reset() {
|
||||
*x = GetPaymentLinkRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_service_proto_msgTypes[1]
|
||||
mi := &file_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -92,7 +92,7 @@ func (x *GetPaymentLinkRequest) String() string {
|
||||
func (*GetPaymentLinkRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_service_proto_msgTypes[1]
|
||||
mi := &file_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -105,7 +105,7 @@ func (x *GetPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetPaymentLinkRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetPaymentLinkRequest) Descriptor() ([]byte, []int) {
|
||||
return file_treasurer_service_proto_rawDescGZIP(), []int{1}
|
||||
return file_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
||||
@ -128,7 +128,7 @@ type GetB2BPaymentLinkRequest struct {
|
||||
func (x *GetB2BPaymentLinkRequest) Reset() {
|
||||
*x = GetB2BPaymentLinkRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_service_proto_msgTypes[2]
|
||||
mi := &file_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -141,7 +141,7 @@ func (x *GetB2BPaymentLinkRequest) String() string {
|
||||
func (*GetB2BPaymentLinkRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetB2BPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_service_proto_msgTypes[2]
|
||||
mi := &file_service_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -154,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{2}
|
||||
return file_service_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *GetB2BPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
||||
@ -189,7 +189,7 @@ type GetPaymentLinkResponse struct {
|
||||
func (x *GetPaymentLinkResponse) Reset() {
|
||||
*x = GetPaymentLinkResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_treasurer_service_proto_msgTypes[3]
|
||||
mi := &file_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -202,7 +202,7 @@ func (x *GetPaymentLinkResponse) String() string {
|
||||
func (*GetPaymentLinkResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetPaymentLinkResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_treasurer_service_proto_msgTypes[3]
|
||||
mi := &file_service_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -215,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{3}
|
||||
return file_service_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *GetPaymentLinkResponse) GetRedirectURL() string {
|
||||
@ -225,137 +225,544 @@ func (x *GetPaymentLinkResponse) GetRedirectURL() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_treasurer_service_proto protoreflect.FileDescriptor
|
||||
type DeleteSavedPaymentMethodsRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
var file_treasurer_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x17, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x74, 0x72, 0x65, 0x61, 0x73,
|
||||
0x75, 0x72, 0x65, 0x72, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
|
||||
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, 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,
|
||||
UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DeleteSavedPaymentMethodsRequest) Reset() {
|
||||
*x = DeleteSavedPaymentMethodsRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_service_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DeleteSavedPaymentMethodsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteSavedPaymentMethodsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteSavedPaymentMethodsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_service_proto_msgTypes[4]
|
||||
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 DeleteSavedPaymentMethodsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteSavedPaymentMethodsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_service_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *DeleteSavedPaymentMethodsRequest) GetUserID() string {
|
||||
if x != nil {
|
||||
return x.UserID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type MainPaymentSettings struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Currency string `protobuf:"bytes,1,opt,name=Currency,proto3" json:"Currency,omitempty"`
|
||||
Amount int64 `protobuf:"varint,2,opt,name=Amount,proto3" json:"Amount,omitempty"`
|
||||
CallbackHostGRPC []string `protobuf:"bytes,3,rep,name=CallbackHostGRPC,proto3" json:"CallbackHostGRPC,omitempty"`
|
||||
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"`
|
||||
Auto bool `protobuf:"varint,9,opt,name=Auto,proto3" json:"Auto,omitempty"`
|
||||
Recurrent bool `protobuf:"varint,10,opt,name=Recurrent,proto3" json:"Recurrent,omitempty"`
|
||||
// Для крипто-платежей:
|
||||
FromWalletAddress string `protobuf:"bytes,11,opt,name=from_wallet_address,json=fromWalletAddress,proto3" json:"from_wallet_address,omitempty"`
|
||||
ToWalletAddress string `protobuf:"bytes,12,opt,name=to_wallet_address,json=toWalletAddress,proto3" json:"to_wallet_address,omitempty"`
|
||||
CryptoAmount float64 `protobuf:"fixed64,13,opt,name=crypto_amount,json=cryptoAmount,proto3" json:"crypto_amount,omitempty"`
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) Reset() {
|
||||
*x = MainPaymentSettings{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_service_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MainPaymentSettings) ProtoMessage() {}
|
||||
|
||||
func (x *MainPaymentSettings) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_service_proto_msgTypes[5]
|
||||
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 MainPaymentSettings.ProtoReflect.Descriptor instead.
|
||||
func (*MainPaymentSettings) Descriptor() ([]byte, []int) {
|
||||
return file_service_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetCurrency() string {
|
||||
if x != nil {
|
||||
return x.Currency
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetAmount() int64 {
|
||||
if x != nil {
|
||||
return x.Amount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetCallbackHostGRPC() []string {
|
||||
if x != nil {
|
||||
return x.CallbackHostGRPC
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetReturnURL() string {
|
||||
if x != nil {
|
||||
return x.ReturnURL
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetUserID() string {
|
||||
if x != nil {
|
||||
return x.UserID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetClientIP() string {
|
||||
if x != nil {
|
||||
return x.ClientIP
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetAuto() bool {
|
||||
if x != nil {
|
||||
return x.Auto
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetRecurrent() bool {
|
||||
if x != nil {
|
||||
return x.Recurrent
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetFromWalletAddress() string {
|
||||
if x != nil {
|
||||
return x.FromWalletAddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetToWalletAddress() string {
|
||||
if x != nil {
|
||||
return x.ToWalletAddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MainPaymentSettings) GetCryptoAmount() float64 {
|
||||
if x != nil {
|
||||
return x.CryptoAmount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Customer struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
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 *Customer) Reset() {
|
||||
*x = Customer{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_service_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Customer) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Customer) ProtoMessage() {}
|
||||
|
||||
func (x *Customer) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_service_proto_msgTypes[6]
|
||||
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 Customer.ProtoReflect.Descriptor instead.
|
||||
func (*Customer) Descriptor() ([]byte, []int) {
|
||||
return file_service_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *Customer) GetFullName() string {
|
||||
if x != nil {
|
||||
return x.FullName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Customer) GetINN() string {
|
||||
if x != nil {
|
||||
return x.INN
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Customer) GetEmail() string {
|
||||
if x != nil {
|
||||
return x.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Customer) GetPhone() string {
|
||||
if x != nil {
|
||||
return x.Phone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
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_service_proto_msgTypes[7]
|
||||
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_service_proto_msgTypes[7]
|
||||
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_service_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
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 ""
|
||||
}
|
||||
|
||||
var File_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x09, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74,
|
||||
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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,
|
||||
0x22, 0x3a, 0x0a, 0x20, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x61, 0x76, 0x65, 0x64, 0x50,
|
||||
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0xd2, 0x03, 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, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x43, 0x61, 0x6c, 0x6c,
|
||||
0x62, 0x61, 0x63, 0x6b, 0x48, 0x6f, 0x73, 0x74, 0x47, 0x52, 0x50, 0x43, 0x18, 0x03, 0x20, 0x03,
|
||||
0x28, 0x09, 0x52, 0x10, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x48, 0x6f, 0x73, 0x74,
|
||||
0x47, 0x52, 0x50, 0x43, 0x12, 0x1c, 0x0a, 0x09, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x55, 0x52,
|
||||
0x4c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x55,
|
||||
0x52, 0x4c, 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, 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, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x41, 0x75, 0x74, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x41, 0x75,
|
||||
0x74, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x52, 0x65, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18,
|
||||
0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x52, 0x65, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74,
|
||||
0x12, 0x2e, 0x0a, 0x13, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f,
|
||||
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x66,
|
||||
0x72, 0x6f, 0x6d, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
|
||||
0x12, 0x2a, 0x0a, 0x11, 0x74, 0x6f, 0x5f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64,
|
||||
0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x6f, 0x57,
|
||||
0x61, 0x6c, 0x6c, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x0d,
|
||||
0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0d, 0x20,
|
||||
0x01, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x41, 0x6d, 0x6f, 0x75, 0x6e,
|
||||
0x74, 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, 0x32, 0x98, 0x06, 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, 0x59, 0x6f, 0x6f, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61,
|
||||
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, 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,
|
||||
0x12, 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, 0x12, 0x5e, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c,
|
||||
0x69, 0x6e, 0x6b, 0x41, 0x6c, 0x63, 0x68, 0x65, 0x6d, 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, 0x62, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x61, 0x76, 0x65, 0x64,
|
||||
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x2b,
|
||||
0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74,
|
||||
0x65, 0x53, 0x61, 0x76, 0x65, 0x64, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74,
|
||||
0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
|
||||
0x70, 0x74, 0x79, 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 (
|
||||
file_treasurer_service_proto_rawDescOnce sync.Once
|
||||
file_treasurer_service_proto_rawDescData = file_treasurer_service_proto_rawDesc
|
||||
file_service_proto_rawDescOnce sync.Once
|
||||
file_service_proto_rawDescData = file_service_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_treasurer_service_proto_rawDescGZIP() []byte {
|
||||
file_treasurer_service_proto_rawDescOnce.Do(func() {
|
||||
file_treasurer_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_treasurer_service_proto_rawDescData)
|
||||
func file_service_proto_rawDescGZIP() []byte {
|
||||
file_service_proto_rawDescOnce.Do(func() {
|
||||
file_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_proto_rawDescData)
|
||||
})
|
||||
return file_treasurer_service_proto_rawDescData
|
||||
return file_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_treasurer_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_treasurer_service_proto_goTypes = []interface{}{
|
||||
(*GetBankCardPaymentLinkRequest)(nil), // 0: treasurer.GetBankCardPaymentLinkRequest
|
||||
(*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_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
var file_service_proto_goTypes = []interface{}{
|
||||
(*GetBankCardPaymentLinkRequest)(nil), // 0: treasurer.GetBankCardPaymentLinkRequest
|
||||
(*GetPaymentLinkRequest)(nil), // 1: treasurer.GetPaymentLinkRequest
|
||||
(*GetB2BPaymentLinkRequest)(nil), // 2: treasurer.GetB2BPaymentLinkRequest
|
||||
(*GetPaymentLinkResponse)(nil), // 3: treasurer.GetPaymentLinkResponse
|
||||
(*DeleteSavedPaymentMethodsRequest)(nil), // 4: treasurer.DeleteSavedPaymentMethodsRequest
|
||||
(*MainPaymentSettings)(nil), // 5: treasurer.MainPaymentSettings
|
||||
(*Customer)(nil), // 6: treasurer.Customer
|
||||
(*Item)(nil), // 7: treasurer.Item
|
||||
(*emptypb.Empty)(nil), // 8: google.protobuf.Empty
|
||||
}
|
||||
var file_treasurer_service_proto_depIdxs = []int32{
|
||||
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
|
||||
var file_service_proto_depIdxs = []int32{
|
||||
5, // 0: treasurer.GetBankCardPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
5, // 1: treasurer.GetPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
5, // 2: treasurer.GetB2BPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||
8, // 3: treasurer.GetB2BPaymentLinkRequest.VatData:type_name -> google.protobuf.Empty
|
||||
6, // 4: treasurer.MainPaymentSettings.Customer:type_name -> treasurer.Customer
|
||||
7, // 5: treasurer.MainPaymentSettings.Items:type_name -> treasurer.Item
|
||||
1, // 6: treasurer.TreasurerService.GetPaymentLinkBankCard:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 7: treasurer.TreasurerService.GetPaymentLinkYooMoney:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 8: treasurer.TreasurerService.GetPaymentLinkTinkoff:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 9: treasurer.TreasurerService.GetPaymentLinkSberbankB2B:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 10: treasurer.TreasurerService.GetPaymentLinkSBP:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 11: treasurer.TreasurerService.GetPaymentLinkSberPay:input_type -> treasurer.GetPaymentLinkRequest
|
||||
1, // 12: treasurer.TreasurerService.GetPaymentLinkAlchemy:input_type -> treasurer.GetPaymentLinkRequest
|
||||
4, // 13: treasurer.TreasurerService.DeleteSavedPaymentMethods:input_type -> treasurer.DeleteSavedPaymentMethodsRequest
|
||||
3, // 14: treasurer.TreasurerService.GetPaymentLinkBankCard:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 15: treasurer.TreasurerService.GetPaymentLinkYooMoney:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 16: treasurer.TreasurerService.GetPaymentLinkTinkoff:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 17: treasurer.TreasurerService.GetPaymentLinkSberbankB2B:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 18: treasurer.TreasurerService.GetPaymentLinkSBP:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 19: treasurer.TreasurerService.GetPaymentLinkSberPay:output_type -> treasurer.GetPaymentLinkResponse
|
||||
3, // 20: treasurer.TreasurerService.GetPaymentLinkAlchemy:output_type -> treasurer.GetPaymentLinkResponse
|
||||
8, // 21: treasurer.TreasurerService.DeleteSavedPaymentMethods:output_type -> google.protobuf.Empty
|
||||
14, // [14:22] is the sub-list for method output_type
|
||||
6, // [6:14] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_treasurer_service_proto_init() }
|
||||
func file_treasurer_service_proto_init() {
|
||||
if File_treasurer_service_proto != nil {
|
||||
func init() { file_service_proto_init() }
|
||||
func file_service_proto_init() {
|
||||
if File_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_treasurer_payment_model_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_treasurer_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetBankCardPaymentLinkRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -367,7 +774,7 @@ func file_treasurer_service_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_treasurer_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetPaymentLinkRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -379,7 +786,7 @@ func file_treasurer_service_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_treasurer_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetB2BPaymentLinkRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -391,7 +798,7 @@ func file_treasurer_service_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_treasurer_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetPaymentLinkResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -403,23 +810,71 @@ func file_treasurer_service_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DeleteSavedPaymentMethodsRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MainPaymentSettings); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Customer); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Item); 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_treasurer_service_proto_rawDesc,
|
||||
RawDescriptor: file_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumMessages: 8,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_treasurer_service_proto_goTypes,
|
||||
DependencyIndexes: file_treasurer_service_proto_depIdxs,
|
||||
MessageInfos: file_treasurer_service_proto_msgTypes,
|
||||
GoTypes: file_service_proto_goTypes,
|
||||
DependencyIndexes: file_service_proto_depIdxs,
|
||||
MessageInfos: file_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_treasurer_service_proto = out.File
|
||||
file_treasurer_service_proto_rawDesc = nil
|
||||
file_treasurer_service_proto_goTypes = nil
|
||||
file_treasurer_service_proto_depIdxs = nil
|
||||
File_service_proto = out.File
|
||||
file_service_proto_rawDesc = nil
|
||||
file_service_proto_goTypes = nil
|
||||
file_service_proto_depIdxs = nil
|
||||
}
|
||||
|
@ -1,8 +1,4 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: treasurer/service.proto
|
||||
|
||||
package treasurer
|
||||
|
||||
@ -11,6 +7,7 @@ import (
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
@ -18,15 +15,6 @@ 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.
|
||||
@ -37,6 +25,8 @@ type TreasurerServiceClient interface {
|
||||
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)
|
||||
GetPaymentLinkAlchemy(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||
DeleteSavedPaymentMethods(ctx context.Context, in *DeleteSavedPaymentMethodsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type treasurerServiceClient struct {
|
||||
@ -49,7 +39,7 @@ func NewTreasurerServiceClient(cc grpc.ClientConnInterface) TreasurerServiceClie
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkBankCard(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkBankCard_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkBankCard", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -58,7 +48,7 @@ func (c *treasurerServiceClient) GetPaymentLinkBankCard(ctx context.Context, in
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkYooMoney(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkYooMoney_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkYooMoney", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -67,7 +57,7 @@ func (c *treasurerServiceClient) GetPaymentLinkYooMoney(ctx context.Context, in
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkTinkoff(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkTinkoff_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkTinkoff", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -76,7 +66,7 @@ func (c *treasurerServiceClient) GetPaymentLinkTinkoff(ctx context.Context, in *
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkSberbankB2B(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -85,7 +75,7 @@ func (c *treasurerServiceClient) GetPaymentLinkSberbankB2B(ctx context.Context,
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkSBP(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSBP_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSBP", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -94,7 +84,25 @@ func (c *treasurerServiceClient) GetPaymentLinkSBP(ctx context.Context, in *GetP
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkSberPay(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSberPay_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSberPay", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *treasurerServiceClient) GetPaymentLinkAlchemy(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||
out := new(GetPaymentLinkResponse)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkAlchemy", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *treasurerServiceClient) DeleteSavedPaymentMethods(ctx context.Context, in *DeleteSavedPaymentMethodsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/DeleteSavedPaymentMethods", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -102,7 +110,7 @@ func (c *treasurerServiceClient) GetPaymentLinkSberPay(ctx context.Context, in *
|
||||
}
|
||||
|
||||
// TreasurerServiceServer is the server API for TreasurerService service.
|
||||
// All implementations should embed UnimplementedTreasurerServiceServer
|
||||
// All implementations must embed UnimplementedTreasurerServiceServer
|
||||
// for forward compatibility
|
||||
type TreasurerServiceServer interface {
|
||||
GetPaymentLinkBankCard(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
@ -111,9 +119,12 @@ type TreasurerServiceServer interface {
|
||||
GetPaymentLinkSberbankB2B(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSBP(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkSberPay(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
GetPaymentLinkAlchemy(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||
DeleteSavedPaymentMethods(context.Context, *DeleteSavedPaymentMethodsRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedTreasurerServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedTreasurerServiceServer should be embedded to have forward compatible implementations.
|
||||
// UnimplementedTreasurerServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedTreasurerServiceServer struct {
|
||||
}
|
||||
|
||||
@ -135,6 +146,13 @@ func (UnimplementedTreasurerServiceServer) GetPaymentLinkSBP(context.Context, *G
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSberPay(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSberPay not implemented")
|
||||
}
|
||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkAlchemy(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkAlchemy not implemented")
|
||||
}
|
||||
func (UnimplementedTreasurerServiceServer) DeleteSavedPaymentMethods(context.Context, *DeleteSavedPaymentMethodsRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteSavedPaymentMethods not implemented")
|
||||
}
|
||||
func (UnimplementedTreasurerServiceServer) mustEmbedUnimplementedTreasurerServiceServer() {}
|
||||
|
||||
// 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
|
||||
@ -157,7 +175,7 @@ func _TreasurerService_GetPaymentLinkBankCard_Handler(srv interface{}, ctx conte
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TreasurerService_GetPaymentLinkBankCard_FullMethodName,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkBankCard",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkBankCard(ctx, req.(*GetPaymentLinkRequest))
|
||||
@ -175,7 +193,7 @@ func _TreasurerService_GetPaymentLinkYooMoney_Handler(srv interface{}, ctx conte
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TreasurerService_GetPaymentLinkYooMoney_FullMethodName,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkYooMoney",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkYooMoney(ctx, req.(*GetPaymentLinkRequest))
|
||||
@ -193,7 +211,7 @@ func _TreasurerService_GetPaymentLinkTinkoff_Handler(srv interface{}, ctx contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TreasurerService_GetPaymentLinkTinkoff_FullMethodName,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkTinkoff",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkTinkoff(ctx, req.(*GetPaymentLinkRequest))
|
||||
@ -211,7 +229,7 @@ func _TreasurerService_GetPaymentLinkSberbankB2B_Handler(srv interface{}, ctx co
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberbankB2B(ctx, req.(*GetPaymentLinkRequest))
|
||||
@ -229,7 +247,7 @@ func _TreasurerService_GetPaymentLinkSBP_Handler(srv interface{}, ctx context.Co
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TreasurerService_GetPaymentLinkSBP_FullMethodName,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSBP",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSBP(ctx, req.(*GetPaymentLinkRequest))
|
||||
@ -247,7 +265,7 @@ func _TreasurerService_GetPaymentLinkSberPay_Handler(srv interface{}, ctx contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TreasurerService_GetPaymentLinkSberPay_FullMethodName,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSberPay",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberPay(ctx, req.(*GetPaymentLinkRequest))
|
||||
@ -255,6 +273,42 @@ func _TreasurerService_GetPaymentLinkSberPay_Handler(srv interface{}, ctx contex
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TreasurerService_GetPaymentLinkAlchemy_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).GetPaymentLinkAlchemy(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkAlchemy",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).GetPaymentLinkAlchemy(ctx, req.(*GetPaymentLinkRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TreasurerService_DeleteSavedPaymentMethods_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteSavedPaymentMethodsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TreasurerServiceServer).DeleteSavedPaymentMethods(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/treasurer.TreasurerService/DeleteSavedPaymentMethods",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TreasurerServiceServer).DeleteSavedPaymentMethods(ctx, req.(*DeleteSavedPaymentMethodsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// TreasurerService_ServiceDesc is the grpc.ServiceDesc for TreasurerService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@ -286,7 +340,15 @@ var TreasurerService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetPaymentLinkSberPay",
|
||||
Handler: _TreasurerService_GetPaymentLinkSberPay_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPaymentLinkAlchemy",
|
||||
Handler: _TreasurerService_GetPaymentLinkAlchemy_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteSavedPaymentMethods",
|
||||
Handler: _TreasurerService_DeleteSavedPaymentMethods_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "treasurer/service.proto",
|
||||
Metadata: "service.proto",
|
||||
}
|
||||
|
@ -31,6 +31,11 @@ var PaymentFields = struct {
|
||||
DeletedAt string
|
||||
RawPaymentBody string
|
||||
CallbackHostGRPC string
|
||||
|
||||
WalletAddress string // for crypto
|
||||
CryptoAmount string // for crypto
|
||||
ToWalletAddress string
|
||||
FromWalletAddress string
|
||||
}{
|
||||
ID: "_id",
|
||||
UserID: "userId",
|
||||
@ -48,6 +53,11 @@ var PaymentFields = struct {
|
||||
DeletedAt: "deletedAt",
|
||||
RawPaymentBody: "rawPaymentBody",
|
||||
CallbackHostGRPC: "callbackHostGrpc",
|
||||
|
||||
WalletAddress: "walletAddress",
|
||||
CryptoAmount: "cryptoAmount",
|
||||
ToWalletAddress: "toWalletAddress",
|
||||
FromWalletAddress: "fromWalletAddress",
|
||||
}
|
||||
|
||||
type PaymentRepositoryDeps struct {
|
||||
@ -156,3 +166,34 @@ func (r *PaymentRepository) SetPaymentStatus(ctx context.Context, paymentID stri
|
||||
|
||||
return &payment, nil
|
||||
}
|
||||
|
||||
func (r *PaymentRepository) FindByWalletsAndAmount(ctx context.Context, toWalletAddress, fromWalletAddress string, cryptoAmount float64) (*models.Payment, errors.Error) {
|
||||
payment := models.Payment{}
|
||||
filter := bson.M{
|
||||
PaymentFields.ToWalletAddress: toWalletAddress,
|
||||
PaymentFields.FromWalletAddress: fromWalletAddress,
|
||||
PaymentFields.CryptoAmount: cryptoAmount,
|
||||
PaymentFields.Status: models.PaymentStatusWaiting,
|
||||
}
|
||||
if err := r.collection.FindOne(ctx, filter).Decode(&payment); err != nil {
|
||||
r.logger.Error("failed to find payment by wallets and amount on <FindByWalletsAndAmount> of <PaymentRepository>",
|
||||
zap.Error(err),
|
||||
zap.String("toWalletAddress", toWalletAddress),
|
||||
zap.String("fromWalletAddress", fromWalletAddress),
|
||||
zap.Float64("cryptoAmount", cryptoAmount),
|
||||
)
|
||||
|
||||
findErr := errors.NewWithError(
|
||||
fmt.Errorf("failed to find payment by wallets and amount: %w", err),
|
||||
errors.ErrInternalError,
|
||||
)
|
||||
|
||||
if err == mongo.ErrNoDocuments {
|
||||
return nil, findErr.SetType(errors.ErrNotFound)
|
||||
}
|
||||
|
||||
return nil, findErr
|
||||
}
|
||||
|
||||
return &payment, nil
|
||||
}
|
||||
|
61
internal/repository/payment_method.go
Normal file
61
internal/repository/payment_method.go
Normal file
@ -0,0 +1,61 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
"gitea.pena/PenaSide/treasurer/internal/models/yandex"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type PaymentMethodRepositoryDeps struct {
|
||||
Logger *zap.Logger
|
||||
Collection *mongo.Collection
|
||||
}
|
||||
|
||||
type PaymentMethodRepository struct {
|
||||
logger *zap.Logger
|
||||
collection *mongo.Collection
|
||||
}
|
||||
|
||||
func NewPaymentMethodRepository(deps PaymentMethodRepositoryDeps) *PaymentMethodRepository {
|
||||
return &PaymentMethodRepository{
|
||||
logger: deps.Logger,
|
||||
collection: deps.Collection,
|
||||
}
|
||||
}
|
||||
|
||||
func (r *PaymentMethodRepository) Save(ctx context.Context, method *yandex.PaymentMethod) error {
|
||||
_, err := r.collection.InsertOne(ctx, method)
|
||||
if err != nil {
|
||||
r.logger.Error("failed to save payment method", zap.Error(err), zap.String("userId", method.UserID))
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *PaymentMethodRepository) GetByUserID(ctx context.Context, userID string) ([]*yandex.PaymentMethod, error) {
|
||||
cursor, err := r.collection.Find(ctx, bson.M{"userId": userID})
|
||||
if err != nil {
|
||||
r.logger.Error("failed to find payment methods", zap.Error(err), zap.String("userId", userID))
|
||||
return nil, err
|
||||
}
|
||||
defer cursor.Close(ctx)
|
||||
|
||||
var methods []*yandex.PaymentMethod
|
||||
if err := cursor.All(ctx, &methods); err != nil {
|
||||
r.logger.Error("failed to decode payment methods", zap.Error(err), zap.String("userId", userID))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return methods, nil
|
||||
}
|
||||
|
||||
func (r *PaymentMethodRepository) DeleteByUserID(ctx context.Context, userID string) error {
|
||||
_, err := r.collection.DeleteMany(ctx, bson.M{"userId": userID})
|
||||
if err != nil {
|
||||
r.logger.Error("failed to delete payment methods", zap.Error(err), zap.String("userId", userID))
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
@ -29,6 +29,21 @@ func MapToCreatePaymentYandexReceipt(data map[string]string) (*models.CreatePaym
|
||||
return nil, fmt.Errorf("missing requisites field")
|
||||
}
|
||||
|
||||
auto := false
|
||||
if val, ok := data["save_payment_method"]; ok && val != "" {
|
||||
auto, err = strconv.ParseBool(val)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid save_payment_method field: %w", err)
|
||||
}
|
||||
}
|
||||
recurrent := false
|
||||
if val, ok := data["recurrent"]; ok && val != "" {
|
||||
recurrent, err = strconv.ParseBool(val)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid recurrent field: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
payment := &models.CreatePayment[yandex.Receipt]{
|
||||
Type: models.PaymentType(data["type"]),
|
||||
Currency: data["currency"],
|
||||
@ -38,6 +53,8 @@ func MapToCreatePaymentYandexReceipt(data map[string]string) (*models.CreatePaym
|
||||
UserID: data["user_id"],
|
||||
ClientIP: data["client_ip"],
|
||||
Requisites: requisites,
|
||||
Auto: auto,
|
||||
Recurrent: recurrent,
|
||||
}
|
||||
|
||||
return payment, nil
|
||||
|
@ -1,37 +0,0 @@
|
||||
package closer
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type Closer interface {
|
||||
Close(ctx context.Context) error
|
||||
}
|
||||
|
||||
type CloserFunc func(ctx context.Context) error
|
||||
|
||||
func (cf CloserFunc) Close(ctx context.Context) error {
|
||||
return cf(ctx)
|
||||
}
|
||||
|
||||
type CloserGroup struct {
|
||||
closers []Closer
|
||||
}
|
||||
|
||||
func NewCloserGroup() *CloserGroup {
|
||||
return &CloserGroup{}
|
||||
}
|
||||
|
||||
func (cg *CloserGroup) Add(c Closer) {
|
||||
cg.closers = append(cg.closers, c)
|
||||
}
|
||||
|
||||
func (cg *CloserGroup) Call(ctx context.Context) error {
|
||||
var closeErr error
|
||||
for i := len(cg.closers) - 1; i >= 0; i-- {
|
||||
if err := cg.closers[i].Close(ctx); err != nil && closeErr == nil {
|
||||
closeErr = err
|
||||
}
|
||||
}
|
||||
return closeErr
|
||||
}
|
@ -3,13 +3,14 @@ syntax = "proto3";
|
||||
package payment_callback;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
//import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "./payment_callback";
|
||||
|
||||
service PaymentCallbackService {
|
||||
rpc OnSuccess(Event) returns (google.protobuf.Empty) {}
|
||||
rpc OnFailure(Event) returns (google.protobuf.Empty) {}
|
||||
rpc OnCartPurchase(Event) returns (google.protobuf.Empty) {}
|
||||
}
|
||||
|
||||
message Event {
|
||||
|
@ -1,31 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package treasurer;
|
||||
|
||||
option go_package = "./treasurer";
|
||||
|
||||
message MainPaymentSettings {
|
||||
string Currency = 1;
|
||||
int64 Amount = 2;
|
||||
repeated string CallbackHostGRPC = 3;
|
||||
string ReturnURL = 4;
|
||||
string UserID = 5;
|
||||
string ClientIP = 6;
|
||||
Customer Customer = 7;
|
||||
repeated Item Items = 8;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
@ -3,7 +3,6 @@ syntax = "proto3";
|
||||
package treasurer;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "treasurer/payment.model.proto";
|
||||
|
||||
option go_package = "./treasurer";
|
||||
|
||||
@ -14,6 +13,8 @@ service TreasurerService {
|
||||
rpc GetPaymentLinkSberbankB2B(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkSBP(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkSberPay(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
rpc GetPaymentLinkAlchemy(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||
rpc DeleteSavedPaymentMethods(DeleteSavedPaymentMethodsRequest) returns (google.protobuf.Empty) {}
|
||||
}
|
||||
|
||||
message GetBankCardPaymentLinkRequest {
|
||||
@ -33,3 +34,40 @@ message GetB2BPaymentLinkRequest {
|
||||
message GetPaymentLinkResponse {
|
||||
string RedirectURL = 1;
|
||||
}
|
||||
|
||||
message DeleteSavedPaymentMethodsRequest {
|
||||
string UserID = 1;
|
||||
}
|
||||
|
||||
|
||||
message MainPaymentSettings {
|
||||
string Currency = 1;
|
||||
int64 Amount = 2;
|
||||
repeated string CallbackHostGRPC = 3;
|
||||
string ReturnURL = 4;
|
||||
string UserID = 5;
|
||||
string ClientIP = 6;
|
||||
Customer Customer = 7;
|
||||
repeated Item Items = 8;
|
||||
bool Auto = 9;
|
||||
bool Recurrent = 10;
|
||||
// Для крипто-платежей:
|
||||
string from_wallet_address = 11;
|
||||
string to_wallet_address = 12;
|
||||
double crypto_amount = 13;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user