service

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 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 NewVatReportProcessor

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

func RandomString

func RandomString(n int) string

Types

type Accounting

type Accounting Entity

func (*Accounting) GetCorrectionsForRoyaltyReport

func (a *Accounting) GetCorrectionsForRoyaltyReport(
	ctx context.Context,
	merchantId, currency string,
	from, to time.Time,
) (items []*billingpb.AccountingEntry, err error)

func (Accounting) GetRollingReservesForRoyaltyReport

func (a Accounting) GetRollingReservesForRoyaltyReport(
	ctx context.Context,
	merchantId, currency string,
	from, to time.Time,
) (items []*billingpb.AccountingEntry, err error)

type AccountingServiceInterface

type AccountingServiceInterface interface {
	GetCorrectionsForRoyaltyReport(ctx context.Context, merchantId, currency string, from, to time.Time) (items []*billingpb.AccountingEntry, err error)
	GetRollingReservesForRoyaltyReport(ctx context.Context, merchantId, currency string, from, to time.Time) (items []*billingpb.AccountingEntry, err error)
}

type BinData

type BinData struct {
	Id                 primitive.ObjectID `bson:"_id"`
	CardBin            int32              `bson:"card_bin"`
	CardBrand          string             `bson:"card_brand"`
	CardType           string             `bson:"card_type"`
	CardCategory       string             `bson:"card_category"`
	BankName           string             `bson:"bank_name"`
	BankCountryName    string             `bson:"bank_country_name"`
	BankCountryIsoCode string             `bson:"bank_country_code_a2"`
	BankSite           string             `bson:"bank_site"`
	BankPhone          string             `bson:"bank_phone"`
}

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 Commission

type Commission Entity

type Currency

type Currency Entity

type DashboardReportProcessor

type DashboardReportProcessor struct {
	Db          mongodb.SourceInterface
	Collection  string
	Match       bson.M
	GroupBy     string
	DbQueryFn   func(ctx context.Context, receiver interface{}) (interface{}, error)
	Cache       database.CacheInterface
	CacheKey    string
	CacheExpire time.Duration
	Errors      map[string]*billingpb.ResponseErrorMessage
}

func (*DashboardReportProcessor) ExecuteGrossRevenueAndVatReports

func (m *DashboardReportProcessor) ExecuteGrossRevenueAndVatReports(ctx context.Context, receiver interface{}) (interface{}, error)

func (*DashboardReportProcessor) ExecuteReport

func (m *DashboardReportProcessor) ExecuteReport(ctx context.Context, receiver interface{}) (interface{}, error)

func (*DashboardReportProcessor) ExecuteRevenueByCountryReport

func (m *DashboardReportProcessor) ExecuteRevenueByCountryReport(ctx context.Context, receiver interface{}) (interface{}, error)

func (*DashboardReportProcessor) ExecuteRevenueDynamicReport

func (m *DashboardReportProcessor) ExecuteRevenueDynamicReport(ctx context.Context, receiver interface{}) (interface{}, error)

func (*DashboardReportProcessor) ExecuteSalesTodayReport

func (m *DashboardReportProcessor) ExecuteSalesTodayReport(ctx context.Context, receiver interface{}) (interface{}, error)

func (*DashboardReportProcessor) ExecuteSourcesReport

func (m *DashboardReportProcessor) ExecuteSourcesReport(ctx context.Context, receiver interface{}) (interface{}, error)

func (*DashboardReportProcessor) ExecuteTotalTransactionsAndArpuReports

func (m *DashboardReportProcessor) ExecuteTotalTransactionsAndArpuReports(ctx context.Context, receiver interface{}) (interface{}, error)

type DashboardReportProcessorInterface

type DashboardReportProcessorInterface interface {
	ExecuteReport(interface{}) (interface{}, error)
	ExecuteGrossRevenueAndVatReports(interface{}) (interface{}, error)
	ExecuteTotalTransactionsAndArpuReports(interface{}) (interface{}, error)
	ExecuteRevenueDynamicReport(interface{}) (interface{}, error)
	ExecuteRevenueByCountryReport(interface{}) (interface{}, error)
	ExecuteSalesTodayReport(interface{}) (interface{}, error)
	ExecuteSourcesReport(interface{}) (interface{}, error)
}

type DashboardRepository

type DashboardRepository Repository

