From 2dc93d359e1badbeadc470bc2c53f6794594c868 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 1 Aug 2016 10:18:36 +0200 Subject: Braintree status history --- classes/Payment.php | 13 +++++++++++++ include/offers-view.php | 13 ++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/classes/Payment.php b/classes/Payment.php index d37bcc9..939ce13 100644 --- a/classes/Payment.php +++ b/classes/Payment.php @@ -77,6 +77,19 @@ class Payment extends Model { $trans = Braintree_Transaction::find($this->braintree_id); $this->braintree_status = $trans->status; + return $this->braintree_status; + } + + /** + * Get Braintree status history + */ + public function getBraintreeStatusHistory() { + if (is_null($this->braintree_id)) { + return []; + } + + $trans = Braintree_Transaction::find($this->braintree_id); + return $trans->statusHistory; } /** diff --git a/include/offers-view.php b/include/offers-view.php index 323fc31..5dee452 100644 --- a/include/offers-view.php +++ b/include/offers-view.php @@ -126,9 +126,16 @@ $_offer = new Offer($_pdo, $_id); $payments = [$payment]; foreach ($payments as $payment) { echo "