PHP Класс BxPmtBitPay, dolphin.pro

Наследование: extends BxPmtProvider
Показать файл Открыть проект

Открытые методы

Метод Описание
__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 )

Защищенные методы

Метод Описание
_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

Описание методов

__construct() публичный Метод

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

_curl() защищенный Метод

Handles post/get to BitPay via curl.
protected _curl ( $url, $apiKey, $post = false ) : mixed
Результат mixed $response

_decodeResponse() защищенный Метод

Decodes JSON response and returns associative array.
protected _decodeResponse ( string $response ) : array
$response string
Результат array $arrResponse

_hash() защищенный Метод

Generates a base64 encoded keyed hash.
protected _hash ( $data, $key ) : string
Результат string $hmac

_initializeOptions() защищенный Метод

protected _initializeOptions ( )

_log() защищенный Метод

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 _verifyAmount ( $aPosData, $fAmount )

_verifyNotification() защищенный Метод

Call from your notification handler to convert $_POST data to an object containing invoice data
protected _verifyNotification ( ) : mixed
Результат mixed $json

_verifyPosData() защищенный Метод

Call from your notification handler to verify posData
protected _verifyPosData ( array $aPosData ) : boolean
$aPosData array
Результат boolean

checkoutFinished() публичный Метод

public checkoutFinished ( )

createInvoice() публичный Метод

Creates BitPay invoice via Bitpay::curl.
public createInvoice ( $orderId, $price, $posData, $options = [] ) : array
Результат array $response

finalizeCheckout() публичный Метод

public finalizeCheckout ( &$aData )

getCurrencyList() публичный Метод

Retrieves a list of all supported currencies and returns associative array.
public getCurrencyList ( ) : array
Результат array $currencies

getInvoice() публичный Метод

Retrieves an invoice from BitPay. $options can include 'apiKey'
public getInvoice ( $invoiceId, $apiKey = false ) : mixed
Результат mixed $json

getRate() публичный Метод

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
Результат string $rate

initializeCheckout() публичный Метод

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