service

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: GPL-3.0 Imports: 77 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderContentType   = "Content-Type"
	HeaderAuthorization = "Authorization"
	HeaderContentLength = "Content-Length"

	MIMEApplicationForm = "application/x-www-form-urlencoded"
	MIMEApplicationJSON = "application/json"

	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,
) *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,
) *billingpb.Order

func HelperCreateAndPayPaylinkOrder added in v1.3.0

func HelperCreateAndPayPaylinkOrder(
	suite suite.Suite,
	service *Service,
	paylinkId, country 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,
)

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,
) *billingpb.Order

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 CardPayAddress

type CardPayAddress struct {
	Country string `json:"country"`
	City    string `json:"city,omitempty"`
	Phone   string `json:"phone,omitempty"`
	State   string `json:"state,omitempty"`
	Street  string `json:",omitempty"`
	Zip     string `json:"zip,omitempty"`
}

type CardPayBankCardAccount

type CardPayBankCardAccount struct {
	Pan        string `json:"pan"`
	HolderName string `json:"holder"`
	Cvv        string `json:"security_code"`
	Expire     string `json:"expiration"`
}

type CardPayCardAccount

type CardPayCardAccount struct {
	BillingAddress *CardPayAddress         `json:"billing_address,omitempty"`
	Card           *CardPayBankCardAccount `json:"card"`
	Token          string                  `json:"token,omitempty"`
}

type CardPayCryptoCurrencyAccount

type CardPayCryptoCurrencyAccount struct {
	RollbackAddress string `json:"rollback_address"`
}

type CardPayCustomer

type CardPayCustomer struct {
	Email   string `json:"email"`
	Ip      string `json:"ip"`
	Account string `json:"id"`
}

type CardPayEWalletAccount

type CardPayEWalletAccount struct {
	Id string `json:"id"`
}

type CardPayItem

type CardPayItem struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Count       int     `json:"count"`
	Price       float64 `json:"price"`
}

type CardPayMerchantOrder

type CardPayMerchantOrder struct {
	Id              string          `json:"id" validate:"required,hexadecimal"`
	Description     string          `json:"description,omitempty"`
	Items           []*CardPayItem  `json:"items,omitempty"`
	ShippingAddress *CardPayAddress `json:"shipping_address,omitempty"`
}

type CardPayOrder

type CardPayOrder struct {
	Request               *CardPayRequest               `json:"request"`
	MerchantOrder         *CardPayMerchantOrder         `json:"merchant_order"`
	Description           string                        `json:"description"`
	PaymentMethod         string                        `json:"payment_method"`
	PaymentData           *CardPayPaymentData           `json:"payment_data,omitempty"`
	RecurringData         *CardPayRecurringData         `json:"recurring_data,omitempty"`
	CardAccount           *CardPayCardAccount           `json:"card_account,omitempty"`
	Customer              *CardPayCustomer              `json:"customer"`
	EWalletAccount        *CardPayEWalletAccount        `json:"ewallet_account,omitempty"`
	CryptoCurrencyAccount *CardPayCryptoCurrencyAccount `json:"cryptocurrency_account,omitempty"`
	ReturnUrls            *CardPayReturnUrls            `json:"return_urls,omitempty"`
}

type CardPayOrderRecurringResponse

type CardPayOrderRecurringResponse struct {
	RecurringData *CardPayOrderRecurringResponseRecurringData `json:"recurring_data"`
}

func (*CardPayOrderRecurringResponse) IsSuccessStatus

func (h *CardPayOrderRecurringResponse) IsSuccessStatus() bool

type CardPayOrderRecurringResponseRecurringData

type CardPayOrderRecurringResponseRecurringData struct {
	Id       string                      `json:"id"`
	Filing   *CardPayRecurringDataFiling `json:"filing"`
	Status   string                      `json:"status"`
	Amount   float64                     `json:"amount"`
	Currency string                      `json:"currency"`
	Created  string                      `json:"created"`
	Note     string                      `json:"note"`
	Rrn      string                      `json:"rrn"`
	Is3D     bool                        `json:"is_3d"`
}

type CardPayOrderResponse

type CardPayOrderResponse struct {
	RedirectUrl string `json:"redirect_url"`
}

type CardPayPaymentData

type CardPayPaymentData struct {
	Currency   string  `json:"currency"`
	Amount     float64 `json:"amount"`
	Descriptor string  `json:"dynamic_descriptor"`
	Note       string  `json:"note"`
}

type CardPayRecurringData

type CardPayRecurringData struct {
	Currency   string                      `json:"currency"`
	Amount     float64                     `json:"amount"`
	Filing     *CardPayRecurringDataFiling `json:"filing,omitempty"`
	Descriptor string                      `json:"dynamic_descriptor"`
	Note       string                      `json:"note"`
	Initiator  string                      `json:"initiator"`
}

type CardPayRecurringDataFiling

type CardPayRecurringDataFiling struct {
	Id string `json:"id"`
}

type CardPayRefundData

