The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Business::Bitcoin::Request - Bitcoin payment request

VERSION

 $Revision: 1.047 $
 $Date: Thu Aug 17 01:01:54 PDT 2017 $

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:

LICENSE AND COPYRIGHT

Copyright (c) 2016-2017 Ashish Gulhati.

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.

See http://www.perlfoundation.org/artistic_license_2_0 for the full license terms.