payment

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2016 License: ISC Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReceiptLength         = 64 // hex bytes
	NonceLength           = 64 // hex bytes
	RequiredConfirmations = 3
)

maximum values

Variables

This section is empty.

Functions

func Finalise added in v0.2.0

func Finalise()

stop all payment handlers

func Initialise added in v0.2.0

func Initialise(configuration *Configuration) error

create the tables

func ScaledDifficulty added in v0.2.0

func ScaledDifficulty(count int) *difficulty.Difficulty

produce a scaled difficulty based on the number of items in a block to be processed and include a quantity discount

func Store added in v0.2.0

func Store(currencyName currency.Currency, transactions []byte, count int, canProof bool) (PayId, PayNonce, *difficulty.Difficulty)

store an incoming record for payment

func TrackPayment added in v0.2.0

func TrackPayment(payId PayId, receipt string, confirmations uint64)

start payment tracking on an receipt

func TryProof added in v0.2.0

func TryProof(payId PayId, clientNonce []byte) bool

instead of paying, try a proof from the client nonce

Types

type Configuration added in v0.2.0

type Configuration struct {
	Bitcoin *bitcoin.Configuration
}

configuration for each sub-module

type PayId added in v0.2.0

type PayId [48]byte

type to represent a payment identifier this is considered as a big endian value for difficulty comparison Note: no reversal is required for this

func NewPayId added in v0.2.0

func NewPayId(packed []byte) PayId

create a payment identifier from a set of transactions

func (PayId) GoString added in v0.2.0

func (payid PayId) GoString() string

convert a binary pay id to big endian hex string for use by the fmt package (for %#v)

func (PayId) MarshalText added in v0.2.0

func (payid PayId) MarshalText() ([]byte, error)

convert pay id to big endian hex text

func (PayId) String added in v0.2.0

func (payid PayId) String() string

convert a binary pay id to big endian hex string for use by the fmt package (for %s)

func (*PayId) UnmarshalText added in v0.2.0

func (payid *PayId) UnmarshalText(s []byte) error

convert little endian hex text into a pay id

type PayNonce added in v0.2.0

type PayNonce [8]byte

type to represent a payment nonce Note: no reversal is required for this

func NewPayNonce added in v0.2.0

func NewPayNonce() PayNonce

create a random pay nonce

func (PayNonce) GoString added in v0.2.0

func (paynonce PayNonce) GoString() string

convert a binary pay nonce to big endian hex string for use by the fmt package (for %#v)

func (PayNonce) MarshalText added in v0.2.0

func (paynonce PayNonce) MarshalText() ([]byte, error)

convert pay nonce to big endian hex text

func (PayNonce) String added in v0.2.0

func (paynonce PayNonce) String() string

convert a binary pay nonce to big endian hex string for use by the fmt package (for %s)

func (*PayNonce) UnmarshalText added in v0.2.0

func (paynonce *PayNonce) UnmarshalText(s []byte) error

convert little endian hex text into a pay nonce

Directories

Path Synopsis
Detect payment records in the Bitcoin Block Chain Payments are indicated by OP_RETURN embedded data, this is compressed to fit it within the 80 byte Bitcoin limit.
Detect payment records in the Bitcoin Block Chain Payments are indicated by OP_RETURN embedded data, this is compressed to fit it within the 80 byte Bitcoin limit.

Jump to

Keyboard shortcuts

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