type CardPayRefundData struct {
	Amount   float64 `json:"amount"`
	Currency string  `json:"currency"`
}

type CardPayRefundRequest

type CardPayRefundRequest struct {
	Request       *CardPayRequest             `json:"request"`
	MerchantOrder *CardPayMerchantOrder       `json:"merchant_order"`
	PaymentData   *CardPayRecurringDataFiling `json:"payment_data"`
	RefundData    *CardPayRefundData          `json:"refund_data"`
}

type CardPayRefundResponse

type CardPayRefundResponse struct {
	PaymentMethod  string                            `json:"payment_method"`
	MerchantOrder  *CardPayMerchantOrder             `json:"merchant_order"`
	RefundData     *CardPayRefundResponseRefundData  `json:"refund_data"`
	PaymentData    *CardPayRefundResponsePaymentData `json:"payment_data"`
	Customer       *CardPayRefundResponseCustomer    `json:"customer"`
	CardAccount    interface{}                       `json:"card_account,omitempty"`
	EwalletAccount interface{}                       `json:"ewallet_account,omitempty"`
}

func (*CardPayRefundResponse) IsSuccessStatus

func (m *CardPayRefundResponse) IsSuccessStatus() bool

type CardPayRefundResponseCustomer

type CardPayRefundResponseCustomer struct {
	Id    string `json:"id"`
	Email string `json:"email"`
}

type CardPayRefundResponsePaymentData

type CardPayRefundResponsePaymentData struct {
	Id              string  `json:"id"`
	RemainingAmount float64 `json:"remaining_amount"`
}

type CardPayRefundResponseRefundData

type CardPayRefundResponseRefundData struct {
	Id       string  `json:"id"`
	Created  string  `json:"created"`
	Status   string  `json:"status"`
	AuthCode string  `json:"auth_code"`
	Is3d     bool    `json:"is_3d"`
	Amount   float64 `json:"amount"`
	Currency string  `json:"currency"`
}

type CardPayRequest

type CardPayRequest struct {
	Id   string `json:"id"`
	Time string `json:"time"`
}

type CardPayReturnUrls

type CardPayReturnUrls struct {
	CancelUrl  string `json:"cancel_url,omitempty"`
	DeclineUrl string `json:"decline_url,omitempty"`
	SuccessUrl string `json:"success_url,omitempty"`
}

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 Gate added in v1.2.0

type Gate interface {
	CreatePayment(order *billingpb.Order, successUrl, failUrl string, requisites map[string]string) (string, error)
	ProcessPayment(order *billingpb.Order, message proto.Message, raw, signature string) error
	IsRecurringCallback(request proto.Message) bool
	GetRecurringId(request proto.Message) string
	CreateRefund(order *billingpb.Order, refund *billingpb.Refund) error
	ProcessRefund(order *billingpb.Order, refund *billingpb.Refund, message proto.Message, raw, signature string) error
}

func NewCardPayMock

func NewCardPayMock() Gate

func NewPaymentSystemMockError

func NewPaymentSystemMockError() Gate

func NewPaymentSystemMockOk

func NewPaymentSystemMockOk() Gate

type Gateway added in v1.2.0

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

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) CreatePayment

func (m *PaymentSystemMockError) CreatePayment(order *billingpb.Order, successUrl, failUrl string, requisites map[string]string) (string, error)

func (*PaymentSystemMockError) CreateRefund

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

func (*PaymentSystemMockError) GetRecurringId

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

func (*PaymentSystemMockError) IsRecurringCallback

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

func (*PaymentSystemMockError) ProcessPayment

func (m *PaymentSystemMockError) ProcessPayment(order *billingpb.Order, message proto.Message, raw, signature string) error

func (*PaymentSystemMockError) ProcessRefund

func (m *PaymentSystemMockError) ProcessRefund(order *billingpb.Order, refund *billingpb.Refund, message proto.Message, raw, signature string) error

type PaymentSystemMockOk

type PaymentSystemMockOk struct{}

func (*PaymentSystemMockOk) CreatePayment

func (m *PaymentSystemMockOk) CreatePayment(order *billingpb.Order, successUrl, failUrl string, requisites map[string]string) (string, error)

func (*PaymentSystemMockOk) CreateRefund

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

func (*PaymentSystemMockOk) GetRecurringId

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

func (*PaymentSystemMockOk) IsRecurringCallback

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

func (*PaymentSystemMockOk) ProcessPayment

func (m *PaymentSystemMockOk) ProcessPayment(order *billingpb.Order, message proto.Message, raw, signature string) error

func (*PaymentSystemMockOk) ProcessRefund

func (m *PaymentSystemMockOk) ProcessRefund(order *billingpb.Order, refund *billingpb.Refund, message proto.Message, raw, signature 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) 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) 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) DeleteSavedCard

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) 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) 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) 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) 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) 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) 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) 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) 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) SetCustomerPaymentActivity added in v1.7.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) TaskRebuildPayoutsRoyalties added in v1.3.0

func (s *Service) TaskRebuildPayoutsRoyalties() 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