/**
* (non-PHPdoc)
*
* @see \Omnipay\Common\Message\MessageInterface::getData()
*/
public function getData()
{
// PaymentMethod independant checks
$this->validate('transactionReference', 'currency', 'siteId', 'amount', 'description', 'returnUrl', 'notifyUrl', 'ipaddress');
// PaymentMethod specific checks
$this->validatePaymentMethodSpecific();
// Transaction data
$data = array('ref' => $this->getTransactionReference(), 'currency' => $this->getCurrency(), 'site_id' => $this->getSiteId(), 'amount' => $this->getAmountInteger(), 'description' => $this->getDescription(), 'control_url' => $this->getNotifyUrl(), 'return_url' => $this->getReturnUrl(), 'return_url_failed' => $this->getCancelUrl(), 'ip_address' => $this->getIpAddress(), 'language' => $this->getLanguage());
if ($this->getPaymentMethod() == 'ideal') {
$data['issuer_id'] = $this->getIssuer();
}
// Customer data
$customerData = new CreditCard($_POST);
if ($customerData && strlen($customerData->getFirstName()) && strlen($customerData->getLastName())) {
$data['customer'] = array('first_name' => $customerData->getFirstName(), 'last_name' => $customerData->getLastName(), 'company_name' => $customerData->getCompany(), 'address' => $customerData->getAddress1(), 'city' => $customerData->getCity(), 'state' => $customerData->getState(), 'postal_code' => $customerData->getPostcode(), 'country_code' => $customerData->getCountry(), 'phone_number' => $customerData->getPhone(), 'email' => $customerData->getEmail());
}
return $data;
}