func (*DashboardRepository) GetBaseReport

func (m *DashboardRepository) GetBaseReport(
	ctx context.Context,
	merchantId, period string,
) (*billingpb.DashboardBaseReports, error)

func (*DashboardRepository) GetBaseRevenueByCountryReport

func (m *DashboardRepository) GetBaseRevenueByCountryReport(
	ctx context.Context,
	merchantId, period string,
) (*billingpb.DashboardRevenueByCountryReport, error)

func (*DashboardRepository) GetBaseSalesTodayReport

func (m *DashboardRepository) GetBaseSalesTodayReport(
	ctx context.Context,
	merchantId, period string,
) (*billingpb.DashboardSalesTodayReport, error)

func (*DashboardRepository) GetBaseSourcesReport

func (m *DashboardRepository) GetBaseSourcesReport(
	ctx context.Context,
	merchantId, period string,
) (*billingpb.DashboardSourcesReport, error)

func (*DashboardRepository) GetMainReport

func (m *DashboardRepository) GetMainReport(
	ctx context.Context,
	merchantId, period string,
) (*billingpb.DashboardMainReport, error)

func (*DashboardRepository) GetRevenueDynamicsReport

func (m *DashboardRepository) GetRevenueDynamicsReport(
	ctx context.Context,
	merchantId, period string,
) (*billingpb.DashboardRevenueDynamicReport, error)

func (*DashboardRepository) NewDashboardReportProcessor

func (m *DashboardRepository) NewDashboardReportProcessor(
	merchantId, period, cacheKeyMask string,
	status interface{},
	db mongodb.SourceInterface,
	cache database.CacheInterface,
	ctx context.Context,
) (*DashboardReportProcessor, error)

type EmailConfirmToken

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

type Entity

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

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 GrossRevenueAndVatReports

type GrossRevenueAndVatReports struct {
	GrossRevenue *billingpb.DashboardAmountItemWithChart `bson:"gross_revenue"`
	Vat          *billingpb.DashboardAmountItemWithChart `bson:"vat"`
}

type Key

type Key Entity

func (*Key) CancelById

func (h *Key) CancelById(ctx context.Context, id string) (*billingpb.Key, error)

func (*Key) CountKeysByProductPlatform

func (h *Key) CountKeysByProductPlatform(ctx context.Context, keyProductId string, platformId string) (int64, error)

func (*Key) FindUnfinished

func (h *Key) FindUnfinished(ctx context.Context) ([]*billingpb.Key, error)

func (*Key) FinishRedeemById

func (h *Key) FinishRedeemById(ctx context.Context, id string) (*billingpb.Key, error)

func (*Key) GetById

func (h *Key) GetById(ctx context.Context, id string) (*billingpb.Key, error)

func (*Key) Insert

func (h *Key) Insert(ctx context.Context, key *billingpb.Key) error

func (*Key) ReserveKey

func (h *Key) ReserveKey(
	ctx context.Context,
	keyProductId string,
	platformId string,
	orderId string,
	ttl int32,
) (*billingpb.Key, error)

type KeyProductRepository

type KeyProductRepository Repository

func (*KeyProductRepository) GetById

func (*KeyProductRepository) Update

func (h *KeyProductRepository) Update(ctx context.Context, keyProduct *billingpb.KeyProduct) error

type KeyProductRepositoryInterface

type KeyProductRepositoryInterface interface {
	GetById(context.Context, string) (*billingpb.KeyProduct, error)
	Update(context.Context, *billingpb.KeyProduct) error
}

type KeyRepositoryInterface

type KeyRepositoryInterface interface {
	Insert(context.Context, *billingpb.Key) error
	GetById(context.Context, string) (*billingpb.Key, error)
	ReserveKey(context.Context, string, string, string, int32) (*billingpb.Key, error)
	CancelById(context.Context, string) (*billingpb.Key, error)
	FinishRedeemById(context.Context, string) (*billingpb.Key, error)
	CountKeysByProductPlatform(context.Context, string, string) (int64, error)
	FindUnfinished(context.Context) ([]*billingpb.Key, error)
}

type MerchantsTariffRatesRepository

type MerchantsTariffRatesRepository Repository

func (*MerchantsTariffRatesRepository) GetCacheKeyForGetBy

func (*MerchantsTariffRatesRepository) GetPaymentTariffsBy

