diff --git a/src/Entity.php b/src/Entity.php index 0176848e..90e98206 100644 --- a/src/Entity.php +++ b/src/Entity.php @@ -84,12 +84,12 @@ protected static function buildEntity($data) } else { - $entity = new static; + $entity = new self; } } else { - $entity = new static; + $entity = new self; } $entity->fill($data); diff --git a/tests/RazorpayTest.php b/tests/RazorpayTest.php index a29a2c20..e3bbc4a1 100644 --- a/tests/RazorpayTest.php +++ b/tests/RazorpayTest.php @@ -27,6 +27,10 @@ public function testPayments() $this->assertTrue(is_array($data->toArray())); $this->assertTrue(is_array($data['items'])); + + $payment = $data['items'][0]; + + $this->assertTrue(get_class($payment['notes']) === 'Razorpay\Api\Entity'); } public function testHeaders()