service

package
v1.10.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2021 License: GPL-3.0 Imports: 78 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PaymentSystemHandlerMockOk      = "mock_ok"
	PaymentSystemHandlerMockError   = "mock_error"
	PaymentSystemHandlerCardPayMock = "cardpay_mock"
)
View Source
const (
	CountryCodeUSA = "US"

	DefaultLanguage = "en"
)
View Source
const (
	VatPeriodEvery1Month = 1
	VatPeriodEvery2Month = 2
	VatPeriodEvery3Month = 3
)

Variables

Functions

func CreateKeyProductsForProject added in v1.3.0

func CreateKeyProductsForProject(
	suite suite.Suite,
	service *Service,
	project *billingpb.Project,
	productsCount int,
) []*billingpb.KeyProduct

func CreateProductsForProject added in v1.3.0

func CreateProductsForProject(
	suite suite.Suite,
	service *Service,
	project *billingpb.Project,
	productsCount int,
) []*billingpb.Product

func HelperCreateAndPayOrder added in v1.3.0

func HelperCreateAndPayOrder(
	suite suite.Suite,
	service *Service,
	amount float64,
	currency, country string,
	project *billingpb.Project,
	paymentMethod *billingpb.PaymentMethod,
	cookie string,
) *billingpb.Order

func HelperCreateAndPayOrder2 added in v1.3.0

func HelperCreateAndPayOrder2(
	suite suite.Suite,
	service *Service,
	amount float64,
	currency, country string,
	project *billingpb.Project,
	paymentMethod *billingpb.PaymentMethod,
	paymentMethodClosedAt time.Time,
	product *billingpb.Product,
	keyProduct *billingpb.KeyProduct,
	issuerUrl string,
	metadata map[string]string,
	cookie string,
) *billingpb.Order

func HelperCreateAndPayOrderWithRecurring added in v1.8.0

func HelperCreateAndPayOrderWithRecurring(
	suite suite.Suite,
	service *Service,
	amount float64,
	currency, country string,
	project *billingpb.Project,
	paymentMethod *billingpb.PaymentMethod,
	cookie,
	recurringPeriod,
	recurringDateEnd string,
) *billingpb.Order

func HelperCreateAndPayOrderWithUser added in v1.8.0

func HelperCreateAndPayOrderWithUser(
	suite suite.Suite,
	service *Service,
	amount float64,
	currency, country string,
	project *billingpb.Project,
	paymentMethod *billingpb.PaymentMethod,
	paymentMethodClosedAt time.Time,
	product *billingpb.Product,
	keyProduct *billingpb.KeyProduct,
	issuerUrl string,
	metadata map[string]string,
	userEmail string,
	cookie string,
) *billingpb.Order

func HelperCreateAndPayPaylinkOrder added in v1.3.0

func HelperCreateAndPayPaylinkOrder(
	suite suite.Suite,
	service *Service,
	paylinkId, country, cookie string,
	paymentMethod *billingpb.PaymentMethod,
	issuer *billingpb.OrderIssuer,
) *billingpb.Order

func HelperCreateEntitiesForTests added in v1.3.0

func HelperCreateEntitiesForTests(suite suite.Suite, service *Service) (
	*billingpb.Merchant,
	*billingpb.Project,
	*billingpb.PaymentMethod,
	*billingpb.PaymentSystem,
	*billingpb.Customer,
)

func HelperCreateMerchant added in v1.3.0

func HelperCreateMerchant(
	suite suite.Suite,
	service *Service,
	currency string,
	country string,
	paymentMethod *billingpb.PaymentMethod,
	minPayoutAmount float64,
	operatingCompanyId string,
) *billingpb.Merchant

func HelperCreateProject added in v1.3.0

func HelperCreateProject(
	suite suite.Suite,
	service *Service,
	merchantId string,
	vatPayer string,
) *billingpb.Project

func HelperGetOrdersViewsMap added in v1.4.0

func HelperGetOrdersViewsMap(
	suite suite.Suite,
	service *Service,
	orderIds []primitive.ObjectID,
) []map[string]interface{}

func HelperMakeRefund added in v1.3.0

func HelperMakeRefund(suite suite.Suite, service *Service, order *billingpb.Order, amount float64, isChargeback bool) *billingpb.Refund

func HelperOperatingCompany added in v1.3.0

func HelperOperatingCompany(
	suite suite.Suite,
	service *Service,
) *billingpb.OperatingCompany

func HelperPayOrder added in v1.3.0

func HelperPayOrder(
	suite suite.Suite,
	service *Service,
	order *billingpb.Order,
	paymentMethod *billingpb.PaymentMethod,
	country string,
	cookie string,
) *billingpb.Order

func NewPaymentSystemGateway added in v1.8.0

