/**
  * @see ExtraParametersEntity::toArray()
  */
 public function testToArray()
 {
     $installmentsNumber = rand(1, 10);
     $installmentsType = rand(1, 3);
     $securityCodeIndicator = rand(0, 2);
     $responseUrl = 'https://response-url-' . rand(1, 1000) . '.com';
     $this->object->setInstallmentsNumber($installmentsNumber)->setInstallmentsType($installmentsType)->setSecurityCodeIndicator($securityCodeIndicator)->setResponseUrl($responseUrl);
     $rs = $this->object->toArray();
     $this->assertInternalType('array', $rs);
     $this->assertEquals($installmentsNumber, $rs[ExtraParametersEntity::INSTALLMENTS_NUMBER]);
     $this->assertEquals($installmentsType, $rs[ExtraParametersEntity::INSTALLMENTS_TYPE]);
     $this->assertEquals($securityCodeIndicator, $rs[ExtraParametersEntity::SECURITY_CODE_INDICATOR]);
     $this->assertEquals($responseUrl, $rs[ExtraParametersEntity::RESPONSE_URL]);
 }
Ejemplo n.º 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());
 }
Ejemplo n.º 3
0
 /**
  * @see TransactionEntity::setExtraParameters()
  */
 public function testSetExtraParameters()
 {
     $extraParametersEntity = new ExtraParametersEntity();
     $installmentsNumber = rand(1, 10);
     $extraParametersEntity->setInstallmentsNumber($installmentsNumber);
     $installmentsType = rand(1, 3);
     $extraParametersEntity->setInstallmentsType($installmentsType);
     $securityCodeIndicator = rand(0, 2);
     $extraParametersEntity->setSecurityCodeIndicator($securityCodeIndicator);
     $responseUrl = 'https://response-url-' . rand(1, 1000) . '.com';
     $extraParametersEntity->setResponseUrl($responseUrl);
     $rs = $this->object->setExtraParameters($extraParametersEntity);
     $this->assertInstanceOf('\\PayU\\Entity\\Transaction\\TransactionEntity', $rs);
     $rs = $this->object->getExtraParameters();
     $this->assertInstanceOf('\\PayU\\Entity\\Transaction\\ExtraParametersEntity', $rs);
     $this->assertEquals($installmentsNumber, $rs->getInstallmentsNumber());
     $this->assertEquals($installmentsType, $rs->getInstallmentsType());
     $this->assertEquals($securityCodeIndicator, $rs->getSecurityCodeIndicator());
     $this->assertEquals($responseUrl, $rs->getResponseUrl());
 }