public function __construct($response, Environment $environment) { parent::__construct($response, $environment); $this->collection = new Collection(self::$allowedValues, $this->getResponse()); $responseArray = $this->getResponse(); if (!empty($responseArray)) { $this->recurringPaymentsProfile = RecurringPaymentsProfile::getResponse($responseArray); $this->shippingAddress = ShippingAddress::getResponse($responseArray); $this->billingPeriod = BillingPeriod::getResponse($responseArray); $this->recurringPaymentsSummary = RecurringPaymentsSummary::getResponse($responseArray); $this->creditCard = CreditCard::getResponse($responseArray); $this->payer = Payer::getResponse($responseArray); $this->address = Address::getResponse($responseArray); } }
public function getNVPRequest() { $request = $this->collection->getAllValues(); $request = array_merge($request, $this->creditCard->getNVPArray()); $request = array_merge($request, $this->payer->getNVPArray()); $request = array_merge($request, $this->address->getNVPArray()); foreach ($this->payment->getNVPArray() as $key => $value) { if (is_array($value)) { foreach ($value as $itemIndex => $item) { foreach ($item as $k => $v) { $request['L_' . $k . $itemIndex] = $v; } } } else { $request[$key] = $value; } } if ($this->secure3d != null) { $request = array_merge($request, $this->secure3d->getNVPArray()); } return $request; }