func (*MerchantsTariffRatesRepository) GetTariffsSettings

type OrderCreateRequestProcessor

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

func (*OrderCreateRequestProcessor) UserCountryExists

func (v *OrderCreateRequestProcessor) UserCountryExists() bool

type OrderView

type OrderView Entity

func (*OrderView) CountTransactions

func (ow *OrderView) CountTransactions(ctx context.Context, match bson.M) (n int64, err error)

func (*OrderView) GetOrderBy

func (ow *OrderView) GetOrderBy(
	ctx context.Context,
	id, uuid, merchantId string,
	receiver interface{},
) (interface{}, error)

func (*OrderView) GetPaylinkStat

func (ow *OrderView) GetPaylinkStat(
	ctx context.Context,
	paylinkId, merchantId string,
	from, to int64,
) (*billingpb.StatCommon, error)

func (*OrderView) GetPaylinkStatByCountry

func (ow *OrderView) GetPaylinkStatByCountry(
	ctx context.Context,
	paylinkId, merchantId string,
	from, to int64,
) (result *billingpb.GroupStatCommon, err error)

func (*OrderView) GetPaylinkStatByDate

func (ow *OrderView) GetPaylinkStatByDate(
	ctx context.Context,
	paylinkId, merchantId string,
	from, to int64,
) (result *billingpb.GroupStatCommon, err error)

func (*OrderView) GetPaylinkStatByReferrer

func (ow *OrderView) GetPaylinkStatByReferrer(
	ctx context.Context,
	paylinkId, merchantId string,
	from, to int64,
) (result *billingpb.GroupStatCommon, err error)

func (*OrderView) GetPaylinkStatByUtm

func (ow *OrderView) GetPaylinkStatByUtm(
	ctx context.Context,
	paylinkId, merchantId string,
	from, to int64,
) (result *billingpb.GroupStatCommon, err error)

func (*OrderView) GetPaylinkStatMatchQuery

func (ow *OrderView) GetPaylinkStatMatchQuery(paylinkId, merchantId string, from, to int64) []bson.M

func (*OrderView) GetPublicByOrderId added in v1.2.0

func (ow *OrderView) GetPublicByOrderId(ctx context.Context, orderId string) (*billingpb.OrderViewPublic, error)

func (*OrderView) GetRoyaltySummary

func (ow *OrderView) GetRoyaltySummary(
	ctx context.Context,
	merchantId, currency string,
	from, to time.Time,
) (items []*billingpb.RoyaltyReportProductSummaryItem, total *billingpb.RoyaltyReportProductSummaryItem, err error)

func (*OrderView) GetTransactionsPrivate

func (ow *OrderView) GetTransactionsPrivate(
	ctx context.Context,
	match bson.M,
	limit, offset int64,
) ([]*billingpb.OrderViewPrivate, error)

func (*OrderView) GetTransactionsPublic

func (ow *OrderView) GetTransactionsPublic(
	ctx context.Context,
	match bson.M,
	limit, offset int64,
) ([]*billingpb.OrderViewPublic, error)

type OrderViewServiceInterface

type OrderViewServiceInterface interface {
	CountTransactions(ctx context.Context, match bson.M) (n int64, err error)
	GetTransactionsPublic(ctx context.Context, match bson.M, limit, offset int64) (result []*billingpb.OrderViewPublic, err error)
	GetTransactionsPrivate(ctx context.Context, match bson.M, limit, offset int64) (result []*billingpb.OrderViewPrivate, err error)
	GetRoyaltySummary(ctx context.Context, merchantId, currency string, from, to time.Time) (items []*billingpb.RoyaltyReportProductSummaryItem, total *billingpb.RoyaltyReportProductSummaryItem, err error)
	GetOrderBy(ctx context.Context, id, uuid, merchantId string, receiver interface{}) (interface{}, error)
	GetPaylinkStat(ctx context.Context, paylinkId, merchantId string, from, to int64) (*billingpb.StatCommon, error)
	GetPaylinkStatByCountry(ctx context.Context, paylinkId, merchantId string, from, to int64) (result *billingpb.GroupStatCommon, err error)
	GetPaylinkStatByReferrer(ctx context.Context, paylinkId, merchantId string, from, to int64) (result *billingpb.GroupStatCommon, err error)
	GetPaylinkStatByDate(ctx context.Context, paylinkId, merchantId string, from, to int64) (result *billingpb.GroupStatCommon, err error)
	GetPaylinkStatByUtm(ctx context.Context, paylinkId, merchantId string, from, to int64) (result *billingpb.GroupStatCommon, err error)
	GetPublicByOrderId(ctx context.Context, merchantId string) (*billingpb.OrderViewPublic, error)
}
type Paylink Entity

