Class: PaymentRequest

bip70.PaymentRequest

new PaymentRequest(optionsnullable)

Represents a BIP70 payment request.

Parameters:
Name Type Attributes Description
options Object <nullable>
Properties:
Name Type Description
version Number
pkiType String | null
pkiData Buffer | null
paymentDetails PaymentDetails
signature Buffer | null
Source:

Methods

(static) fromOptions(options) → {PaymentRequest}

Instantiate payment request from options.

Parameters:
Name Type Description
options Object
Source:
Returns:
Type
PaymentRequest

(static) fromRaw(data) → {PaymentRequest}

Instantiate payment request from serialized data.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
PaymentRequest

(private) fromOptions(options) → {PaymentRequest}

Inject properties from options.

Parameters:
Name Type Description
options Object
Source:
Returns:
Type
PaymentRequest

(private) fromRaw(data) → {PaymentRequest}

Inject properties from serialized data.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
PaymentRequest

getAlgorithm() → {Object|null}

Get payment request signature algorithm.

Source:
Returns:
Type
Object | null

getCA() → {Object|null}

Get root certificate authority.

Source:
Returns:
Type
Object | null

getChain() → {Array:.<Buffer:>}

Get x509 certificate chain.

Source:
Returns:
Type
Array:.<Buffer:>

setChain(chain)

Set x509 certificate chain.

Parameters:
Name Type Description
chain Array:.<Buffer:>
Source:

sign(key, chainnullable)

Sign payment request (chain must be set).

Parameters:
Name Type Attributes Description
key Buffer
chain Array:.<Buffer:> <nullable>
Source:

signatureData() → {Buffer}

Serialize payment request for sighash.

Source:
Returns:
Type
Buffer

signatureHash() → {Hash}

Get signature hash.

Source:
Returns:
Type
Hash

toRaw() → {Buffer}

Serialize the payment request (protobuf).

Source:
Returns:
Type
Buffer

verify() → {Boolean}

Verify payment request signature.

Source:
Returns:
Type
Boolean

verifyChain() → {Boolean}

Verify x509 certificate chain.

Source:
Returns:
Type
Boolean