NAME
Business::Bitcoin::Request - Bitcoin payment request
VERSION
$Revision: 1.051 $
$Date: Tue Oct 16 22:26:58 PDT 2018 $
SYNOPSIS
Business::Bitcoin::Request objects represent Bitcoin payment requests generated by Business::Bitcoin.
use Business::Bitcoin;
my $bizbtc = new Business::Bitcoin (DB => '/tmp/bizbtc.db',
XPUB => 'xpub...');
my $request = $bizbtc->request(Amount => 4200);
print ($request->verify ? "Verified\n" : "Verification failed\n");
METHODS
new
Not intended to be called directly. Business::Bitcoin::Request objects should be created by calling the request method on a Business::Bitcoin object.
commit
Commit the Request object to the requests database. Only the 'processed' and 'status' fields are updated in the database.
verify
Verify that the request has been paid. Returns the total unspent balance at the address corresponding to the request if the request has been paid, and 0 if the balance at the address is lower than the request amount. The number of confirmations required to consider a payment valid can be set via the confirmations accessor.
ACCESSORS
Accessors can be called with no arguments to query the value of an object property, or with a single argument, to set the property to a specific value (unless the property is read only).
confirmations
The number of confirmations needed to consider a payment valid.
amount
The amount of the payment request, in Satoshi. Read only.
address
The Bitcoin receiving address for the payment request. Read only.
created
The timestamp of when the request was created. Stored as an int in the requests database. Read only.
reference
An optional reference ID for the request, to facilitate integration with existing order systems. Stored as a text field in the requests database. Read only.
processed
An optional property for applications to record the timestamp of when the transaction was processed. Stored as an int in the requests database. Read/write.
status
An optional property that can be used to record the status of the transaction ('processed', 'shipped', 'refunded', etc.). Stored as a text field in the requests database. Read/write.
error
If the last verify() returned undef, this accessor will return the error string that was received from the blockchain API call.
version
The version number of this module. Read only.
AUTHOR
Ashish Gulhati, <biz-btc at hash dot neomailbox.ch>
BUGS
Please report any bugs or feature requests to bug-business-bitcoin at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Business-Bitcoin. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Business::Bitcoin::Request
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
LICENSE AND COPYRIGHT
Copyright (c) Ashish Gulhati.
This software package is Open Software; you can use, redistribute, and/or modify it under the terms of the Open Artistic License 2.0.
Please see http://www.opensoftwr.org/oal20.txt for the full license terms, and ensure that the license grant applies to you before using or modifying this software. By using or modifying this software, you indicate your agreement with the license terms.