new Payment(connection, attrs)
A DZINPAID Payment message. From the Whitepaper:
This message provides an interface primarily for the purchaser of an item to acknowledge receipt of the good and provide feedback on the seller's delivery and product. Multiple DZINPAID messages per DZINCRTE message will be supported, but reputation ramifications will be dependent on the implementor's discretion. Buyers may need to amend a review at some time after its initial issuance. The transaction destination of this message will be addressed to the seller
receiverAddr: Payments should be addressed to the sender of the Invoice which it is paying.
NOTE: All attributes that are specified below are also getter properties that can be accessed on this instantiated object.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
connection |
Driver | blockchain connection |
||||||||||||||||||
attrs |
object | Attributes that this Payment contains Properties
|
Extends
Methods
-
getInvoice(cb)
-
Fetch the invoice that this function's invoiceTxid references from the blockchain
Parameters:
Name Type Description cb
function Callback to receive Invoice message in the form: function(err, invoice)
-
isValid(cb)
-
Determine whether this message has been properly formatted, and is 'in consensus' with the Drop Zone protocol. Further documentation for this validation result, and it's error messages can be found in the async-validate library.
Parameters:
Name Type Description cb
function Callback to receive the results of the validity test form: function(err, res)
- Inherited From:
-
save(cb)
-
Save this message into the blockchain, if it hasn't yet been persisted, and was instantiated without a txid.
NOTE: Validation is not performed as part of this method. It's entirely possible to persist a message into the blockchain that will be ommitted from search/scan results by clients. Validation is performed as part of #find() not #save().
Parameters:
Name Type Description cb
function Callback which receives the mempool-persisted message in the form: function(err, message)
NOTE: Due to transaction-maleability, the persisted txid may change at the time of actual confirmation. This method merely broadcasts the message into the mempool.
- Inherited From:
-
toTransaction()
-
Return a hash object representing the serialized components of this transaction suitable for passing onto TxEncode.
- Inherited From:
Returns:
- Type
- object