From dd2448bf41dbea357326bac56347dbb48a879d96 Mon Sep 17 00:00:00 2001 From: Patric Poba Date: Fri, 17 Jan 2020 13:12:23 +0000 Subject: [PATCH] Use $this->payer as Array not object Use $this->payer as Array because its not an object. Steps to reproduce Error: 1. Get a transation using (new Collection)->getTransaction($token) 2. Call the jsonSerialize() method on the results. It will produce the error: ErrorException with message 'Trying to get property 'partyIdType' of non-object' --- lib/models/RequestToPay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/RequestToPay.php b/lib/models/RequestToPay.php index b676f14..169f8f8 100644 --- a/lib/models/RequestToPay.php +++ b/lib/models/RequestToPay.php @@ -35,7 +35,7 @@ public function __construct($payer, $payeeNote, $payerMessage, $externalId, $cur public function jsonSerialize() { $data = array( - 'payer' => array($this->payer->partyIdType, $this->payer->partyId), + 'payer' => array($this->payer['partyIdType'], $this->payer['partyId']), 'payeeNote' => $this->payeeNote, 'payerMessage' => $this->payerMessage, 'externalId' => $this->externalId,