driver

package
v1.1.24 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ZARINPAL_NORMAL = "normal"
View Source
const ZARINPAL_SANDBOX = "sandbox"

Variables

This section is empty.

Functions

This section is empty.

Types

type Paytr

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

func (*Paytr) Pay

func (p *Paytr) Pay(i *payment.Invoice) *payment.PayResponse

func (*Paytr) Purchase

func (p *Paytr) Purchase(ctx context.Context, i *payment.Invoice) (*payment.Invoice, error)

func (*Paytr) Verify

func (p *Paytr) Verify(ctx context.Context, amount uint64, args map[string]string) (*payment.Receipt, error)

type PaytrConfig

type PaytrConfig struct {
	IsTest       bool
	MerchantID   string
	MerchantSalt string
	MerchantKey  string
	CallbackURL  string
}

func NewPaytrConfig

func NewPaytrConfig(isTest bool, callbackURL, merchantID, merchantSalt, merchantKey string) *PaytrConfig

func (*PaytrConfig) Prepare

func (c *PaytrConfig) Prepare() *Paytr

type Zarinpal

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

func (*Zarinpal) Pay

func (*Zarinpal) Purchase

func (z *Zarinpal) Purchase(ctx context.Context, i *payment.Invoice) (*payment.Invoice, error)

func (*Zarinpal) Verify

func (z *Zarinpal) Verify(ctx context.Context, amount uint64, args map[string]string) (*payment.Receipt, error)

type ZarinpalConfig

type ZarinpalConfig struct {
	Mode        string
	MerchantID  string
	Callback    string
	Description string
}

func NewZarinpalConfig

func NewZarinpalConfig(mode, merchantID, callback string) *ZarinpalConfig

func (*ZarinpalConfig) Gateway

func (z *ZarinpalConfig) Gateway() (*Zarinpal, error)

Gateway creates new Zarinpal gateway from the credentials in config

Jump to

Keyboard shortcuts

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