service

package
v0.0.0-...-aa75ca6 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindOrCreateUserByTgCtx

func FindOrCreateUserByTgCtx(ctx tele.Context) (*model.User, error)

func FindUserByBotId

func FindUserByBotId(botId int64) (*model.User, error)

func FindUserByTgId

func FindUserByTgId(tgId int64) (*model.User, error)

Types

type CreateEpusdtPaymentRequest

type CreateEpusdtPaymentRequest struct {
	OrderId     string  `json:"order_id"`
	Amount      float64 `json:"amount"`
	RedirectUrl string  `json:"redirect_url"`
	NotifyUrl   string  `json:"notify_url"`
	Signature   string  `json:"signature"`
}

type CreateEpusdtPaymentResponse

type CreateEpusdtPaymentResponse struct {
	StatusCode int    `json:"status_code"`
	Message    string `json:"message"`
	RequestId  string `json:"request_id"`
	Data       struct {
		TradeId        string  `json:"trade_id"`
		OrderId        string  `json:"order_id"`
		Amount         float64 `json:"amount"`
		ActualAmount   float64 `json:"actual_amount"`
		Token          string  `json:"token"`
		ExpirationTime int64   `json:"expiration_time"`
		PaymentUrl     string  `json:"payment_url"`
	} `json:"data"`
}

func CreateEpusdtPayment

func CreateEpusdtPayment(orderNo string, usdtAmount float64, notifyUrl string) (result CreateEpusdtPaymentResponse, err error)

func CreatePayOrder

func CreatePayOrder(conf config.PayConf, order *model.Order) (result CreateEpusdtPaymentResponse, err error)

type CreateOrderResponse

type CreateOrderResponse struct {
	Token        string  `json:"token"`
	ActualAmount float64 `json:"actual_amount"`
}

func CreateOrder

func CreateOrder(order *model.Order) (result CreateOrderResponse, err error)

func CreateRechargeOrder

func CreateRechargeOrder(v *model.Recharge) (result CreateOrderResponse, err error)

type CreateRechargeOrderResponse

type CreateRechargeOrderResponse struct {
	Token        string  `json:"token"`
	ActualAmount float64 `json:"actual_amount"`
}

Jump to

Keyboard shortcuts

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