/** * @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]); }
/** * 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()); }