func (Paylink) CountByQuery

func (p Paylink) CountByQuery(ctx context.Context, query bson.M) (n int64, err error)

func (Paylink) Delete

func (p Paylink) Delete(ctx context.Context, id, merchantId string) error

func (Paylink) GetById

func (p Paylink) GetById(ctx context.Context, id string) (pl *billingpb.Paylink, err error)

func (Paylink) GetByIdAndMerchant

func (p Paylink) GetByIdAndMerchant(ctx context.Context, id, merchantId string) (pl *billingpb.Paylink, err error)

func (Paylink) GetListByQuery

func (p Paylink) GetListByQuery(ctx context.Context, query bson.M, limit, offset int64) (result []*billingpb.Paylink, err error)

func (Paylink) GetPaylinkVisits

func (p Paylink) GetPaylinkVisits(ctx context.Context, id string, from, to int64) (n int64, err error)

func (*Paylink) GetUrl

func (p *Paylink) GetUrl(ctx context.Context, id, merchantId, urlMask, utmSource, utmMedium, utmCampaign string) (string, error)

func (Paylink) IncrVisits

func (p Paylink) IncrVisits(ctx context.Context, id string) (err error)

func (Paylink) Insert

func (p Paylink) Insert(ctx context.Context, pl *billingpb.Paylink) (err error)

func (Paylink) Update

func (p Paylink) Update(ctx context.Context, pl *billingpb.Paylink) (err error)

func (Paylink) UpdatePaylinkTotalStat

func (p Paylink) UpdatePaylinkTotalStat(ctx context.Context, id, merchantId string) (err error)

type PaylinkServiceInterface

type PaylinkServiceInterface interface {
	CountByQuery(ctx context.Context, query bson.M) (n int64, err error)
	GetListByQuery(ctx context.Context, query bson.M, limit, offset int64) (result []*billingpb.Paylink, err error)
	GetById(ctx context.Context, id string) (pl *billingpb.Paylink, err error)
	GetByIdAndMerchant(ctx context.Context, id, merchantId string) (pl *billingpb.Paylink, err error)
	IncrVisits(ctx context.Context, id string) error
	GetUrl(ctx context.Context, id, merchantId, urlMask, utmSource, utmMedium, utmCampaign string) (string, error)
	Delete(ctx context.Context, id, merchantId string) error
	Insert(ctx context.Context, pl *billingpb.Paylink) error
	Update(ctx context.Context, pl *billingpb.Paylink) error
	UpdatePaylinkTotalStat(ctx context.Context, id, merchantId string) error
	GetPaylinkVisits(ctx context.Context, id string, from, to int64) (int64, error)
}

type PaymentChannelCostMerchant

type PaymentChannelCostMerchant Entity

func (PaymentChannelCostMerchant) Delete

func (PaymentChannelCostMerchant) Get

func (h PaymentChannelCostMerchant) Get(
	ctx context.Context,
	merchantId string,
	name string,
	payoutCurrency string,
	region string,
	country string,
	mccCode string,
) (c []*internalPkg.PaymentChannelCostMerchantSet, err error)

func (PaymentChannelCostMerchant) GetAllForMerchant

func (PaymentChannelCostMerchant) GetById

func (*PaymentChannelCostMerchant) Insert

func (PaymentChannelCostMerchant) MultipleInsert

func (PaymentChannelCostMerchant) Update

type PaymentChannelCostMerchantInterface

type PaymentChannelCostMerchantInterface interface {
	MultipleInsert(ctx context.Context, obj []*billingpb.PaymentChannelCostMerchant) error
	Update(ctx context.Context, obj *billingpb.PaymentChannelCostMerchant) error
	GetById(ctx context.Context, id string) (*billingpb.PaymentChannelCostMerchant, error)
	Get(ctx context.Context, merchantId, name, payoutCurrency, region, country, mccCode string) ([]*internalPkg.PaymentChannelCostMerchantSet, error)
	Delete(ctx context.Context, obj *billingpb.PaymentChannelCostMerchant) error
	GetAllForMerchant(ctx context.Context, merchantId string) (*billingpb.PaymentChannelCostMerchantList, error)
}

