zibal

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	APIPurchaseURL = "https://gateway.zibal.ir/v1/request"
	APIVerifyURL   = "https://gateway.zibal.ir/v1/verify"
	APIPaymentURL  = "https://gateway.zibal.ir/start/"
)

Const's for zibal driver

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	Merchant string `json:"merchant"`
	Callback string `json:"callback"`
}

Driver config struct for zibal driver

func (Driver) GetDriverName

func (Driver) GetDriverName() string

GetDriverName returns driver name

func (*Driver) PayMethod

func (*Driver) PayMethod() string

PayMethod returns the Request Method to be used to pay the invoice.

func (*Driver) PayURL

func (*Driver) PayURL(invoice *invoice.Invoice) string

PayURL returns the url to redirect the user to in order to pay the invoice.

func (*Driver) Purchase

func (d *Driver) Purchase(invoice *invoice.Invoice) (string, error)

Purchase sends a request to zibal to purchase an invoice.

func (*Driver) RenderRedirectForm

func (d *Driver) RenderRedirectForm(invoice *invoice.Invoice) (string, error)

RenderRedirectForm renders the html form for redirect to payment page.

func (Driver) SetClient

func (Driver) SetClient(c httpClient.Client)

SetClient sets the http client

func (*Driver) Verify

func (d *Driver) Verify(vReq interface{}) (*receipt.Receipt, error)

Verify is the function to verify a payment

type VerifyRequest

type VerifyRequest struct {
	TrackID string `json:"track_id"`
}

VerifyRequest is the request struct for verify

Jump to

Keyboard shortcuts

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