gateway

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const ETCD_DIR_ROOT = "/pub/pjoc/pay"

Variables

View Source
var SUCCESS_RESULT = &pb.ReturnResult{Code: pb.ReturnResultCode_CODE_SUCCESS, Message: "SUCCESS", Describe: "SUCCESS"}

Functions

func BuildParamsErrorResponse

func BuildParamsErrorResponse(err error) *pb.PayResponse

func BuildSystemErrorResponse

func BuildSystemErrorResponse(err error) *pb.PayResponse

func GetPlaceholderRegex

func GetPlaceholderRegex(placeHolderName string) (*regexp.Regexp, error)

func Init

func Init(svc *service.Service)

func ReplaceGatewayOrderId

func ReplaceGatewayOrderId(urlPattern string, gatewayOrderId string) string

func ReplacePlaceholder

func ReplacePlaceholder(urlPattern string, placeHolderName string, parameter string) (string, error)

Types

type PayGatewayService

type PayGatewayService struct {
	*service.GatewayConfig
	OrderGenerator *generator.OrderGenerator
	*service.Service
	*gc.GrpcClientFactory
}

func (*PayGatewayService) GenerateChannelPayRequest

func (svc *PayGatewayService) GenerateChannelPayRequest(ctx *RequestContext) (channelPayRequest *pay.ChannelPayRequest, err error)

func (*PayGatewayService) Pay

func (svc *PayGatewayService) Pay(ctx context.Context, request *pb.PayRequest) (response *pb.PayResponse, err error)

func (*PayGatewayService) RegisterGrpc

func (svc *PayGatewayService) RegisterGrpc(gs *grpc.Server)

func (*PayGatewayService) SavePayOrder

func (svc *PayGatewayService) SavePayOrder(requestContext *RequestContext) (*pb.ReturnResult, error)

func (*PayGatewayService) UpdatePayOrder

func (svc *PayGatewayService) UpdatePayOrder(requestContext *RequestContext) (result *pb.ReturnResult, err error)

type RequestContext

type RequestContext struct {
	GatewayOrderId     string
	ChannelAccount     string
	PayRequest         *pb.PayRequest
	PayOrder           *pb.PayOrder
	ChannelPayRequest  *pb.ChannelPayRequest
	ChannelPayResponse *pb.ChannelPayResponse
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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