idpay

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://api.idpay.ir/v1.1/payment"
	APIPaymentURL        = "https://idpay.ir/p/ws/"
	APISandBoxPaymentURL = "https://idpay.ir/p/ws-sandbox/"
	APIVerifyURL         = "https://api.idpay.ir/v1.1/payment/verify"
)

Const's for idpay

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	MerchantID string
	Callback   string
	Sandbox    bool
}

Driver configures the idpay 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 (d *Driver) PayURL(invoice *invoice.Invoice) string

PayURL return pay url

func (*Driver) Purchase

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

Purchase send purchase request to idpay gateway

func (*Driver) RenderRedirectForm added in v1.7.0

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

RenderRedirectForm renders the html form for redirect to payment page.

func (Driver) SetClient added in v1.4.0

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 {
	RefID string `json:"order_id"`
	ID    string `json:"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