clickbank

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCouldNotDecode = errors.New("could not Base64 decode string")
View Source
var ErrInvalidInput = errors.New("input is not a factor of the cipher's blocksize")
View Source
var ErrInvalidPadding = errors.New("decrypted output does not appear to be correctly PKCS5 padded")

Functions

func DecryptRequestBody

func DecryptRequestBody(body io.Reader, key []byte) ([]byte, error)

func ObfuscateKey

func ObfuscateKey(key []byte) []byte

func PKCS5Unpad

func PKCS5Unpad(input []byte) ([]byte, error)

func StripCtrlChars

func StripCtrlChars(input []byte) string

Types

type ClickbankAddress

type ClickbankAddress struct {
	Address1   string `json:"address1"`
	Address2   string `json:"address2"`
	City       string `json:"city"`
	Country    string `json:"country"`
	State      string `json:"state"`
	PostalCode string `json:"postalCode"`
	County     string `json:"county"`
}

type ClickbankContact

type ClickbankContact struct {
	FirstName   string           `json:"firstName"`
	LastName    string           `json:"lastName"`
	FullName    string           `json:"fullName"`
	PhoneNumber string           `json:"phoneNumber"`
	Email       string           `json:"email"`
	Address     ClickbankAddress `json:"address"`
}

type ClickbankCustomer

type ClickbankCustomer struct {
	Shipping ClickbankContact `json:"shipping"`
	Billing  ClickbankContact `json:"billing"`
}

type ClickbankHopfeed

type ClickbankHopfeed struct {
	HopfeedClickId           string  `json:"hopfeedClickId"`
	HopfeedApplicationId     int     `json:"hopfeedApplicationId"`
	HopfeedCreativeId        int     `json:"hopfeedCreativeId"`
	HopfeedApplicationPayout float32 `json:"hopfeedApplicationPayout"`
	HopfeedVendorPayout      float32 `json:"hopfeedVendorPayout"`
}

type ClickbankLineItem

type ClickbankLineItem struct {
	ItemNo        string  `json:"itemNo"`
	ProductTitle  string  `json:"productTitle"`
	Shippable     bool    `json:"shippable"`
	Recurring     bool    `json:"recurring"`
	AccountAmount float32 `json:"accountAmount"`
	Quantity      int     `json:"quantity"`
	DownloadUrl   string  `json:"downloadUrl"`
}

type ClickbankNotification

type ClickbankNotification struct {
	TransactionTime     string                 `json:"transactionTime"`
	Receipt             string                 `json:"receipt"`
	TransactionType     string                 `json:"transactionType"`
	Vendor              string                 `json:"vendor"`
	Affiliate           string                 `json:"affiliate"`
	Role                string                 `json:"role"`
	TotalAccountAmount  float32                `json:"totalAccountAmount"`
	PaymentMethod       string                 `json:"paymentMethod"`
	TotalOrderAmount    float32                `json:"totalOrderAmount"`
	TotalTaxAmount      float32                `json:"totalTaxAmount"`
	TotalShippingAmount float32                `json:"totalShippingAmount"`
	Currency            string                 `json:"currency"`
	OrderLanguage       string                 `json:"orderLanguage"`
	TrackingCodes       []string               `json:"trackingCodes"`
	LineItems           []ClickbankLineItem    `json:"lineItems"`
	Customer            ClickbankCustomer      `json:"customer"`
	Upsell              ClickbankUpsell        `json:"upsell"`
	Hopfeed             ClickbankHopfeed       `json:"hopfeed"`
	Version             float32                `json:"version"`
	AttemptCount        int                    `json:"attemptCount"`
	VendorVariables     map[string]interface{} `json:"vendorVariables"`
}

func DecodeResponse

func DecodeResponse(encoded_response []byte) (*ClickbankNotification, error)

type ClickbankUpsell

type ClickbankUpsell struct {
	UpsellOriginalReceipt string `json:"upsellOriginalReceipt"`
	UpsellFlowId          int    `json:"upsellFlowId"`
	UpsellSession         string `json:"upsellSession"`
	UpsellPath            string `json:"upsellPath"`
}

type CryptStruct

type CryptStruct struct {
	// contains filtered or unexported fields
}

func NewCryptStruct

func NewCryptStruct(key []byte, iv []byte) (*CryptStruct, error)

Create a new CrypteStruct

func (*CryptStruct) Decrypt

func (c *CryptStruct) Decrypt(input []byte) ([]byte, error)

Decrypt Something

func (*CryptStruct) DecryptPKCS5

func (c *CryptStruct) DecryptPKCS5(input []byte) ([]byte, error)

type EncryptedNotification

type EncryptedNotification struct {
	IV           string `json:"iv"`
	Notification string `json:"notification"`
}

Jump to

Keyboard shortcuts

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