public function testRetrievingCorrectDataByToArrayFunction() { $billing = new BillingInformation($this->getCustomer(), $this->getAddress(), '*****@*****.**', '192.168.0.1'); $arr = $billing->toArray(); $this->assertEquals('Mr', $arr['name']['title']); $this->assertEquals('test', $arr['name']['first']); $this->assertEquals('test', $arr['name']['last']); $this->assertEquals('Al qouz', $arr['address']['line1']); $this->assertEquals('Golden Daemond Park', $arr['address']['line2']); $this->assertEquals('Building 3', $arr['address']['line3']); $this->assertEquals('Dubai', $arr['address']['city']); $this->assertEquals('region', $arr['address']['region']); $this->assertEquals('UAE', $arr['address']['country']); $this->assertEquals('*****@*****.**', $arr['email']); }
/** * Adds the value of billing information to the body * * @param \Namshi\Innovate\Payment\BillingInformation $card */ protected function addBilling(BillingInformation $card) { $this->xmlBody['billing'] = $card->toArray(); }