zarinpal

package module
v0.0.0-...-107282f Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MerchantIDLength = 36
	SandboxURL       = "https://sandbox.zarinpal.com/pg/rest/WebGate/"
	ProductionURL    = "https://www.zarinpal.com/pg/rest/WebGate/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PaymentRequestInput

type PaymentRequestInput struct {
	Amount      int    `json:"amount"`
	CallbackURL string `json:"callback_url"`
	Description string `json:"description"`
	Email       string `json:"email,omitempty"`
	Mobile      string `json:"mobile,omitempty"`
}

type PaymentRequestOutput

type PaymentRequestOutput struct {
	Status    int    `json:"status"`
	Authority string `json:"authority"`
	URL       string `json:"url"`
}

type PaymentVerificationInput

type PaymentVerificationInput struct {
	Amount    int    `json:"amount"`
	Authority string `json:"authority"`
}

type PaymentVerificationOutput

type PaymentVerificationOutput struct {
	Status   int    `json:"status"`
	Message  string `json:"message"`
	CardHash string `json:"card_hash"`
	CardPan  string `json:"card_pan"`
	RefID    int64  `json:"ref_id"`
	FeeType  string `json:"fee_type"`
	Fee      int    `json:"fee"`
}

type UnverifiedTransactionsOutput

type UnverifiedTransactionsOutput struct {
	Code        int      `json:"code"`
	Message     string   `json:"message"`
	Authorities []string `json:"authorities"`
}

type ZarinPal

type ZarinPal struct {
	MerchantID string
	Sandbox    bool
	Currency   string
	BaseURL    string
}

func NewZarinPal

func NewZarinPal(merchantID string, sandbox bool, currency string) (*ZarinPal, error)

func (*ZarinPal) PaymentRequest

func (z *ZarinPal) PaymentRequest(input PaymentRequestInput) (*PaymentRequestOutput, error)

func (*ZarinPal) PaymentVerification

func (z *ZarinPal) PaymentVerification(input PaymentVerificationInput) (*PaymentVerificationOutput, error)

func (*ZarinPal) UnverifiedTransactions

func (z *ZarinPal) UnverifiedTransactions() (*UnverifiedTransactionsOutput, error)

Jump to

Keyboard shortcuts

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