type PaymentChannelCostSystem

type PaymentChannelCostSystem Entity

func (PaymentChannelCostSystem) Delete

func (PaymentChannelCostSystem) Get

func (h PaymentChannelCostSystem) Get(
	ctx context.Context,
	name, region, country, mccCode, operatingCompanyId string,
) (*billingpb.PaymentChannelCostSystem, error)

func (PaymentChannelCostSystem) GetAll

func (PaymentChannelCostSystem) GetById

func (*PaymentChannelCostSystem) Insert

func (PaymentChannelCostSystem) MultipleInsert

func (PaymentChannelCostSystem) Update

type PaymentChannelCostSystemInterface

type PaymentChannelCostSystemInterface interface {
	MultipleInsert(ctx context.Context, obj []*billingpb.PaymentChannelCostSystem) error
	Update(ctx context.Context, obj *billingpb.PaymentChannelCostSystem) error
	GetById(ctx context.Context, id string) (*billingpb.PaymentChannelCostSystem, error)
	Get(ctx context.Context, name, region, country, mccCode, operatingCompanyId string) (*billingpb.PaymentChannelCostSystem, error)
	Delete(ctx context.Context, obj *billingpb.PaymentChannelCostSystem) error
	GetAll(ctx context.Context) (*billingpb.PaymentChannelCostSystemList, error)
}

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 PaymentMethod

type PaymentMethod Entity

func (*PaymentMethod) GetAll

func (*PaymentMethod) GetByGroupAndCurrency

func (h *PaymentMethod) GetByGroupAndCurrency(
	ctx context.Context,
	isProduction bool,
	group string,
	currency string,
) (*billingpb.PaymentMethod, error)

func (*PaymentMethod) GetById

func (*PaymentMethod) GetPaymentSettings

func (h *PaymentMethod) GetPaymentSettings(
	paymentMethod *billingpb.PaymentMethod,
	currency string,
	mccCode string,
	operatingCompanyId string,
	paymentMethodBrand string,
	isProduction bool,
) (*billingpb.PaymentMethodParams, error)

func (*PaymentMethod) Insert

func (*PaymentMethod) ListByOrder added in v1.2.0

func (h *PaymentMethod) ListByOrder(
	ctx context.Context,
	order *billingpb.Order,
) ([]*billingpb.PaymentMethod, error)

func (*PaymentMethod) MultipleInsert

func (h *PaymentMethod) MultipleInsert(ctx context.Context, pm []*billingpb.PaymentMethod) error

func (*PaymentMethod) Update

type PaymentMethodInterface

type PaymentMethodInterface interface {
	GetAll(ctx context.Context) (map[string]*billingpb.PaymentMethod, error)
	GetByGroupAndCurrency(ctx context.Context, isProduction bool, group string, currency string) (*billingpb.PaymentMethod, error)
	GetById(context.Context, string) (*billingpb.PaymentMethod, error)
	MultipleInsert(context.Context, []*billingpb.PaymentMethod) error
	Insert(context.Context, *billingpb.PaymentMethod) error
	Update(context.Context, *billingpb.PaymentMethod) error
	GetPaymentSettings(paymentMethod *billingpb.PaymentMethod, currency, mccCode, operatingCompanyId, paymentMethodBrand string, isProduction bool) (*billingpb.PaymentMethodParams, error)
	ListByOrder(ctx context.Context, order *billingpb.Order) ([]*billingpb.PaymentMethod, error)
}

type PaymentMethods

type PaymentMethods struct {
	PaymentMethods []*billingpb.PaymentMethod `json:"payment_methods"`
}

type PaymentMinLimitSystem

type PaymentMinLimitSystem Entity

func (PaymentMinLimitSystem) GetAll

func (PaymentMinLimitSystem) GetByCurrency

func (p PaymentMinLimitSystem) GetByCurrency(
	ctx context.Context,
	currency string,
) (pmls *billingpb.PaymentMinLimitSystem, err error)

func (PaymentMinLimitSystem) MultipleInsert

