Properties

$master_public_key

$master_public_key

$table_name

$table_name

$funds_received_value_expires_in_secs

$funds_received_value_expires_in_secs

$assigned_address_expires_in_secs

$assigned_address_expires_in_secs

$confirmations_required

$confirmations_required

$blockchain_api_timeout_secs

$blockchain_api_timeout_secs

$blockchain_api_max_failures

$blockchain_api_max_failures

$max_unusable_generated_addresses

$max_unusable_generated_addresses

$starting_index_for_new_btc_addresses

$starting_index_for_new_btc_addresses

$max_unused_addresses_buffer

$max_unused_addresses_buffer

Methods

ajax_status_invoice()

ajax_status_invoice()

AJAX wrapper for status_invoice, will print JSON object of the returned status.

status_invoice()

status_invoice(object $order, array $request) : array

Updates the status of a post_set and returns an assocative array of the status of the posts set.

Parameters

object $order

The posts_set object.

array $request

Request variables posted from the order form.

Returns

array —
  • success boolean If the status check was successful.
  • end boolean If this is the last check that is nessasary.
  • expired boolean If the post_set has expired.
  • seconds_remaining integer The number of seconds remaining until expired.
  • message string The text that should be displayed to the user.
  • request array Returning the request variables back which has customer information.
  • confirmed boolean If the post_set has been confirmed.
  • confirmations integer The number of confirmations.
  • confirmations_required integer The number of confirmations nessasary to be confirmed.
  • confirmation string The unque hash used as order identification.
  • btc_address string The bitcoin address that funds should be sent.
  • received_btc float The number of received bitcoins for received status.
  • paid_btc float The number of paid bitcoins for confirmed status.
  • date string The datetime is MySQL format.

ajax_process_invoice()

ajax_process_invoice()

AJAX wrapper for process_invoice, will print JSON object from returned status.

process_invoice()

process_invoice(array $request) : array

Processes a post_set with the status of a cart and changes it to a status of hold and saves information from $request to the database.

Parameters

array $request

Request variables posted from the order form.

Returns

array —
  • id boolean If the status check was successful.
  • success boolean If the status check was successful.
  • message string The text that should be displayed to the user.
  • request array Returning the request variables back which has customer information.
  • bitcoin_address string The bitcoin address that funds should be sent.
  • bitcoin_qrcode string A base64 encoded image string of data for the qrcode.
  • seconds_remaining integer The number of seconds remaining until the hold will expire.

curl()

curl(string $url, boolean $return_content_on_error, integer $timeout, string $user_agent) : string

Retreives data from a remote server.

Parameters

string $url

The url to request.

boolean $return_content_on_error

If to return content on error.

integer $timeout

The total seconds until the request will timeout.

string $user_agent

The user agent to identify.

Returns

string —

The data requested from the URL.

received_info()

received_info(string $btc_address, integer $required_confirmations, integer $api_timeout) : string

Discovers the received information for a particular bitcoin address.

Parameters

string $btc_address

The bitcoin address in question.

integer $required_confirmations

The total number of confirmations to check.

integer $api_timeout

The total seconds until the request will timeout.

Returns

string —

The status of the bitcoin address.

  • result string 'success' or 'error'
  • message string The message of the status.
  • host_reply_raw string The raw reply from the status of the bitcoin address
  • balance float The number of bitcoins received

payment_address()

payment_address( $request) : string

Gets a bitcoin address that can be used for payment.

Parameters

$request

Returns

string —

The newly minted bitcoin address.

  • result string 'success' or 'error'
  • message string The message of the status.
  • host_reply_raw string The raw reply from the status of the bitcoin address
  • generated_bitcoin_address string The bitcoin address available to be used.

add_address()

add_address() : string

Adds a new bitcoin address to the database.

Returns

string —

The newly minted bitcoin address.

  • result string 'success' or 'error'
  • message string The message of the status.
  • host_reply_raw string The raw reply from the status of the bitcoin address
  • generated_bitcoin_address string The bitcoin address available to be used.

address()

address(string $master_public_key, integer $key_index) : string

Generates a new bitcoin address based upon a master public key from Electrum.

Parameters

string $master_public_key

The master public key from Electrum.

integer $key_index

The index used for the key to syncronize with the offline wallet.

Returns

string —

The newly minted bitcoin address.

generate_addresses()

generate_addresses()

Callback to generate many bitcoin addresses in advance.

initialize()

initialize()

Callback to initialize settings.

db_install()

db_install()

Callback to install database scheme.