Documentation
¶
Index ¶
- Constants
- Variables
- func BuildParamsErrorResponse(err error) *pb.PayResponse
- func BuildSystemErrorResponse(err error) *pb.PayResponse
- func GetPlaceholderRegex(placeHolderName string) (*regexp.Regexp, error)
- func Init(svc *service.Service)
- func ReplaceGatewayOrderId(urlPattern string, gatewayOrderId string) string
- func ReplacePlaceholder(urlPattern string, placeHolderName string, parameter string) (string, error)
- type PayGatewayService
- func (svc *PayGatewayService) GenerateChannelPayRequest(ctx *RequestContext) (channelPayRequest *pay.ChannelPayRequest, err error)
- func (svc *PayGatewayService) Pay(ctx context.Context, request *pb.PayRequest) (response *pb.PayResponse, err error)
- func (svc *PayGatewayService) RegisterGrpc(gs *grpc.Server)
- func (svc *PayGatewayService) SavePayOrder(requestContext *RequestContext) (*pb.ReturnResult, error)
- func (svc *PayGatewayService) UpdatePayOrder(requestContext *RequestContext) (result *pb.ReturnResult, err error)
- type RequestContext
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 ReplaceGatewayOrderId ¶
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 }
Click to show internal directories.
Click to hide internal directories.