rest

package
v0.0.0-...-7544875 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse represents a response containing an error message.

type PaidOPORequest

type PaidOPORequest struct {
	PaymentTrxID string `json:"payment_trx_id,omitempty"`
}

type PaymentHandler

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

func NewPaymentHandler

func NewPaymentHandler(payment PaymentService) *PaymentHandler

func (*PaymentHandler) Register

func (p *PaymentHandler) Register(r chi.Router)

type PaymentService

type PaymentService interface {
	Register(ctx context.Context, params payment.Payment) (string, error)
	ByPaymentTrxID(ctx context.Context, paymentTrxID string) (payment.Payment, error)
	OPOPaid(ctx context.Context, paymentTrxID string) error
}

type RegisterRequest

type RegisterRequest struct {
	TransactionDetail struct {
		TrxID       string  `json:"trx_id"`
		FinalAmount float64 `json:"final_amount"`
	} `json:"transaction_detail"`
	CustomerDetail struct {
		Name    string `json:"name"`
		Address string `json:"address"`
	} `json:"customer_detail"`
	ItemDetails []struct {
		ID       int64   `json:"id"`
		Name     string  `json:"name"`
		Quantity int64   `json:"quantity"`
		Price    float64 `json:"price"`
	} `json:"item_details"`
}

type RegisterResponse

type RegisterResponse struct {
	Data struct {
		PaymentTrxID string `json:"payment_trx_id"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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