asanpardakht

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://ipgrest.asanpardakht.ir/v1/Token"
	APIPaymentURL    = "https://asan.shaparak.ir"
	APIVerifyURL     = "https://ipgrest.asanpardakht.ir/v1/verify"
	APISettlementURL = "https://ipgrest.asanpardakht.ir/v1/Settlement"
	APITranResultURL = "https://ipgrest.asanpardakht.ir/v1/TranResult"
)

Const's for AsanPardakht

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	MerchantConfigID string
	Callback         string
	Username         string
	Password         string
}

Driver configures the AsanPardakht 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) string

PayURL return pay url

func (*Driver) Purchase

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

Purchase send purchase request to asanpardakht gateway

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 payment

type VerifyRequest

type VerifyRequest struct {
	InvoiceID string `json:"invoice_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