func (p PaymentMinLimitSystem) MultipleInsert(
	ctx context.Context,
	pmlsArray []*billingpb.PaymentMinLimitSystem,
) (err error)

func (PaymentMinLimitSystem) Upsert

type PaymentMinLimitSystemInterface

type PaymentMinLimitSystemInterface interface {
	GetByCurrency(ctx context.Context, currency string) (pmls *billingpb.PaymentMinLimitSystem, err error)
	GetAll(ctx context.Context) (result []*billingpb.PaymentMinLimitSystem, err error)
	Upsert(ctx context.Context, pmls *billingpb.PaymentMinLimitSystem) (err error)
	MultipleInsert(ctx context.Context, pmlsArray []*billingpb.PaymentMinLimitSystem) (err error)
}

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 PaymentSystemService

type PaymentSystemService Entity

func (PaymentSystemService) GetById

func (*PaymentSystemService) Insert

func (PaymentSystemService) MultipleInsert

func (h PaymentSystemService) MultipleInsert(ctx context.Context, ps []*billingpb.PaymentSystem) error

func (*PaymentSystemService) Update

type PayoutDocument

type PayoutDocument Entity

func (*PayoutDocument) CountByQuery

func (h *PayoutDocument) CountByQuery(ctx context.Context, query bson.M) (count int64, err error)

func (*PayoutDocument) FindByQuery

func (h *PayoutDocument) FindByQuery(
	ctx context.Context,
	query bson.M,
	sorts []string,
	limit, offset int64,
) ([]*billingpb.PayoutDocument, error)

func (*PayoutDocument) GetBalanceAmount

func (h *PayoutDocument) GetBalanceAmount(ctx context.Context, merchantId, currency string) (float64, error)

func (*PayoutDocument) GetById

func (h *PayoutDocument) GetById(ctx context.Context, id string) (pd *billingpb.PayoutDocument, err error)

func (*PayoutDocument) GetByIdAndMerchant

func (h *PayoutDocument) GetByIdAndMerchant(
	ctx context.Context,
	id, merchantId string,
) (pd *billingpb.PayoutDocument, err error)

func (*PayoutDocument) GetLast

func (h *PayoutDocument) GetLast(
	ctx context.Context,
	merchantId, currency string,
) (pd *billingpb.PayoutDocument, err error)

func (*PayoutDocument) Insert

func (h *PayoutDocument) Insert(ctx context.Context, pd *billingpb.PayoutDocument, ip, source string) (err error)

func (*PayoutDocument) Update

func (h *PayoutDocument) Update(ctx context.Context, pd *billingpb.PayoutDocument, ip, source string) error

type PayoutDocumentServiceInterface

type PayoutDocumentServiceInterface interface {
	Insert(ctx context.Context, document *billingpb.PayoutDocument, ip, source string) error
	Update(ctx context.Context, document *billingpb.PayoutDocument, ip, source string) error
	GetById(ctx context.Context, id string) (*billingpb.PayoutDocument, error)
	GetByIdAndMerchant(ctx context.Context, id, merchantId string) (*billingpb.PayoutDocument, error)
	CountByQuery(ctx context.Context, query bson.M) (int64, error)
	FindByQuery(ctx context.Context, query bson.M, sorts []string, limit, offset int64) ([]*billingpb.PayoutDocument, error)
	GetBalanceAmount(ctx context.Context, merchantId, currency string) (float64, error)
	GetLast(ctx context.Context, merchantId, currency string) (*billingpb.PayoutDocument, error)
}

type Product

type Product Entity

func (*Product) CountByProjectSku

func (h *Product) CountByProjectSku(ctx context.Context, projectId string, sku string) (int64, error)

func (*Product) GetById

func (h *Product) GetById(ctx context.Context, id string) (*billingpb.Product, error)

func (*Product) List

func (h *Product) List(
	ctx context.Context,
	merchantId string,
	projectId string,
	sku string,
	name string,
	offset int64,
	limit int64,
	enabled int32,
) (int64, []*billingpb.Product)

func (*Product) Upsert

func (h *Product) Upsert(ctx context.Context, p *billingpb.Product) error

type ProductServiceInterface

type ProductServiceInterface interface {
	Upsert(ctx context.Context, product *billingpb.Product) error
	GetById(context.Context, string) (*billingpb.Product, error)
	CountByProjectSku(context.Context, string, string) (int64, error)
	List(context.Context, string, string, string, string, int64, int64, int32) (int64, []*billingpb.Product)
}