func NewPaymentSystemGateway() payment_system.PaymentSystemManagerInterface

func NewPaymentSystemMockError

func NewPaymentSystemMockError() payment_system.PaymentSystemInterface

func NewPaymentSystemMockOk

func NewPaymentSystemMockOk() payment_system.PaymentSystemInterface

func NewVatReportProcessor

func NewVatReportProcessor(s *Service, ctx context.Context, date *timestamp.Timestamp) (*vatReportProcessor, error)

func RandomString

func RandomString(n int) string

Types

type BrowserCookieCustomer

type BrowserCookieCustomer struct {
	CustomerId        string    `json:"customer_id"`
	VirtualCustomerId string    `json:"virtual_customer_id"`
	Ip                string    `json:"ip"`
	IpCountry         string    `json:"ip_country"`
	SelectedCountry   string    `json:"selected_country"`
	UserAgent         string    `json:"user_agent"`
	AcceptLanguage    string    `json:"accept_language"`
	SessionCount      int32     `json:"session_count"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
}

type Centrifugo

type Centrifugo struct {
	// contains filtered or unexported fields
}

func (*Centrifugo) GetChannelToken

func (c *Centrifugo) GetChannelToken(subject string, expire int64) string

func (*Centrifugo) Publish

func (c *Centrifugo) Publish(ctx context.Context, channel string, msg interface{}) error

type CentrifugoInterface

type CentrifugoInterface interface {
	Publish(context.Context, string, interface{}) error
	GetChannelToken(subject string, expire int64) string
}

type DashboardRepository

type DashboardRepository Repository

type EmailConfirmToken

type EmailConfirmToken struct {
	Token     string
	ProfileId string
	CreatedAt time.Time
}

type Gateway added in v1.2.0

type Gateway struct {
	// contains filtered or unexported fields
}

func (*Gateway) GetGateway added in v1.8.0

func (m *Gateway) GetGateway(name string) (payment_system.PaymentSystemInterface, error)

type OrderCreateRequestProcessor

type OrderCreateRequestProcessor struct {
	*Service
	// contains filtered or unexported fields
}

func (*OrderCreateRequestProcessor) UserCountryExists

func (v *OrderCreateRequestProcessor) UserCountryExists() bool

type PaymentCreateProcessor

type PaymentCreateProcessor struct {
	// contains filtered or unexported fields
}

func (*PaymentCreateProcessor) GetMerchantId

func (v *PaymentCreateProcessor) GetMerchantId() string

type PaymentFormProcessor

type PaymentFormProcessor struct {
	// contains filtered or unexported fields
}

type PaymentSystemMockError

type PaymentSystemMockError struct{}

func (*PaymentSystemMockError) CanSaveCard added in v1.8.0

func (m *PaymentSystemMockError) CanSaveCard(_ proto.Message) bool

func (*PaymentSystemMockError) CreatePayment

func (m *PaymentSystemMockError) CreatePayment(_ *billingpb.Order, _, _ string, _ map[string]string) (string, error)

func (*PaymentSystemMockError) CreateRecurringSubscription added in v1.8.0

func (m *PaymentSystemMockError) CreateRecurringSubscription(_ *billingpb.Order, _ *recurringpb.Subscription, _, _ string, _ map[string]string) (string, error)

func (*PaymentSystemMockError) CreateRefund

func (m *PaymentSystemMockError) CreateRefund(_ *billingpb.Order, refund *billingpb.Refund) error

func (*PaymentSystemMockError) DeleteRecurringSubscription added in v1.8.0

func (m *PaymentSystemMockError) DeleteRecurringSubscription(_ *billingpb.Order, _ *recurringpb.Subscription) error

func (*PaymentSystemMockError) GetRecurringId

func (m *PaymentSystemMockError) GetRecurringId(_ proto.Message) string

func (*PaymentSystemMockError) IsRecurringCallback

func (m *PaymentSystemMockError) IsRecurringCallback(_ proto.Message) bool

func (*PaymentSystemMockError) IsSubscriptionCallback added in v1.8.0

func (m *PaymentSystemMockError) IsSubscriptionCallback(_ proto.Message) bool

func (*PaymentSystemMockError) ProcessPayment

func (m *PaymentSystemMockError) ProcessPayment(_ *billingpb.Order, _ proto.Message, _, _ string) error

func (*PaymentSystemMockError) ProcessRefund

func (m *PaymentSystemMockError) ProcessRefund(_ *billingpb.Order, refund *billingpb.Refund, _ proto.Message, _, _ string) error

type PaymentSystemMockOk

type PaymentSystemMockOk struct{}

func (*PaymentSystemMockOk) CanSaveCard added in v1.8.0

func (m *PaymentSystemMockOk) CanSaveCard(_ proto.Message) bool

func (*PaymentSystemMockOk) CreatePayment

func (m *PaymentSystemMockOk) CreatePayment(_ *billingpb.Order, _, _ string, _ map[string]string) (string, error)

func (*PaymentSystemMockOk) CreateRecurringSubscription added in v1.8.0

func (m *PaymentSystemMockOk) CreateRecurringSubscription(_ *billingpb.Order, _ *recurringpb.Subscription, _, _ string, _ map[string]string) (string, error)

func (*PaymentSystemMockOk) CreateRefund

func (m *PaymentSystemMockOk) CreateRefund(_ *billingpb.Order, refund *billingpb.Refund) error

func (*PaymentSystemMockOk) DeleteRecurringSubscription added in v1.8.0

func (m *PaymentSystemMockOk) DeleteRecurringSubscription(_ *billingpb.Order, _ *recurringpb.Subscription) error

func (*PaymentSystemMockOk) GetRecurringId

func (m *PaymentSystemMockOk) GetRecurringId(_ proto.Message) string

func (*PaymentSystemMockOk) IsRecurringCallback

func (m *PaymentSystemMockOk) IsRecurringCallback(_ proto.Message) bool

func (*PaymentSystemMockOk) IsSubscriptionCallback added in v1.8.0

func (m *PaymentSystemMockOk) IsSubscriptionCallback(_ proto.Message) bool

func (*PaymentSystemMockOk) ProcessPayment

func (m *PaymentSystemMockOk) ProcessPayment(_ *billingpb.Order, _ proto.Message, _, _ string) error

func (*PaymentSystemMockOk) ProcessRefund

func (m *PaymentSystemMockOk) ProcessRefund(_ *billingpb.Order, refund *billingpb.Refund, _ proto.Message, _, _ string) error

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewBillingService

func NewBillingService(
	db mongodb.SourceInterface,
	cfg *config.Config,
	geo proto.GeoIpService,
	rep recurringpb.RepositoryService,
	tax taxpb.TaxService,
	broker rabbitmq.BrokerInterface,
	redis redis.Cmdable,
	cache database.CacheInterface,
	curService currenciespb.CurrencyRatesService,
	documentSigner document_signerpb.DocumentSignerService,
	reporterService reporterpb.ReporterService,
	formatter paysuper_i18n.Formatter,
	postmarkBroker rabbitmq.BrokerInterface,
	casbinService casbinpb.CasbinService,
	notifier notifierpb.NotifierService,
	validateUserBroker rabbitmq.BrokerInterface,
) *Service

func (*Service) AcceptInvite

func (*Service) AddMerchantDocument added in v1.9.0

func (s *Service) AddMerchantDocument(
	ctx context.Context,
	req *billingpb.MerchantDocument,
	res *billingpb.AddMerchantDocumentResponse,
) error

func (*Service) AddOperatingCompany

func (s *Service) AddOperatingCompany(
	ctx context.Context,
	req *billingpb.OperatingCompany,
	res *billingpb.EmptyResponseWithStatus,
) (err error)

func (*Service) AutoAcceptRoyaltyReports

func (s *Service) AutoAcceptRoyaltyReports(
	ctx context.Context,
	_ *billingpb.EmptyRequest,
	_ *billingpb.EmptyResponse,
) error

func (*Service) AutoCreatePayoutDocuments

func (s *Service) AutoCreatePayoutDocuments(
	ctx context.Context,
	_ *billingpb.EmptyRequest,
	_ *billingpb.EmptyResponse,
) error

func (*Service) CalcAnnualTurnovers

func (s *Service) CalcAnnualTurnovers(ctx context.Context, req *billingpb.EmptyRequest, res *billingpb.EmptyResponse) error

func (*Service) CancelRedeemKeyForOrder

func (s *Service) CancelRedeemKeyForOrder(
	ctx context.Context,
	req *billingpb.KeyForOrderRequest,
	res *billingpb.EmptyResponseWithStatus,
) error

func (*Service) ChangeMerchant

func (*Service) ChangeMerchantPaymentMethod

func (s *Service) ChangeMerchantPaymentMethod(
	ctx context.Context,
	req *billingpb.MerchantPaymentMethodRequest,
	rsp *billingpb.MerchantPaymentMethodResponse,
) (err error)

func (*Service) ChangeProject

func (s *Service) ChangeProject(
	ctx context.Context,
	req *billingpb.Project,
	rsp *billingpb.ChangeProjectResponse,
) error

func (*Service) ChangeRoyaltyReport

func (s *Service) ChangeRoyaltyReport(
	ctx context.Context,
	req *billingpb.ChangeRoyaltyReportRequest,
	rsp *billingpb.ResponseError,
) error

func (*Service) ConfirmUserEmail

func (*Service) CreateNotification

func (*Service) CreateOrUpdateKeyProduct

func (s *Service) CreateOrUpdateKeyProduct(
	ctx context.Context,
	req *billingpb.CreateOrUpdateKeyProductRequest,
	res *billingpb.KeyProductResponse,
) error
func (s *Service) CreateOrUpdatePaylink(
	ctx context.Context,
	req *billingpb.CreatePaylinkRequest,
	res *billingpb.GetPaylinkResponse,
) (err error)

CreateOrUpdatePaylink create or modify payment link

func (*Service) CreateOrUpdatePaymentMethod

func (s *Service) CreateOrUpdatePaymentMethod(
	ctx context.Context,
	req *billingpb.PaymentMethod,
	rsp *billingpb.ChangePaymentMethodResponse,
) error

func (*Service) CreateOrUpdateProduct

func (s *Service) CreateOrUpdateProduct(ctx context.Context, req *billingpb.Product, res *billingpb.Product) error

func (*Service) CreateOrUpdateUserProfile

func (s *Service) CreateOrUpdateUserProfile(
	ctx context.Context,
	req *billingpb.UserProfile,
	rsp *billingpb.GetUserProfileResponse,
) error

func (*Service) CreateRefund

func (*Service) CreateToken

func (s *Service) CreateToken(
	ctx context.Context,
	req *billingpb.TokenRequest,
	rsp *billingpb.TokenResponse,
) error

func (*Service) DeleteAdminUser

func (*Service) DeleteCustomerCard added in v1.8.0

func (*Service) DeleteKeyProduct

func (*Service) DeleteMerchantUser

func (s *Service) DeleteMerchantUser(
	ctx context.Context,
	req *billingpb.MerchantRoleRequest,
	res *billingpb.EmptyResponseWithStatus,
) error

func (*Service) DeleteMoneyBackCostMerchant

func (s *Service) DeleteMoneyBackCostMerchant(
	ctx context.Context,
	req *billingpb.PaymentCostDeleteRequest,
	res *billingpb.ResponseError,
) error

func (*Service) DeleteMoneyBackCostSystem

func (s *Service) DeleteMoneyBackCostSystem(
	ctx context.Context,
	req *billingpb.PaymentCostDeleteRequest,
	res *billingpb.ResponseError,
) error

DeletePaylink deletes payment link

func (*Service) DeletePaymentChannelCostMerchant

func (s *Service) DeletePaymentChannelCostMerchant(
	ctx context.Context,
	req *billingpb.PaymentCostDeleteRequest,
	res *billingpb.ResponseError,
) error

func (*Service) DeletePaymentChannelCostSystem

func (s *Service) DeletePaymentChannelCostSystem(
	ctx context.Context,
	req *billingpb.PaymentCostDeleteRequest,
	res *billingpb.ResponseError,
) error

func (*Service) DeleteProduct

func (s *Service) DeleteProduct(ctx context.Context, req *billingpb.RequestProduct, res *billingpb.EmptyResponse) error

func (*Service) DeleteProject

func (*Service) DeleteRecurringSubscription added in v1.8.0

func (*Service) DeleteSavedCard

func (*Service) DeserializeCookie added in v1.8.0

func (*Service) FindAllOrders

func (s *Service) FindAllOrders(
	ctx context.Context,
	req *billingpb.ListOrdersRequest,
	rsp *billingpb.ListOrdersResponse,
) error

func (*Service) FindAllOrdersPrivate

func (s *Service) FindAllOrdersPrivate(
	ctx context.Context,
	req *billingpb.ListOrdersRequest,
	rsp *billingpb.ListOrdersPrivateResponse,
) error

func (*Service) FindAllOrdersPublic

func (s *Service) FindAllOrdersPublic(
	ctx context.Context,
	req *billingpb.ListOrdersRequest,
	rsp *billingpb.ListOrdersPublicResponse,
) error

func (*Service) FindByZipCode

func (*Service) FindSubscriptions added in v1.8.0

func (*Service) FinishRedeemKeyForOrder

func (s *Service) FinishRedeemKeyForOrder(
	ctx context.Context,
	req *billingpb.KeyForOrderRequest,
	res *billingpb.GetKeyForOrderRequestResponse,
) error

func (*Service) FixTaxes added in v1.2.0

func (s *Service) FixTaxes(ctx context.Context) error

func (*Service) FormatAmount

func (s *Service) FormatAmount(amount float64, currency string) float64

func (*Service) GetActOfCompletion added in v1.7.0

func (*Service) GetActsOfCompletionList added in v1.8.0

func (*Service) GetAdminByUserId added in v1.3.0

func (s *Service) GetAdminByUserId(
	ctx context.Context,
	req *billingpb.CommonUserProfileRequest,
	rsp *billingpb.UserRoleResponse,
) error

func (*Service) GetAdminUserRole

func (s *Service) GetAdminUserRole(
	ctx context.Context,
	req *billingpb.AdminRoleRequest,
	res *billingpb.UserRoleResponse,
) error

func (*Service) GetAdminUsers

func (*Service) GetAllMoneyBackCostSystem

func (s *Service) GetAllMoneyBackCostSystem(
	ctx context.Context,
	req *billingpb.EmptyRequest,
	res *billingpb.MoneyBackCostSystemListResponse,
) error

func (*Service) GetAllPaymentChannelCostSystem

func (s *Service) GetAllPaymentChannelCostSystem(
	ctx context.Context,
	req *billingpb.EmptyRequest,
	res *billingpb.PaymentChannelCostSystemListResponse,
) error

func (*Service) GetAmountForVirtualCurrency

func (s *Service) GetAmountForVirtualCurrency(virtualAmount float64, group *billingpb.PriceGroup, prices []*billingpb.ProductPrice) (float64, error)

func (*Service) GetB2bVatRate added in v1.10.10

func (s *Service) GetB2bVatRate(operatingCompanyCountry, merchantCountry string) (rate float64, err error)

func (*Service) GetCommonUserProfile

func (*Service) GetCountriesList

func (s *Service) GetCountriesList(
	ctx context.Context,
	req *billingpb.EmptyRequest,
	res *billingpb.CountriesList,
) error

func (*Service) GetCountry

func (s *Service) GetCountry(
	ctx context.Context,
	req *billingpb.GetCountryRequest,
	res *billingpb.Country,
) error

func (*Service) GetCustomerInfo added in v1.8.0

func (*Service) GetCustomerList added in v1.8.0

func (*Service) GetCustomerShortInfo added in v1.8.0

func (*Service) GetDashboardCustomerArpu added in v1.8.0

func (*Service) GetDashboardCustomersReport added in v1.8.0

func (*Service) GetDashboardMainReport

func (s *Service) GetDashboardMainReport(
	ctx context.Context,
	req *billingpb.GetDashboardMainRequest,
	rsp *billingpb.GetDashboardMainResponse,
) error

func (*Service) GetKeyProduct

func (*Service) GetKeyProductInfo

func (*Service) GetKeyProducts

func (*Service) GetKeyProductsForOrder

func (*Service) GetMerchantBy

func (*Service) GetMerchantDocument added in v1.9.0

func (*Service) GetMerchantDocuments added in v1.9.0

func (*Service) GetMerchantUserRole

func (s *Service) GetMerchantUserRole(
	ctx context.Context,
	req *billingpb.MerchantRoleRequest,
	res *billingpb.UserRoleResponse,
) error

func (*Service) GetNotification

func (s *Service) GetNotification(
	ctx context.Context,
	req *billingpb.GetNotificationRequest,
	rsp *billingpb.Notification,
) error

func (*Service) GetOperatingCompaniesList

func (s *Service) GetOperatingCompaniesList(
	ctx context.Context,
	req *billingpb.EmptyRequest,
	res *billingpb.GetOperatingCompaniesListResponse,
) (err error)

func (*Service) GetOperatingCompany

func (s *Service) GetOperatingCompany(
	ctx context.Context,
	req *billingpb.GetOperatingCompanyRequest,
	res *billingpb.GetOperatingCompanyResponse,
) (err error)

func (*Service) GetOrderKeyProducts

func (s *Service) GetOrderKeyProducts(ctx context.Context, projectId string, productIds []string) ([]*billingpb.KeyProduct, error)

func (*Service) GetOrderKeyProductsAmount

func (s *Service) GetOrderKeyProductsAmount(products []*billingpb.KeyProduct, group *billingpb.PriceGroup, platformId string) (float64, error)

func (*Service) GetOrderKeyProductsItems

func (s *Service) GetOrderKeyProductsItems(products []*billingpb.KeyProduct, language string, group *billingpb.PriceGroup, platformId string) ([]*billingpb.OrderItem, error)

func (*Service) GetOrderPrivate

func (s *Service) GetOrderPrivate(
	ctx context.Context,
	req *billingpb.GetOrderRequest,
	rsp *billingpb.GetOrderPrivateResponse,
) error

func (*Service) GetOrderProducts

func (s *Service) GetOrderProducts(ctx context.Context, projectId string, productIds []string) ([]*billingpb.Product, error)

func (*Service) GetOrderProductsAmount

func (s *Service) GetOrderProductsAmount(products []*billingpb.Product, group *billingpb.PriceGroup) (float64, error)

func (*Service) GetOrderProductsItems

func (s *Service) GetOrderProductsItems(products []*billingpb.Product, language string, group *billingpb.PriceGroup) ([]*billingpb.OrderItem, error)

func (*Service) GetOrderPublic

func (s *Service) GetOrderPublic(
	ctx context.Context,
	req *billingpb.GetOrderRequest,
	rsp *billingpb.GetOrderPublicResponse,
) error
func (s *Service) GetPaylink(
	ctx context.Context,
	req *billingpb.PaylinkRequest,
	res *billingpb.GetPaylinkResponse,
) (err error)

GetPaylink returns one payment link

func (*Service) GetPaylinkStatByCountry

GetPaylinkStatByCountry returns stat groped by country for requested paylink and period

func (*Service) GetPaylinkStatByDate

GetPaylinkStatByDate returns stat groped by date for requested paylink and period

func (*Service) GetPaylinkStatByReferrer

func (s *Service) GetPaylinkStatByReferrer(
	ctx context.Context,
	req *billingpb.GetPaylinkStatCommonRequest,
	res *billingpb.GetPaylinkStatCommonGroupResponse,
) (err error)

GetPaylinkStatByReferrer returns stat grouped by referer hosts for requested paylink and period

func (*Service) GetPaylinkStatByUtm

GetPaylinkStatByUtm returns stat groped by utm labels for requested paylink and period

func (*Service) GetPaylinkStatTotal

GetPaylinkStatTotal returns total stat for requested paylink and period

func (*Service) GetPaylinkTransactions added in v1.1.0

func (s *Service) GetPaylinkTransactions(
	ctx context.Context,
	req *billingpb.GetPaylinkTransactionsRequest,
	res *billingpb.TransactionsResponse,
) error

func (*Service) GetPaylinkURL

func (s *Service) GetPaylinkURL(
	ctx context.Context,
	req *billingpb.GetPaylinkURLRequest,
	res *billingpb.GetPaylinkUrlResponse,
) (err error)

GetPaylinkURL returns public url for Paylink

GetPaylinks returns list of all payment links

func (*Service) GetPaymentMinLimitsSystem

func (s *Service) GetPaymentMinLimitsSystem(
	ctx context.Context,
	req *billingpb.EmptyRequest,
	res *billingpb.GetPaymentMinLimitsSystemResponse,
) (err error)

func (*Service) GetPayoutDocument

func (s *Service) GetPayoutDocument(
	ctx context.Context,
	req *billingpb.GetPayoutDocumentRequest,
	res *billingpb.PayoutDocumentResponse,
) (err error)

func (*Service) GetPayoutDocumentRoyaltyReports

func (s *Service) GetPayoutDocumentRoyaltyReports(
	ctx context.Context,
	req *billingpb.GetPayoutDocumentRequest,
	res *billingpb.ListRoyaltyReportsResponse,
) error

func (*Service) GetPlatforms

func (*Service) GetPriceGroup

func (s *Service) GetPriceGroup(
	ctx context.Context,
	req *billingpb.GetPriceGroupRequest,
	res *billingpb.PriceGroup,
) error

func (*Service) GetPriceGroupByCountry

func (s *Service) GetPriceGroupByCountry(
	ctx context.Context,
	req *billingpb.PriceGroupByCountryRequest,
	res *billingpb.PriceGroup,
) error

func (*Service) GetPriceGroupCurrencies

func (s *Service) GetPriceGroupCurrencies(
	ctx context.Context,
	req *billingpb.EmptyRequest,
	res *billingpb.PriceGroupCurrenciesResponse,
) error

func (*Service) GetPriceGroupCurrencyByRegion

func (s *Service) GetPriceGroupCurrencyByRegion(
	ctx context.Context,
	req *billingpb.PriceGroupByRegionRequest,
	res *billingpb.PriceGroupCurrenciesResponse,
) error

func (*Service) GetProduct

func (*Service) GetProductPrices

func (s *Service) GetProductPrices(ctx context.Context, req *billingpb.RequestProduct, res *billingpb.ProductPricesResponse) error

func (*Service) GetProductsForOrder

func (*Service) GetProject

func (*Service) GetRecommendedPriceByConversion

func (s *Service) GetRecommendedPriceByConversion(
	ctx context.Context,
	req *billingpb.RecommendedPriceRequest,
	res *billingpb.RecommendedPriceResponse,
) error

func (*Service) GetRecommendedPriceByPriceGroup

func (s *Service) GetRecommendedPriceByPriceGroup(
	ctx context.Context,
	req *billingpb.RecommendedPriceRequest,
	res *billingpb.RecommendedPriceResponse,
) error

func (*Service) GetRefund

func (*Service) GetRoleList

func (*Service) GetRoyaltyReport

func (*Service) GetSubscription added in v1.8.0

func (*Service) GetSubscriptionOrders added in v1.8.0

func (*Service) GetUserProfile

func (*Service) GetVatReport added in v1.2.0

func (s *Service) GetVatReport(
	ctx context.Context,
	req *billingpb.VatReportRequest,
	res *billingpb.VatReportResponse,
) error

func (*Service) GetVatReportTransactions

func (s *Service) GetVatReportTransactions(
	ctx context.Context,
	req *billingpb.VatTransactionsRequest,
	res *billingpb.PrivateTransactionsResponse,
) error

func (*Service) GetVatReportsDashboard

func (s *Service) GetVatReportsDashboard(
	ctx context.Context,
	req *billingpb.EmptyRequest,
	res *billingpb.VatReportsResponse,
) error

func (*Service) GetVatReportsForCountry

func (s *Service) GetVatReportsForCountry(
	ctx context.Context,
	req *billingpb.VatReportsRequest,
	res *billingpb.VatReportsResponse,
) error

func (*Service) IncrPaylinkVisits

func (s *Service) IncrPaylinkVisits(
	ctx context.Context,
	req *billingpb.PaylinkRequestById,
	_ *billingpb.EmptyResponse,
) error

IncrPaylinkVisits adds a visit hit to stat

func (*Service) Init

func (s *Service) Init() (err error)

func (*Service) InviteUserAdmin

func (*Service) IsChangeDataAllow

func (s *Service) IsChangeDataAllow(merchant *billingpb.Merchant, data *billingpb.OnboardingRequest) bool

func (*Service) IsDbNotFoundError

func (s *Service) IsDbNotFoundError(err error) bool

func (*Service) KeyDaemonProcess

func (s *Service) KeyDaemonProcess(ctx context.Context) (int, error)

func (*Service) ListMerchants

func (*Service) ListMerchantsForAgreement added in v1.8.0

func (*Service) ListNotifications

func (s *Service) ListNotifications(
	ctx context.Context,
	req *billingpb.ListingNotificationRequest,
	rsp *billingpb.Notifications,
) error

func (*Service) ListProducts

func (*Service) ListProjects

func (*Service) ListRefunds

func (*Service) ListRoyaltyReportOrders

func (s *Service) ListRoyaltyReportOrders(
	ctx context.Context,
	req *billingpb.ListRoyaltyReportOrdersRequest,
	res *billingpb.TransactionsResponse,
) error

func (*Service) MarkNotificationAsRead

func (s *Service) MarkNotificationAsRead(
	ctx context.Context,
	req *billingpb.GetNotificationRequest,
	rsp *billingpb.Notification,
) error

func (*Service) MerchantReviewRoyaltyReport

func (s *Service) MerchantReviewRoyaltyReport(
	ctx context.Context,
	req *billingpb.MerchantReviewRoyaltyReportRequest,
	rsp *billingpb.ResponseError,
) error

func (*Service) MerchantsMigrate

func (s *Service) MerchantsMigrate(ctx context.Context) error

func (*Service) MigrateCustomers added in v1.6.0

func (s *Service) MigrateCustomers(ctx context.Context) error

func (*Service) NotifyWebhookTestResults added in v1.3.0

func (s *Service) OrderCreateByPaylink(
	ctx context.Context,
	req *billingpb.OrderCreateByPaylink,
	rsp *billingpb.OrderCreateProcessResponse,
) error

func (*Service) OrderCreateProcess

func (*Service) OrderReceipt

func (*Service) PaymentCallbackProcess

func (s *Service) PaymentCallbackProcess(
	ctx context.Context,
	req *billingpb.PaymentNotifyRequest,
	rsp *billingpb.PaymentNotifyResponse,
) error

func (*Service) PaymentCreateProcess

func (s *Service) PaymentCreateProcess(
	ctx context.Context,
	req *billingpb.PaymentCreateRequest,
	rsp *billingpb.PaymentCreateResponse,
) error

func (*Service) PaymentFormJsonDataProcess

func (s *Service) PaymentFormJsonDataProcess(
	ctx context.Context,
	req *billingpb.PaymentFormJsonDataRequest,
	rsp *billingpb.PaymentFormJsonDataResponse,
) error

func (*Service) PayoutFinanceDone added in v1.3.0

func (*Service) ProcessOrderKeyProducts

func (s *Service) ProcessOrderKeyProducts(ctx context.Context, order *billingpb.Order) ([]*billingpb.Platform, error)

func (*Service) ProcessOrderProducts

func (s *Service) ProcessOrderProducts(ctx context.Context, order *billingpb.Order) error

func (*Service) ProcessOrderVirtualCurrency

func (s *Service) ProcessOrderVirtualCurrency(ctx context.Context, order *billingpb.Order) error

func (*Service) ProcessRefundCallback

func (s *Service) ProcessRefundCallback(
	ctx context.Context,
	req *billingpb.CallbackRequest,
	rsp *billingpb.PaymentNotifyResponse,
) error

func (*Service) ProcessVatReports

func (s *Service) ProcessVatReports(
	ctx context.Context,
	req *billingpb.ProcessVatReportsRequest,
	res *billingpb.EmptyResponse,
) error

func (*Service) PublishKeyProduct

func (*Service) RebuildAccountingEntries added in v1.8.0

func (s *Service) RebuildAccountingEntries(ctx context.Context, orderId string, force bool) error

func (*Service) RebuildOrderView

func (s *Service) RebuildOrderView(ctx context.Context) error

func (*Service) ResendInviteAdmin

func (*Service) ResendInviteMerchant

func (*Service) RoyaltyReportFinanceDone added in v1.3.0

func (s *Service) RoyaltyReportFinanceDone(
	ctx context.Context,
	req *billingpb.ReportFinanceDoneRequest,
	res *billingpb.EmptyResponseWithStatus,
) error

func (*Service) SendWebhookToMerchant added in v1.3.0

func (s *Service) SendWebhookToMerchant(
	ctx context.Context,
	req *billingpb.OrderCreateRequest,
	res *billingpb.SendWebhookToMerchantResponse,
) error

func (*Service) SetAllPaymentChannelCostMerchant added in v1.10.6

func (*Service) SetCustomerPaymentActivity added in v1.7.0

func (*Service) SetMerchantAcceptedStatus added in v1.8.0

func (*Service) SetMoneyBackCostMerchant

func (s *Service) SetMoneyBackCostMerchant(
	ctx context.Context,
	req *billingpb.MoneyBackCostMerchant,
	res *billingpb.MoneyBackCostMerchantResponse,
) error

func (*Service) SetMoneyBackCostSystem

func (s *Service) SetMoneyBackCostSystem(
	ctx context.Context,
	req *billingpb.MoneyBackCostSystem,
	res *billingpb.MoneyBackCostSystemResponse,
) error

func (*Service) SetPaymentMinLimitSystem

func (s *Service) SetPaymentMinLimitSystem(
	ctx context.Context,
	req *billingpb.PaymentMinLimitSystem,
	res *billingpb.EmptyResponseWithStatus,
) (err error)

func (*Service) SetUserNotifyNewRegion

func (s *Service) SetUserNotifyNewRegion(
	ctx context.Context,
	req *billingpb.SetUserNotifyRequest,
	_ *billingpb.EmptyResponse,
) error

func (*Service) SetUserNotifySales

func (s *Service) SetUserNotifySales(
	ctx context.Context,
	req *billingpb.SetUserNotifyRequest,
	_ *billingpb.EmptyResponse,
) error

func (*Service) TaskExtendPayoutsWithVat added in v1.10.6

func (s *Service) TaskExtendPayoutsWithVat(ctx context.Context) (err error)

func (*Service) TaskExtendRoyaltiesWithVat added in v1.10.10

func (s *Service) TaskExtendRoyaltiesWithVat(ctx context.Context) (err error)

func (*Service) TaskFixReportDates added in v1.8.0

func (s *Service) TaskFixReportDates(ctx context.Context) (err error)

func (*Service) UnPublishKeyProduct

func (s *Service) UnPublishKeyProduct(
	ctx context.Context,
	req *billingpb.UnPublishKeyProductRequest,
	res *billingpb.KeyProductResponse,
) error

func (*Service) UpdateCountry

func (s *Service) UpdateCountry(
	ctx context.Context,
	req *billingpb.Country,
	res *billingpb.Country,
) error

func (*Service) UpdateCustomersPayments added in v1.7.0

func (s *Service) UpdateCustomersPayments(ctx context.Context) error

func (*Service) UpdateFirstPayments added in v1.7.0

func (s *Service) UpdateFirstPayments(ctx context.Context) error

func (*Service) UpdateOrder

func (s *Service) UpdateOrder(ctx context.Context, req *billingpb.Order, _ *billingpb.EmptyResponse) error

func (*Service) UpdatePayoutDocument

func (*Service) UpdatePriceGroup

func (s *Service) UpdatePriceGroup(
	ctx context.Context,
	req *billingpb.PriceGroup,
	res *billingpb.PriceGroup,
) error

func (*Service) UpdateProductPrices

func (s *Service) UpdateProductPrices(ctx context.Context, req *billingpb.UpdateProductPricesRequest, res *billingpb.ResponseError) error

func (*Service) UpdateVatReportStatus

func (s *Service) UpdateVatReportStatus(
	ctx context.Context,
	req *billingpb.UpdateVatReportStatusRequest,
	res *billingpb.ResponseError,
) error

func (*Service) UploadKeysFile

type Token

type Token struct {
	CustomerId string                   `json:"customer_id"`
	User       *billingpb.TokenUser     `json:"user"`
	Settings   *billingpb.TokenSettings `json:"settings"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL