Documentation ¶
Index ¶
- Constants
- type Data
- type FloatingShareSettlementResponse
- type PaymentResponse
- type UnverifiedTransactionsResponse
- type VerifyFloatingShareSettlementResponse
- type VerifyResponse
- type Wages
- type Zarinpal
- func (z *Zarinpal) FloatingShareSettlement(ctx context.Context, amount uint, description, callbackUrl string, ...) (*FloatingShareSettlementResponse, error)
- func (z *Zarinpal) RequestPayment(ctx context.Context, amount uint, callBackUrl, currency, description string, ...) (*PaymentResponse, error)
- func (z *Zarinpal) UnverifiedTransactions(ctx context.Context) (*UnverifiedTransactionsResponse, error)
- func (z *Zarinpal) VerifyFloatingShareSettlement(ctx context.Context, amount uint, authority string) (*VerifyFloatingShareSettlementResponse, error)
- func (z *Zarinpal) VerifyPayment(ctx context.Context, amount uint, authority string) (*VerifyResponse, error)
Constants ¶
View Source
const ( ZARINPAL_HOST = "https://api.zarinpal.com" ZARINPAL_SANDBOX_HOST = "https://sandbox.zarinpal.com" )
View Source
const ( ZARINPAL_REQUEST_API_ENDPOINT = "/pg/v4/payment/request.json" ZARINPAL_VERIFY_API_ENDPOINT = "/pg/v4/payment/verify.json" ZARINPAL_UNVERIFIED_TRANSACTION_API_ENDPOINT = "/pg/v4/payment/unVerified.json" )
View Source
const API_VERSION = "4"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { Code int `json:"code"` Message string `json:"message"` Authority string `json:"authority,omitempty"` CardHash string `json:"card_hash,omitempty"` CardPan string `json:"card_pan,omitempty"` RefID int `json:"ref_id,omitempty"` FeeType string `json:"fee_type,omitempty"` Fee int `json:"fee,omitempty"` Wages []*Wages `json:"wages,omitempty"` Authorities []struct { Authority string `json:"authority"` Amount int `json:"amount"` CallBackURL string `json:"callback_url"` Referer string `json:"referer"` Date string `json:"date"` } `json:"authorities,omitempty"` }
type FloatingShareSettlementResponse ¶
type FloatingShareSettlementResponse struct {
}type PaymentResponse ¶
type UnverifiedTransactionsResponse ¶
type UnverifiedTransactionsResponse struct {
Data *Data `json:"data"`
}
type VerifyFloatingShareSettlementResponse ¶
type VerifyFloatingShareSettlementResponse struct {}
type VerifyResponse ¶
type Zarinpal ¶
type Zarinpal struct {
// contains filtered or unexported fields
}
func (*Zarinpal) FloatingShareSettlement ¶
func (z *Zarinpal) FloatingShareSettlement(ctx context.Context, amount uint, description, callbackUrl string, wages []*Wages, metaData map[string]interface{}) (*FloatingShareSettlementResponse, error)
FloatingShareSettlement a special method is used for sellers who benefit from an incoming amount, more information in https://docs.zarinpal.com/paymentGateway/setshare.html#%D8%AA%D8%B3%D9%88%DB%8C%D9%87-%D8%A7%D8%B4%D8%AA%D8%B1%D8%A7%DA%A9%DB%8C-%D8%B4%D9%86%D8%A7%D9%88%D8%B1
func (*Zarinpal) RequestPayment ¶
func (z *Zarinpal) RequestPayment(ctx context.Context, amount uint, callBackUrl, currency, description string, metaData map[string]interface{}) (*PaymentResponse, error)
RequestPayment create payment request and return status code and authority
func (*Zarinpal) UnverifiedTransactions ¶
func (z *Zarinpal) UnverifiedTransactions(ctx context.Context) (*UnverifiedTransactionsResponse, error)
UnverifiedTransactions get unverified transactions from provider
func (*Zarinpal) VerifyFloatingShareSettlement ¶
func (z *Zarinpal) VerifyFloatingShareSettlement(ctx context.Context, amount uint, authority string) (*VerifyFloatingShareSettlementResponse, error)
VerifyFloatingShareSettlement verify floating share settlement
func (*Zarinpal) VerifyPayment ¶
func (z *Zarinpal) VerifyPayment(ctx context.Context, amount uint, authority string) (*VerifyResponse, error)
VerifyPayment transaction by merchant id, amount and authority to payment provider
Click to show internal directories.
Click to hide internal directories.