Skip to content

Commit

Permalink
WooCommerce 3.0+ compatibility, ref #653
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Apr 19, 2017
1 parent e35375e commit 8b216d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions angelleye-includes/angelleye-utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ public function has_authorization_expired($order_id) {
$old_wc = version_compare(WC_VERSION, '3.0', '<');
$order = wc_get_order($order_id);
$transaction_time = $old_wc ? get_post_meta($order_id, '_trans_date', true) : get_post_meta($order->get_id(), '_trans_date', true);
return floor(( time() - $transaction_time ) / 3600) > 720;
return floor(( time() - strtotime($transaction_time) ) / 3600) > 720;
}

public function has_authorization_inside_honor_period($transaction_id) {
$transaction_post_is = $this->get_post_by_title($transaction_id);
$transaction_time = get_post_meta($transaction_post_is, '_trans_date', true);
return floor(( time() - $transaction_time ) / 3600) > 72;
return floor(( time() - strtotime($transaction_time) ) / 3600) > 72;
}

/**
Expand Down Expand Up @@ -944,7 +944,7 @@ public function angelleye_paypal_for_woocommerce_order_action_callback($post) {
</tr>
<tr>
<td><?php echo __('Total Capture:', 'paypal-for-woocommerce'); ?></td>
<td><?php echo get_woocommerce_currency_symbol() . $this->total_DoCapture; ?></td>
<td><?php echo $this->total_DoCapture .' '. get_woocommerce_currency_symbol() ?></td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -975,7 +975,7 @@ public function angelleye_paypal_for_woocommerce_order_action_callback($post) {
<tr>
<td><?php echo $post->post_title; ?></td>
<td><?php echo esc_attr(get_post_meta($post->ID, 'TIMESTAMP', true)); ?></th>
<td><?php echo get_woocommerce_currency_symbol() . esc_attr(get_post_meta($post->ID, 'AMT', true)); ?></td>
<td><?php echo esc_attr(get_post_meta($post->ID, 'AMT', true)) .' '. get_woocommerce_currency_symbol(); ?></td>
<?php $PENDINGREASON = esc_attr(get_post_meta($post->ID, 'PENDINGREASON', true)); ?>
<td <?php echo ($PENDINGREASON) ? sprintf('title="%s"', $PENDINGREASON) : ""; ?> ><?php echo esc_attr(get_post_meta($post->ID, 'PAYMENTSTATUS', true)); ?></td>
<td><?php echo esc_attr(get_post_meta($post->ID, 'payment_action', true)); ?> </td>
Expand Down

0 comments on commit 8b216d4

Please sign in to comment.