PHP 클래스 BxPmtBitPay, dolphin.pro

상속: extends BxPmtProvider
파일 보기 프로젝트 열기: boonex/dolphin.pro

공개 메소드들

메소드 설명
__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 )