public function getData() { $data = parent::getData(); $transactionId = $this->getTransactionId(); $transactionReference = $this->getTransactionReference(); if (empty($transactionId) && empty($transactionReference)) { throw new InvalidRequestException('The \'transactionId\' or \'transactionReference\' parameter is required.'); } $data['Tid'] = $transactionId; $data['Reference'] = $transactionReference; return $data; }
public function getData() { $data = parent::getData(); $this->validate('amount', 'currency', 'customerId', 'transactionId', 'token', 'clientIp'); if ($this->getCurrency() !== 'EUR') { throw new InvalidRequestException('The \'currency\' parameter must be \'EUR\'.'); } $data['Amount'] = $this->getAmountInteger(); $data['Uid'] = $this->getCustomerId(); $data['Tid'] = $this->getTransactionId(); $data['ClientIp'] = $this->getClientIp(); $data['Description'] = $this->getDescription(); $data['Alias'] = $this->getToken(); $data['OriginalAmount'] = $this->getOriginalAmount(); $data['OriginalCurrency'] = $this->getOriginalCurrency(); return $data; }
public function getData() { $data = parent::getData(); $this->validate('amount', 'currency', 'customerId', 'transactionId', 'card', 'clientIp'); if ($this->getCurrency() !== 'EUR') { throw new InvalidRequestException('The \'currency\' parameter must be \'EUR\'.'); } $card = $this->getCard(); $card->validate(); $cardCvv = $card->getCvv(); if (empty($cardCvv)) { throw new InvalidRequestException('The card \'cvv\' parameter is required.'); } $cardShippingFirstName = $card->getShippingFirstName(); if (empty($cardShippingFirstName)) { throw new InvalidRequestException('The card \'shippingFirstName\' parameter is required.'); } $cardShippingLastName = $card->getShippingLastName(); if (empty($cardShippingLastName)) { throw new InvalidRequestException('The card \'shippingLastName\' parameter is required.'); } $data['Amount'] = $this->getAmountInteger(); $data['Uid'] = $this->getCustomerId(); $data['Tid'] = $this->getTransactionId(); $data['Email'] = $card->getEmail(); $data['Firstname'] = $cardShippingFirstName; $data['Lastname'] = $cardShippingLastName; $data['CardNumber'] = $card->getNumber(); $data['CardMonth'] = sprintf('%02d', $card->getExpiryMonth()); $data['CardYear'] = $card->getExpiryYear(); $data['CardCVV'] = $cardCvv; $data['CardType'] = strtolower($this->getCardType() ?: $card->getBrand()); $data['CardOwner'] = $card->getName(); $data['ClientIp'] = $this->getClientIp(); $data['Description'] = $this->getDescription(); $data['Address'] = trim($card->getAddress1() . ' ' . $card->getAddress2()); $data['ZipCode'] = $card->getPostcode(); $data['City'] = $card->getCity(); $data['Country'] = $card->getCountry(); $data['Phone'] = $card->getPhone(); $data['BirthDate'] = $card->getBirthday(); $data['BirthPlace'] = $this->getCustomerBirthPlace(); $data['OriginalAmount'] = $this->getOriginalAmount(); $data['OriginalCurrency'] = $this->getOriginalCurrency(); $data['ReturnUrl'] = $this->getReturnUrl(); $data['3DS'] = $this->get3DSecure() ? 'yes' : 'no'; return $data; }