* @copyright Peter Fox 2014 * * @package payum-bitpay */ require_once __DIR__ . '/../vendor/autoload.php'; use Payum\Core\Registry\SimpleRegistry; use Payum\Core\Payment; use Symm\BitpayClient\BitpayClient; use PayumBitPay\BitPayCaptureAction as CaptureAction; use PayumBitPay\BitPayStatusAction as StatusAction; use PayumBitPay\BitPayNotificationAction as NotifyAction; use PayumBitPay\Model\Transaction; date_default_timezone_set('UTC'); // Read in the BitPay api key defined in the project root in .bitpay.key $key = file_get_contents(__DIR__ . '/../.bitpay.key'); $bitPayClient = BitpayClient::createClient($key); class TestStorage extends \Payum\Core\Storage\AbstractStorage { /** * @param Transaction $model * * @return void */ protected function doUpdateModel($model) { echo "Invoice {$model->getResponse()->getId()} has been stored\n"; } /** * @param object $model * * @return void
private function getClient() { $client = BitpayClient::createClient($this->apiKey); return $client; }