payments

package
v1.3.35 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrder

func CreateOrder(order CreatePaymentOrder) string

func Decode

func Decode(kp string) (map[string]interface{}, error)

func DecodeAPI

func DecodeAPI(API string) (map[string]interface{}, error)

func KarmaPayWebhook added in v1.1.3

func KarmaPayWebhook(action func(data map[string]string) error) func(c *fiber.Ctx) error

func PushOrderToRedis

func PushOrderToRedis(Order RedisOrder)

func TriggerWebhook

func TriggerWebhook(url string) error

func VerifyPaymentAPI

func VerifyPaymentAPI() func(c *fiber.Ctx) error

Types

type CreatePaymentOrder

type CreatePaymentOrder struct {
	OrderAmount      int32  `json:"order_amt"`
	OrderCurrency    string `json:"order_currency"`
	OrderDescription string `json:"order_description"`
	OrderMode        string `json:"order_mode"`
	RedirectURL      string `json:"redirect_url"`
	WebhookURL       string `json:"webhook_url"`
	Registration     string `json:"registration"`
}

type Order

type Order struct {
	UID                   string `json:"uid"`
	OrderID               string `json:"order_id"`
	OrderAmount           string `json:"order_amount"`
	OrderStatus           string `json:"order_status"`
	OrderCID              string `json:"order_cid"`
	OrderCurrency         string `json:"order_currency"`
	OrderDescription      string `json:"order_description"`
	OrderTimeStamp        string `json:"order_timestamp"`
	OrderUpiTransactionID string `json:"order_upi_transaction_id"`
}

type RedisOrder

type RedisOrder struct {
	OrderID          string          `json:"order_id"`
	OrderStatus      string          `json:"order_status"`
	UID              string          `json:"uid"`
	Email            string          `json:"email"`
	KPAPI            string          `json:"kpapi"`
	API_KEY          string          `json:"api_key"`
	OrderAmount      string          `json:"order_amt"`
	OrderCurrency    string          `json:"order_currency"`
	OrderDescription string          `json:"order_description"`
	Subdomain        string          `json:"subdomain"`
	OrderMode        string          `json:"order_mode"`
	WebhookURL       string          `json:"webhook_url"`
	RedirectURL      string          `json:"redirect_url"`
	VerifyURL        string          `json:"verify_url"`
	Registration     string          `json:"registration"`
	OrderCID         string          `json:"order_cid"`
	PGOrder          json.RawMessage `json:"PGOrder"`
	Timestamp        string          `json:"timestamp"`
}

func GetOrderFromRedis

func GetOrderFromRedis(OrderID string) (RedisOrder, error)

type ResponseHTTP

type ResponseHTTP struct {
	Success bool        `json:"success"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

type VerifyPaymentRequest

type VerifyPaymentRequest struct {
	OID       string `json:"oid"`
	CID       string `json:"cid"`
	OrderID   string `json:"order_id"`
	PaymentID string `json:"payment_id"`
	Signature string `json:"signature"`
	RZKey     string `json:"RZKey"`
}

Jump to

Keyboard shortcuts

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