Documentation
¶
Index ¶
- Constants
- Variables
- type ApiType
- type PeriodType
- type Pingback
- func (p *Pingback) Get(key string) string
- func (p *Pingback) GetError() error
- func (p *Pingback) GetErrors() []error
- func (p *Pingback) GetProductID() string
- func (p *Pingback) GetProductPeriod() (length string, period string)
- func (p *Pingback) GetReferenceID() string
- func (p *Pingback) GetType() PingbackType
- func (p *Pingback) GetUID() string
- func (p *Pingback) GetVCAmount() string
- func (p *Pingback) IsCancelable() bool
- func (p *Pingback) IsDeliverable() bool
- func (p *Pingback) IsIPValid() bool
- func (p *Pingback) IsParametersValid() bool
- func (p *Pingback) IsSignatureValid() bool
- func (p *Pingback) IsUnderReview() bool
- func (p *Pingback) Validate(skipIPCheck bool) bool
- type PingbackType
- type Product
- type ProductType
- type Widget
- func (w *Widget) AppendProduct(products ...Product) error
- func (w *Widget) GetHtmlCode(attributes map[string]string) string
- func (w *Widget) GetUrl() string
- func (w *Widget) SetCallbackUrl(successUrl, failureUrl string)
- func (w *Widget) SetExtraParam(k, v string)
- func (w *Widget) SetExtraParams(m map[string]string)
- func (w *Widget) SetPS(ps string)
Constants ¶
View Source
const ( // https://docs.paymentwall.com/reference/signature-calculation DefaultSignVersion = "3" // sha256 SignVersion2 = "2" // md5 SignVersion3 = "3" // sha256 )
View Source
const ( // https://docs.paymentwall.com/#chargeback-pingback PingbackChargebackReason1 = "1" // Chargeback PingbackChargebackReason2 = "2" // Credit Card fraud. Recommendation: Ban User PingbackChargebackReason3 = "3" // Other fraud. Recommendation: Ban User PingbackChargebackReason4 = "4" // Bad data entry PingbackChargebackReason5 = "5" // Fake / Proxy user PingbackChargebackReason6 = "6" // Rejected by advertiser PingbackChargebackReason7 = "7" // Duplicate conversions PingbackChargebackReason8 = "8" // Goodwill credit taken back PingbackChargebackReason9 = "9" // Canceled order, e.g. refund PingbackChargebackReason10 = "10" // Partially reversed transaction )
View Source
const ( VC_CONTROLLER = "ps" GOODS_CONTROLLER = "subscription" CART_CONTROLLER = "cart" )
Variables ¶
View Source
var (
ErrorOnlyOneProductAllowed = errors.New("only one product is allowed when ApiType is API_GOODS")
)
Functions ¶
This section is empty.
Types ¶
type PeriodType ¶
type PeriodType string
const ( PeriodTypeDay PeriodType = "day" PeriodTypeWeek PeriodType = "week" PeriodTypeMonth PeriodType = "month" PeriodTypeYear PeriodType = "year" )
type Pingback ¶
type Pingback struct {
IsTest bool
// contains filtered or unexported fields
}
func NewPingback ¶
func (*Pingback) GetProductID ¶
func (*Pingback) GetProductPeriod ¶
func (*Pingback) GetReferenceID ¶
func (*Pingback) GetType ¶
func (p *Pingback) GetType() PingbackType
func (*Pingback) GetUID ¶
Unique identifier of the user. The value of parameter “uid” from Widget call.
func (*Pingback) GetVCAmount ¶
func (*Pingback) IsCancelable ¶
func (*Pingback) IsDeliverable ¶
func (*Pingback) IsIPValid ¶
IsIPValid checks to ensure the IP from which the pingback was received is within the allowed range of whitelisted IPs provided by Paymentwall. @see: https://docs.paymentwall.com/reference/pingback-new-ip-subnet
func (*Pingback) IsParametersValid ¶
func (*Pingback) IsSignatureValid ¶
func (*Pingback) IsUnderReview ¶
type PingbackType ¶
type PingbackType string
const ( PingbackTypeRegular PingbackType = "0" // When product is purchased. Please check whether the reference ID is unique and deliver the goods. PingbackTypeGoodwill PingbackType = "1" PingbackTypeNegative PingbackType = "2" // When user issued chargeback or refund. Please take the delivered goods out from user’s account. PingbackTypeRiskUnderReview PingbackType = "200" // Pending status. In case a payment is currently under risk review by Paymentwall. Please do not deliver the goods yet. PingbackTypeRiskReviewedAccepted PingbackType = "201" // Review is done and payment is accepted. Please check whether the reference ID is unique and deliver the goods. PingbackTypeRiskReviewedDeclined PingbackType = "202" // Review is done and payment is declined. Please do not deliver the goods since the user will get his money back. PingbackTypeRiskAuthorizationVoided PingbackType = "203" // Authorization has been voided due to no capture request received on time. PingbackTypeSubscriptionCancelled PingbackType = "12" // When user cancels subscription plan. Sent immediately upon cancellation, e.g. in the middle of current premium month. PingbackTypeSubscriptionExpired PingbackType = "13" // When subscription expired. PingbackTypeSubscriptionPaymentFailed PingbackType = "14" // When renewal subscription payment failed. Subscription stopped due to failing payments e.g. due to insufficient funds. )
type Product ¶
type Product struct {
Name string
Identity string
Amount float64
Currency string
Type ProductType
Recurring bool
PeriodLength uint
PeriodType PeriodType
}
func NewProduct ¶
func NewProduct( name, id string, amount float64, currency string, pType ProductType) *Product
func (*Product) DisplayAmount ¶
func (*Product) DisplayPeriodLength ¶
func (*Product) SetSubscription ¶
func (p *Product) SetSubscription( periodLength uint, periodType PeriodType, isRecurring bool)
type ProductType ¶
type ProductType string
const ( ProductTypeSubscription ProductType = "subscription" ProductTypeFixed ProductType = "fixed" )
type Widget ¶
type Widget struct {
// contains filtered or unexported fields
}
func (*Widget) AppendProduct ¶
func (*Widget) SetCallbackUrl ¶
func (*Widget) SetExtraParam ¶
func (*Widget) SetExtraParams ¶
Click to show internal directories.
Click to hide internal directories.