server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFailResponse

func WriteFailResponse(w http.ResponseWriter, statusCode int, error interface{})

WriteFailResponse creates error response for the http handler

func WriteFailResponseFromError

func WriteFailResponseFromError(w http.ResponseWriter, err error)

WriteFailResponseFromError creates error response based on the given error

func WriteSuccessResponse

func WriteSuccessResponse(w http.ResponseWriter, statusCode int, data interface{}, headMap map[string]string)

WriteSuccessResponse creates success response for the http handler

Types

type Empty

type Empty struct{}

Empty used to return nothing

type Error

type Error struct {
	StatusCode int    `json:"error_code"`
	Message    string `json:"error_message"`
}

Error is struct used to return error message to the client

type Meta

type Meta struct {
	TotalItems  int    `json:"total_items"`
	TotalPages  int    `json:"total_pages"`
	CurrentPage int    `json:"cur_page"`
	Cursor      string `json:"last_cursor"`
}

type Server

type Server struct {
	Manager manage.Payment
}

Server payment server struct

func NewServer

func NewServer(m manage.Payment) *Server

func (Server) CreateInvoiceHandler

func (s Server) CreateInvoiceHandler() http.HandlerFunc

CreateInvoiceHandler handles request for creating the invoice

func (Server) GetInvoiceRequestHandler

func (s Server) GetInvoiceRequestHandler() http.HandlerFunc

GetInvoiceRequestHandler returns handler func that will return invoice with given invoice number

func (Server) GetPaymentMethodsHandler

func (s Server) GetPaymentMethodsHandler() http.HandlerFunc

GetPaymentMethodsHandler return handler func that will retrieve all payment methods available

func (*Server) MidtransTransactionCallbackHandler

func (s *Server) MidtransTransactionCallbackHandler() http.HandlerFunc

MidtransTransactionCallbackHandler handles incoming notification about payment status from midtrans.

func (*Server) XenditDanaCallbackHandler

func (s *Server) XenditDanaCallbackHandler() http.HandlerFunc

XenditDanaCallbackHandler handles incoming xendit notification about dana

func (*Server) XenditInvoiceCallbackHandler

func (s *Server) XenditInvoiceCallbackHandler() http.HandlerFunc

XenditInvoiceCallbackHandler handles incoming xendit notification about xenInvoice

func (*Server) XenditLinkAjaCallbackHandler

func (s *Server) XenditLinkAjaCallbackHandler() http.HandlerFunc

XenditLinkAjaCallbackHandler handles incoming xendit notification about link aja

func (*Server) XenditOVOCallbackHandler

func (s *Server) XenditOVOCallbackHandler() http.HandlerFunc

XenditOVOCallbackHandler handles notification updates for ovo from xendit

Jump to

Keyboard shortcuts

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