novinpal

package
v0.0.0-...-991c3fc Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATE_TRANSACTION_URL = "https://api.novinpal.ir/invoice/request"
	VERIFY_TRANSACTION_URL = "https://api.novinpal.ir/invoice/verify"
)

Variables

This section is empty.

Functions

func New

func New(
	identityData IdentityData,
) *novinpal

Types

type ErrorResponse

type ErrorResponse struct {
	Status           int    `json:"status"`
	ErrorCode        string `json:"errorCode"`
	ErrorDescription string `json:"errorDescription"`
}

type IdentityData

type IdentityData interface {
	GetIdentityData() (string, error)
}

type PaymentRequest

type PaymentRequest struct {
	ApiKey      string  `json:"api_key"`
	Amount      uint64  `json:"amount"`
	ReturnUrl   string  `json:"return_url"`
	OrderId     string  `json:"order_id"`
	Description *string `json:"description,omitempty"`
	Mobile      *string `json:"mobile,omitempty"`
	CardNumber  *string `json:"card_number,omitempty"`
}

func NewPaymentRequest

func NewPaymentRequest(
	amount uint64,
	returnUrl, orderId string,
	description, mobile, cardNumber *string,
) *PaymentRequest

type PaymentResponse

type PaymentResponse struct {
	RefId  int `json:"refId"`
	Status int `json:"status"`
}

type VerifyRequest

type VerifyRequest struct {
	ApiKey string `json:"api_key"`
	RefId  string `json:"ref_id"`
}

func NewVerifyRequest

func NewVerifyRequest(
	refId string,
) *VerifyRequest

type VerifyResponse

type VerifyResponse struct {
	PaidAt         string `json:"paidAt"`
	CardNumber     string `json:"cardNumber"`
	Status         int    `json:"status"`
	Amount         int    `json:"amount"`
	RefNumber      string `json:"refNumber"`
	RefId          string `json:"refId"`
	Description    string `json:"description"`
	OrderId        string `json:"orderId"`
	VerifiedBefore bool   `json:"verifiedBefore"`
}

Jump to

Keyboard shortcuts

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