bchwallet: github.com/gcash/bchwallet/pymtproto Index | Files | Directories

package pymtproto

import "github.com/gcash/bchwallet/pymtproto"

Index

Package Files

paymentprotocol.go

type Output Uses

type Output struct {
    Address bchutil.Address
    Amount  bchutil.Amount
}

Output represents an address and amount to be paid.

type Payment Uses

type Payment struct {
    PaymentURL   string
    MerchantData []byte
    Transactions []*wire.MsgTx
    RefundOutput Output
    Memo         string
}

Payment is an object that holds all information needed to POST a payment back to the merchant server. All fields except memo are required.

type PaymentProtocolClient Uses

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

PaymentProtocolClient is used to download payment requests and make payments. We use an object for this to make testing a little easier.

func NewPaymentProtocolClient Uses

func NewPaymentProtocolClient(params *chaincfg.Params, proxyDialer proxy.Dialer) *PaymentProtocolClient

NewPaymentProtocolClient returns a PaymentRequestDownloader that can be used to get the payment request.

func (*PaymentProtocolClient) DownloadBip0070PaymentRequest Uses

func (c *PaymentProtocolClient) DownloadBip0070PaymentRequest(uri string) (*PaymentRequest, error)

DownloadBip0070PaymentRequest will download a Bip70 (protobuf) payment request from the provided bitcoincash URI. Upon download it will validate the request is formatted correctly and signed with a valid X509 certificate. The cert will be checked against the OS's certificate store. A PaymentRequest object with the relevant data extracted is returned.

func (*PaymentProtocolClient) PostPayment Uses

func (c *PaymentProtocolClient) PostPayment(payment *Payment) (memo string, err error)

PostPayment sends a payment response back to the merchant's server. Any errors that are encountered in the process are returned along with an optional "memo" that the merchant can include in the ACK.

type PaymentRequest Uses

type PaymentRequest struct {
    PayToName    string
    Outputs      []Output
    Expires      time.Time
    Memo         string
    PaymentURL   string
    MerchantData []byte
}

PaymentRequest is returned by the DownloadBip0070PaymentRequest method. It contains all the relevant information from the downloaded payment request.

Directories

PathSynopsis
payments

Package pymtproto imports 16 packages (graph) and is imported by 1 packages. Updated 2019-08-26. Refresh now. Tools for package owners.