Skip to content

BDK Get Receipt Information

Xenland edited this page Dec 6, 2012 · 5 revisions

Back to API Call Index

Purpose

This function will open a connection with the Bitcoin client, search for the requested receipt by "Bitcoin address" and provide attributed information to the developer.

Parameter(s)

This function takes one parameter which is bitcoin_address; If no address is set or a valid one isn't set then an error will be returned.

Output | Type: Array

This function outputs an array this array will output return_status, checksum, timestamp_generated, amount_due_in_satoshi, products_in_receipt.

return_status

  • Type: Integer

-1 = Failure to collect information on the receipt

1 = Success (Information was successfully retrieved)

100 = Bitcoin address was not set, with out the address we can't retrieve any Bitcoin information

101 = Checksum didn't match don't trust any information associated with this receipt (Besides the obvious security of the block chain, like the current balance and the address is okay to trust)

102 = 102 dosen't exist

103 = Failure to connect to bitcoin client

104 = get address label function failed


checksum

  • Type: String

If return_status equals one (1) then this variables should contain the checksum to verify the necessary balance required to full-fill the receipt. Its advised for developers to do their own checksum checks but the bitcoin library already facilitates this during run-time so to speed up the development process a developer just needs to make sure the return_status is (1) one and the developer will be applying this "check".


timestamp_generated

  • Type: Integer

If return_status equals one (1) this this variable will contain the epoch time when this order was generated.


amount_due_in_satoshi

  • Type: Integer

If return_status equals one (1) this variable will return the amount of *Satoshi required before this order/receipt is considered to be paid in full status.


products_in_receipt

  • Type: Array

If return_status equals one (1) this variable will return the product ids'