type Repository

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

type RoyaltyReport

type RoyaltyReport Entity

func (*RoyaltyReport) GetBalanceAmount

func (r *RoyaltyReport) GetBalanceAmount(ctx context.Context, merchantId, currency string) (float64, error)

func (*RoyaltyReport) GetById

func (r *RoyaltyReport) GetById(ctx context.Context, id string) (rr *billingpb.RoyaltyReport, err error)

func (*RoyaltyReport) GetByPayoutId

func (r *RoyaltyReport) GetByPayoutId(ctx context.Context, payoutId string) (result []*billingpb.RoyaltyReport, err error)

func (*RoyaltyReport) GetNonPayoutReports

func (r *RoyaltyReport) GetNonPayoutReports(
	ctx context.Context,
	merchantId, currency string,
) (result []*billingpb.RoyaltyReport, err error)

func (*RoyaltyReport) GetReportExists

func (r *RoyaltyReport) GetReportExists(
	ctx context.Context,
	merchantId, currency string,
	from, to time.Time,
) (report *billingpb.RoyaltyReport)

func (*RoyaltyReport) Insert

func (r *RoyaltyReport) Insert(ctx context.Context, rr *billingpb.RoyaltyReport, ip, source string) (err error)

func (*RoyaltyReport) SetPaid

func (r *RoyaltyReport) SetPaid(ctx context.Context, reportIds []string, payoutDocumentId, ip, source string) (err error)

func (*RoyaltyReport) SetPayoutDocumentId

func (r *RoyaltyReport) SetPayoutDocumentId(ctx context.Context, reportIds []string, payoutDocumentId, ip, source string) error

func (*RoyaltyReport) UnsetPaid

func (r *RoyaltyReport) UnsetPaid(ctx context.Context, reportIds []string, ip, source string) (err error)

func (*RoyaltyReport) UnsetPayoutDocumentId

func (r *RoyaltyReport) UnsetPayoutDocumentId(ctx context.Context, reportIds []string, ip, source string) (err error)

func (*RoyaltyReport) Update

func (r *RoyaltyReport) Update(ctx context.Context, rr *billingpb.RoyaltyReport, ip, source string) error

type RoyaltyReportMerchant

type RoyaltyReportMerchant struct {
	Id primitive.ObjectID `bson:"_id"`
}

type RoyaltyReportServiceInterface

type RoyaltyReportServiceInterface interface {
	Insert(ctx context.Context, document *billingpb.RoyaltyReport, ip, source string) error
	Update(ctx context.Context, document *billingpb.RoyaltyReport, ip, source string) error
	GetById(ctx context.Context, id string) (*billingpb.RoyaltyReport, error)
	GetNonPayoutReports(ctx context.Context, merchantId, currency string) ([]*billingpb.RoyaltyReport, error)
	GetByPayoutId(ctx context.Context, payoutId string) ([]*billingpb.RoyaltyReport, error)
	GetBalanceAmount(ctx context.Context, merchantId, currency string) (float64, error)
	GetReportExists(ctx context.Context, merchantId, currency string, from, to time.Time) (report *billingpb.RoyaltyReport)
	SetPayoutDocumentId(ctx context.Context, reportIds []string, payoutDocumentId, ip, source string) (err error)
	UnsetPayoutDocumentId(ctx context.Context, reportIds []string, ip, source string) (err error)
	SetPaid(ctx context.Context, reportIds []string, payoutDocumentId, ip, source string) (err error)
	UnsetPaid(ctx context.Context, reportIds []string, ip, source string) (err error)
}

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,
) *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,
	req *billingpb.EmptyRequest,
	rsp *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) CheckInviteToken

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) 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,
	res *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 (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) 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) 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) 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) 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 TariffRates

type TariffRates struct {
	Items []*billingpb.MerchantTariffRatesPayment `json:"items"`
}

type Token

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

type TotalTransactionsAndArpuReports

type TotalTransactionsAndArpuReports struct {
	TotalTransactions *billingpb.DashboardMainReportTotalTransactions `bson:"total_transactions"`
	Arpu              *billingpb.DashboardAmountItemWithChart         `bson:"arpu"`
}

Jump to

Keyboard shortcuts

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