Fixes #79 - Stores correct timestamps for invoices and IPNS

Bumped version to 2.1.4
This commit is contained in:
Alex Leitner and Sam Bohler 2015-06-04 11:42:37 -04:00 committed by Sam Bohler
parent 43ebfece71
commit bd45f405a5
8 changed files with 36 additions and 17 deletions

View File

@ -1,9 +1,13 @@
2.1.4
Removed Symfony dependency
Fixed timestamp logging in database
2.1.2
Added extra error handling and fixed debugging
Re-added new order email notifications
Updated README documentation for accuracy
Re-wrote delete.sh shell script to autodetect Magento directory and
be more helpful when cleaning an old BitPay plugin from the server
Added extra error handling and fixed debugging
Re-added new order email notifications
Updated README documentation for accuracy
Re-wrote delete.sh shell script to autodetect Magento directory and
be more helpful when cleaning an old BitPay plugin from the server
2.1.1
Bug fix sanitizing labels for token pairing

View File

@ -39,9 +39,9 @@ class Bitpay_Core_Model_Invoice extends Mage_Core_Model_Abstract
'price' => $invoice->getPrice(),
'currency' => $invoice->getCurrency()->getCode(),
'order_id' => $invoice->getOrderId(),
'invoice_time' => $invoice->getInvoiceTime(),
'expiration_time' => $invoice->getExpirationTime(),
'current_time' => $invoice->getCurrentTime(),
'invoice_time' => intval($invoice->getInvoiceTime() / 1000),
'expiration_time' => intval($invoice->getExpirationTime() / 1000),
'current_time' => intval($invoice->getCurrentTime() / 1000),
'btc_paid' => $invoice->getBtcPaid(),
'rate' => $invoice->getRate(),
'exception_status' => $invoice->getExceptionStatus(),

View File

@ -60,9 +60,9 @@ class Bitpay_Core_IpnController extends Mage_Core_Controller_Front_Action
'btc_price' => isset($ipn->btcPrice) ? $ipn->btcPrice : '',
'price' => isset($ipn->price) ? $ipn->price : '',
'currency' => isset($ipn->currency) ? $ipn->currency : '',
'invoice_time' => isset($ipn->invoiceTime) ? $ipn->invoiceTime : '',
'expiration_time' => isset($ipn->expirationTime) ? $ipn->expirationTime : '',
'current_time' => isset($ipn->currentTime) ? $ipn->currentTime : '',
'invoice_time' => isset($ipn->invoiceTime) ? intval($ipn->invoiceTime / 1000) : '',
'expiration_time' => isset($ipn->expirationTime) ? intval($ipn->expirationTime / 1000) : '',
'current_time' => isset($ipn->currentTime) ? intval($ipn->currentTime / 1000) : '',
'btc_paid' => isset($ipn->btcPaid) ? $ipn->btcPaid : '',
'rate' => isset($ipn->rate) ? $ipn->rate : '',
'exception_status' => isset($ipn->exceptionStatus) ? $ipn->exceptionStatus : '',
@ -103,7 +103,7 @@ class Bitpay_Core_IpnController extends Mage_Core_Controller_Front_Action
// Update the order to notifiy that it has been paid
if (true === in_array($invoice->getStatus(), array('paid', 'confirmed', 'complete'))) {
$payment = \Mage::getModel('sales/order_payment')->setOrder($order);
if (true === isset($payment) && false === empty($payment)) {
$payment->registerCaptureNotification($invoice->getPrice());
$order->addPayment($payment);

View File

@ -8,7 +8,7 @@
<config>
<modules>
<Bitpay_Core>
<version>2.0.1</version>
<version>2.1.4</version>
</Bitpay_Core>
</modules>

View File

@ -6,7 +6,7 @@
$this->startSetup();
/**
* IPN Log Table, used to keep track of incoiming IPNs
* IPN Log Table, used to keep track of incoming IPNs
*/
$this->run(sprintf('DROP TABLE IF EXISTS `%s`;', $this->getTable('bitpay/ipn')));
$ipnTable = new Varien_Db_Ddl_Table();
@ -20,7 +20,7 @@ $ipnTable->addColumn('price', Varien_Db_Ddl_Table::TYPE_DECIMAL, array(16, 8));
$ipnTable->addColumn('currency', Varien_Db_Ddl_Table::TYPE_TEXT, 10);
$ipnTable->addColumn('invoice_time', Varien_Db_Ddl_Table::TYPE_INTEGER, 11);
$ipnTable->addColumn('expiration_time', Varien_Db_Ddl_Table::TYPE_INTEGER, 11);
$ipnTable->addColumn('curent_time', Varien_Db_Ddl_Table::TYPE_INTEGER, 11);
$ipnTable->addColumn('current_time', Varien_Db_Ddl_Table::TYPE_INTEGER, 11);
$ipnTable->addColumn('pos_data', Varien_Db_Ddl_Table::TYPE_TEXT, 255);
$ipnTable->addColumn('btc_paid', Varien_Db_Ddl_Table::TYPE_DECIMAL, array(16, 8));
$ipnTable->addColumn('rate', Varien_Db_Ddl_Table::TYPE_DECIMAL, array(16, 8));

View File

@ -0,0 +1,16 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
*/
$this->startSetup();
/**
* IPN Log Table, used to keep track of incoming IPNs
*
* Fixes `curent_time` typo
*/
$ipnTable = new Varien_Db_Ddl_Table();
$this->getConnection()->changeColumn($this->getTable('bitpay/ipn'), 'curent_time', 'current_time', array('type' => Varien_Db_Ddl_Table::TYPE_INTEGER));
$this->endSetup();

1
modman
View File

@ -25,4 +25,3 @@ app/design/frontend/base/default/layout/bitpay.xml app/design/frontend/base/defa
app/design/frontend/base/default/template/bitpay app/design/frontend/base/default/template/bitpay
app/etc/modules/Bitpay_Core.xml app/etc/modules/Bitpay_Core.xml
lib/Bitpay lib/Bitpay
lib/Symfony lib/Symfony

View File

@ -11,7 +11,7 @@ date_default_timezone_set('America/New_York'); // Main Office is in Eastern Time
/**
* Various Configuration Settings
*/
$version = '2.1.2';
$version = '2.1.4';
$vendorDir = __DIR__ . '/../vendor';
$distDir = __DIR__ . '/../build/dist';
$tmpDistDir = $distDir . '/tmp'; // Files will be placed here temporarly so we can zip/tar them.