PHP Class BxPmtBitPay, dolphin.pro

Inheritance: extends BxPmtProvider
Afficher le fichier Open project: boonex/dolphin.pro

Méthodes publiques

Méthode Description
__construct ( $oDb, $oConfig, $aConfig ) Constructor
checkoutFinished ( )
createInvoice ( $orderId, $price, $posData, $options = [] ) : array Creates BitPay invoice via Bitpay::curl.
finalizeCheckout ( &$aData )
getCurrencyList ( ) : array Retrieves a list of all supported currencies and returns associative array.
getInvoice ( $invoiceId, $apiKey = false ) : mixed Retrieves an invoice from BitPay. $options can include 'apiKey'
getRate ( string $code = 'USD' ) : string Retrieves the current rate based on $code.
initializeCheckout ( $iPendingId, $aCartInfo, $bRecurring = false, $iRecurringDays )

Méthodes protégées

Méthode Description
_curl ( $url, $apiKey, $post = false ) : mixed Handles post/get to BitPay via curl.
_decodeResponse ( string $response ) : array Decodes JSON response and returns associative array.
_hash ( $data, $key ) : string Generates a base64 encoded keyed hash.
_initializeOptions ( )
_log ( mixed $contents ) Writes $contents to a log file specified in the bp_options file or, if missing, defaults to a standard filename of 'bplog.txt'.
_verifyAmount ( $aPosData, $fAmount )
_verifyNotification ( ) : mixed Call from your notification handler to convert $_POST data to an object containing invoice data
_verifyPosData ( array $aPosData ) : boolean Call from your notification handler to verify posData

Method Details

__construct() public méthode

Constructor
public __construct ( $oDb, $oConfig, $aConfig )

_curl() protected méthode

Handles post/get to BitPay via curl.
protected _curl ( $url, $apiKey, $post = false ) : mixed
Résultat mixed $response

_decodeResponse() protected méthode

Decodes JSON response and returns associative array.
protected _decodeResponse ( string $response ) : array
$response string
Résultat array $arrResponse

_hash() protected méthode

Generates a base64 encoded keyed hash.
protected _hash ( $data, $key ) : string
Résultat string $hmac

_initializeOptions() protected méthode

protected _initializeOptions ( )

_log() protected méthode

Writes $contents to a log file specified in the bp_options file or, if missing, defaults to a standard filename of 'bplog.txt'.
protected _log ( mixed $contents )
$contents mixed

_verifyAmount() protected méthode

protected _verifyAmount ( $aPosData, $fAmount )

_verifyNotification() protected méthode

Call from your notification handler to convert $_POST data to an object containing invoice data
protected _verifyNotification ( ) : mixed
Résultat mixed $json

_verifyPosData() protected méthode

Call from your notification handler to verify posData
protected _verifyPosData ( array $aPosData ) : boolean
$aPosData array
Résultat boolean

checkoutFinished() public méthode

public checkoutFinished ( )

createInvoice() public méthode

Creates BitPay invoice via Bitpay::curl.
public createInvoice ( $orderId, $price, $posData, $options = [] ) : array
Résultat array $response

finalizeCheckout() public méthode

public finalizeCheckout ( &$aData )

getCurrencyList() public méthode

Retrieves a list of all supported currencies and returns associative array.
public getCurrencyList ( ) : array
Résultat array $currencies

getInvoice() public méthode

Retrieves an invoice from BitPay. $options can include 'apiKey'
public getInvoice ( $invoiceId, $apiKey = false ) : mixed
Résultat mixed $json

getRate() public méthode

The default code us USD, so calling the function without a parameter will return the current BTC/USD price.
public getRate ( string $code = 'USD' ) : string
$code string
Résultat string $rate

initializeCheckout() public méthode

public initializeCheckout ( $iPendingId, $aCartInfo, $bRecurring = false, $iRecurringDays )