コード例 #1
0
 /**
  * @see PayerEntity::toArray()
  */
 public function testToArray()
 {
     $entity = array('fullName' => 'person name ' . rand(1, 9) . rand(1, 9) . rand(1, 9), 'emailAddress' => 'email' . rand(1, 9) . rand(1, 9) . rand(1, 9) . '@foo-bar.com', 'contactPhone' => rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9), 'billingAddress' => new BillingAddressEntity());
     $this->object->setFullName($entity['fullName'])->setEmailAddress($entity['emailAddress'])->setContactPhone($entity['contactPhone'])->setBillingAddress($entity['billingAddress']);
     $this->assertEquals($entity['fullName'], $this->object->getFullName());
     $this->assertEquals($entity['emailAddress'], $this->object->getEmailAddress());
     $this->assertEquals($entity['contactPhone'], $this->object->getContactPhone());
     $this->assertEquals($entity['billingAddress'], $this->object->getBillingAddress());
 }
コード例 #2
0
 /**
  * Generate arry order.
  * @return array
  */
 public function toArray()
 {
     return array('expiration' => $this->expiration, 'type' => $this->type, 'paymentMethod' => $this->paymentMethod, 'paymentCountry' => $this->paymentCountry, 'ipAddress' => $this->ipAddress, 'cookie' => $this->cookie, 'userAgent' => $this->userAgent, 'order' => $this->order->toArray(), 'creditCard' => $this->creditCard->toArray(), 'payer' => $this->payer->toArray(), 'extraParameters' => $this->extraParameters->toArray());
 }
コード例 #3
0
 /**
  * @see TransactionEntity::setPayer()
  */
 public function testSetPayer()
 {
     $payerEntity = new PayerEntity();
     $fullName = 'person name ' . rand(1, 9) . rand(1, 9) . rand(1, 9);
     $payerEntity->setFullName($fullName);
     $emailAddress = 'email' . rand(1, 9) . rand(1, 9) . rand(1, 9) . '@foo-bar.com';
     $payerEntity->setEmailAddress($emailAddress);
     $rs = $this->object->setPayer($payerEntity);
     $this->assertInstanceOf('\\PayU\\Entity\\Transaction\\TransactionEntity', $rs);
     $rs = $this->object->getPayer();
     $this->assertInstanceOf('\\PayU\\Entity\\Transaction\\PayerEntity', $rs);
     $this->assertEquals($fullName, $rs->getFullName());
     $this->assertEquals($emailAddress, $rs->getEmailAddress());
 }