final public function format(DataControllerCallContext $callcontext, AbstractRequest $request, $datasetName, $columnName, $columnDataType = NULL) {
        if (!isset($columnDataType)) {
            $metamodel = data_controller_get_metamodel();

            // trying to detect data type for the value
            list($referencedDatasetName, $referencedColumnName) = ReferencePathHelper::splitReference($columnName);
            $selectedDatasetName = isset($referencedDatasetName) ? $referencedDatasetName : $datasetName;
            $selectedColumnName = isset($referencedColumnName) ? $referencedColumnName : $columnName;
            $dataset = $metamodel->getDataset($selectedDatasetName);

            $column = $dataset->findColumn($selectedColumnName);
            // could be formula
            if (!isset($column)) {
                $column = $request->findFormula($selectedColumnName);
            }

            $columnDataType = isset($column) ? $column->type->applicationType : NULL;

            // preparing column data type based on operator parameter data type
            if (!isset($columnDataType) && ($this->operatorHandler instanceof ParameterBasedOperatorHandler)) {
                $columnDataType = $this->operatorHandler->getParameterDataType();
            }
        }

        return $this->prepareExpression($callcontext, $request, $datasetName, $columnName, $columnDataType);
    }
コード例 #2
0
 public function getData()
 {
     $data = parent::getData();
     $this->validate('amount', 'currency');
     $data['sg_TransType'] = 'Auth';
     if ($this->getToken() and $this->getTransactionId()) {
         $data['sg_CCToken'] = $this->getToken();
         $data['sg_TransactionID'] = $this->getTransactionId();
         $data['sg_Rebill'] = 1;
         $this->validate('expMonth', 'expYear');
         $data['sg_ExpMonth'] = $this->getExpMonth();
         $data['sg_ExpYear'] = $this->getExpYear();
     } else {
         $this->validate('card');
         if ($this->getCard()->getName()) {
             $data['sg_NameOnCard'] = $this->getCard()->getName();
         }
         $data['sg_CardNumber'] = $this->getCard()->getNumber();
         $data['sg_ExpMonth'] = $this->getCard()->getExpiryDate('m');
         $data['sg_ExpYear'] = $this->getCard()->getExpiryDate('y');
         if ($this->getCard()->getCvv()) {
             $data['sg_CVV2'] = $this->getCard()->getCvv();
         }
     }
     $data['sg_Amount'] = $this->getAmount();
     $data['sg_Currency'] = $this->getCurrency();
     return array_merge($data, $this->getBillingData());
 }
コード例 #3
0
ファイル: RefundRequest.php プロジェクト: twg/omnipay-amex
 public function getData()
 {
     $this->validate('amount', 'transactionNo');
     $data = parent::getData();
     $data['vpc_TransactionNo'] = $this->getTransactionNo();
     return $data;
 }
コード例 #4
0
 /**
  * @return array
  */
 public function getData()
 {
     $data = parent::getData();
     $data['order_id'] = $this->getOrderID();
     $data['auto_capture'] = 1;
     return $data;
 }
コード例 #5
0
 /**
  * {@inheritDoc}
  */
 public function getData()
 {
     $this->validate('document');
     $data = array();
     $data['document'] = $this->getDocument();
     return array_merge(parent::getData(), $data);
 }
コード例 #6
0
 /**
  * @return mixed
  */
 public function getData()
 {
     $data = parent::getData();
     $data['option'] = 'ideal';
     $data['suboption'] = $this->getIssuer();
     return $data;
 }
コード例 #7
0
 /**
  * Get the data for this request.
  *
  * @return array request data
  */
 public function getData()
 {
     $data = parent::getData();
     $this->validate('utId');
     $data['UTID'] = $this->getUtid();
     return $data;
 }
コード例 #8
0
ファイル: SequenceRequest.php プロジェクト: ecs-hk/Checkbook
 public function __construct($datasourceName, $sequenceName, $quantity = 1)
 {
     parent::__construct();
     $this->datasourceName = $datasourceName;
     $this->sequenceName = $sequenceName;
     $this->quantity = $quantity;
 }
 /**
  * @return array|mixed
  */
 public function getData()
 {
     $data = parent::getData();
     $data['option'] = 'directdebit';
     $data['recurring'] = (int) $this->getRecurring();
     return $data;
 }
コード例 #10
0
 /**
  * @param string $issuerID
  * @param Merchant $merchant
  * @param Transaction $transaction
  */
 public function __construct($issuerID, Merchant $merchant, Transaction $transaction)
 {
     parent::__construct();
     $this->issuerID = $issuerID;
     $this->merchant = $merchant;
     $this->transaction = $transaction;
 }
コード例 #11
0
 public function getData()
 {
     $data = array("items" => array(array('title' => 'PurchaseTest', 'quantity' => 1, 'category_id' => 'tickets', 'currency_id' => 'BRL', 'unit_price' => 10.0)));
     $items = $this->getItemData();
     $external_reference = parent::getData();
     $purchaseObject = ['items' => $items, 'external_reference' => $external_reference];
     return $purchaseObject;
 }
コード例 #12
0
 public function getAmount()
 {
     // In test mode, a successful transaction is simulated by setting its amount to 1 EUR.
     if ($this->getTestMode()) {
         return '1.00';
     }
     return parent::getAmount();
 }
コード例 #13
0
 /**
  * {@inheritDoc}
  */
 public function getData()
 {
     /** @var \Argentum\Common\Document\Invoice|\Argentum\Common\Document\CreditNote $document */
     $document = $this->getDocument();
     $document->validate();
     $data = ['uuid' => $document->getId()];
     return array_merge(parent::getData(), $data);
 }
コード例 #14
0
 public function getData()
 {
     parent::getData();
     $this->validate('amount', 'transactionReference');
     $this->aim->trans_id = $this->getTransactionReference();
     $this->aim->card_num = $card->getNumber();
     $this->aim->exp_date = $card->getExpiryDate('my');
 }
コード例 #15
0
 /**
  * @param  array $parameters
  * @return self
  */
 public function initialize(array $parameters = array())
 {
     parent::initialize($parameters);
     if (null === $this->getRequestId()) {
         $this->setRequestId($this->generateRequestId());
     }
     return $this;
 }
コード例 #16
0
 public function hydrate(array $data = [])
 {
     parent::hydrate($data);
     if (isset($data['intervention_type'])) {
         $this->intervention_type = new \Bixev\InterventionSdk\Model\InterventionType();
         $this->intervention_type->hydrate($data['intervention_type']);
     }
 }
コード例 #17
0
ファイル: PurchaseRequest.php プロジェクト: omnipay/buckaroo
 public function getData()
 {
     $data = parent::getData();
     unset($data['Brq_payment_method']);
     unset($data['Brq_service_ideal_issuer']);
     unset($data['Brq_requestedservices']);
     return $data;
 }
コード例 #18
0
 public function getData()
 {
     parent::getData();
     $this->validate('amount', 'transactionReference');
     $this->validate('transactionReference');
     $this->aim->trans_id = $this->getTransactionReference();
     return $data;
 }
コード例 #19
0
 /**
  * SagePay throws an error if passed an IPv6 address.
  * Filter out addresses that are not IPv4 format.
  */
 public function getClientIp()
 {
     $ip = parent::getClientIp();
     // OmniPay core could do with a helper for this.
     if (!preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/', $ip)) {
         $ip = null;
     }
     return $ip;
 }
コード例 #20
0
 public function getData()
 {
     $data = parent::getData();
     $data['sg_TransType'] = 'Settle';
     $this->validate('authCode', 'transactionReference');
     $data['sg_AuthCode'] = $this->getAuthCode();
     $data['sg_TransactionID'] = $this->getTransactionReference();
     return $data;
 }
コード例 #21
0
 public function getData()
 {
     $data = parent::getData();
     $data['Brq_payment_method'] = 'ideal';
     if ($this->getIssuer()) {
         $data['Brq_service_ideal_issuer'] = $this->getIssuer();
     }
     return $data;
 }
コード例 #22
0
 /**
  * @param $url          string      The URL
  * @param $method       string      GET (default), POST, PUT, PATCH or DELETE
  * @param $urlVariables array       The value of the URL variables contained in the URL template
  * @param $messageBody  MessageBody The messageBody to send with the request
  * @param $headers      array       Optional headers
  */
 public function __construct($url, $method = 'GET', array $urlVariables = array(), MessageBody $messageBody = null, array $headers = array())
 {
     parent::__construct($method, $urlVariables, $messageBody, $headers);
     // Validate the URL
     $url = trim($url);
     if (!$url) {
         throw new \InvalidArgumentException('URL is empty.');
     }
     $this->url = $url;
 }
コード例 #23
0
 public function validate()
 {
     if (!empty($this->parameters['refs']) && is_array($this->parameters['refs'])) {
         $this->parameters['refs'] = implode(',', $this->parameters['refs']);
     }
     if (!empty($this->parameters['productids']) && is_array($this->parameters['productids'])) {
         $this->parameters['productids'] = implode(',', $this->parameters['productids']);
     }
     parent::validate();
 }
コード例 #24
0
 public function getData()
 {
     $data = parent::getData();
     $creditcardProviders = array('visa', 'mastercard', 'amex');
     if (in_array($this->getPaymentMethod(), $creditcardProviders)) {
         $data['Brq_payment_method'] = $this->getPaymentMethod();
     } else {
         $data['Brq_requestedservices'] = implode(",", $creditcardProviders);
     }
     return $data;
 }
 protected function getBaseData()
 {
     $data = parent::getBaseData();
     $data['CustomerReferenceNumber'] = $this->getCustomerReference();
     //if (false == ($data['Customer']['CustomerReferenceNumber'] = $this->getCardReference())) {
     //    $this->validate('card');
     //}
     if ($this->getCard()) {
         $data['Customer']['CardDetails'] = ['ExpiryMonth' => $this->getCard()->getExpiryDate('m'), 'ExpiryYear' => $this->getCard()->getExpiryDate('y'), 'Number' => $this->getCard()->getNumber(), 'Cvv' => $this->getCard()->getCvv()];
     }
     return $data;
 }
コード例 #26
0
 public function getData()
 {
     $data = parent::getData();
     $this->validate('card_num', 'cvv', 'exp_date', 'UserId', 'transactionId', 'amount');
     $data['x_card_num'] = $this->getCardNum();
     $data['x_card_code'] = $this->getCvv();
     $data['x_exp_date'] = $this->getExpDate();
     $data['x_unique_id'] = $this->getUserId();
     $data['x_invoice_num'] = $this->getTransactionId();
     $data['x_description'] = $this->getTransactionId();
     $data['x_amount'] = $this->getAmount();
     $data['x_type'] = "AUTH_CAPTURE";
     return $data;
 }
コード例 #27
0
 public function getData()
 {
     $data = parent::getData();
     $data['sg_TransType'] = 'Void';
     $this->validate('amount', 'currency', 'expMonth', 'expYear', 'token', 'authCode', 'transactionId');
     $data['sg_CCToken'] = $this->getToken();
     $data['sg_AuthCode'] = $this->getAuthCode();
     $data['sg_TransactionID'] = $this->getTransactionId();
     $data['sg_Amount'] = $this->getAmount();
     $data['sg_Currency'] = $this->getCurrency();
     $data['sg_ExpMonth'] = $this->getExpMonth();
     $data['sg_ExpYear'] = $this->getExpYear();
     return $data;
 }
コード例 #28
0
 /**
  * @return array
  */
 public function getData()
 {
     $data = parent::getData();
     $this->validate('transactionReference', 'currency', 'clientIp', 'card', 'items');
     $card = $this->getCard();
     $items = $this->getItems();
     $currency = $this->getCurrency();
     $data['customer_first_name'] = $card->getFirstName();
     $data['customer_last_name'] = $card->getLastName();
     $data['customer_address'] = $card->getAddress1();
     $data['customer_address2'] = $card->getAddress2();
     $data['customer_city'] = $card->getCity();
     $data['customer_country'] = $card->getCountry();
     $data['customer_postcode'] = $card->getPostcode();
     $data['customer_email'] = $card->getEmail();
     $data['customer_phone'] = $card->getPhone();
     $data['card_holder_name'] = $card->getName();
     $data['card_number'] = $card->getNumber();
     $data['exp_month'] = str_pad($card->getExpiryMonth(), 2, '0', STR_PAD_LEFT);
     $data['exp_year'] = substr($card->getExpiryYear(), 2);
     $data['cvv'] = $card->getCvv();
     $data['order_reference'] = $this->getTransactionReference();
     $data['order_currency'] = $currency;
     $data['payment_method'] = 'creditcard';
     $data['credit_card_trans_type'] = 'sale';
     $data['ip_address'] = $this->getClientIp();
     foreach ($items as $index => $item) {
         $i = $index + 1;
         $data["item_{$i}_predefined"] = '0';
         $data["item_{$i}_digital"] = '0';
         $data["item_{$i}_code"] = $item->getName();
         $data["item_{$i}_qty"] = $item->getQuantity();
         $data["item_{$i}_discount"] = $item->getPrice() < 0 ? '1' : '0';
         $data["item_{$i}_name"] = $item->getDescription();
         $data["item_{$i}_unit_price_{$currency}"] = $item->getPrice();
     }
     if ($this->getThreatmetrix()) {
         $data['thm_session_id'] = $this->getThreatmetrix()->getSessionId();
     }
     return $data;
 }
コード例 #29
0
 /**
  * @return array
  */
 public function getData()
 {
     $data = parent::getData();
     $this->validate('transactionReference', 'transactionId');
     $items = $this->getItems();
     if ($items) {
         $this->validate('requestData');
         foreach ($items as $index => $item) {
             $i = $index + 1;
             $data["item_{$i}_id"] = $this->getRequestDataItem($item->getName());
             $data["item_{$i}_amount"] = $item->getPrice();
         }
     } else {
         $this->validate('amount');
         $data['amount'] = $this->getAmount();
     }
     $data['reason'] = $this->getDescription();
     $data['order_id'] = $this->getTransactionId();
     $data['trans_id'] = $this->getTransactionReference();
     return $data;
 }
コード例 #30
0
 protected function getBaseData()
 {
     $data = parent::getBaseData();
     $data['TransactionType'] = $this->getTransactionType();
     if ($this->getCardReference()) {
         $data['Customer']['TokenCustomerID'] = $this->getCardReference();
     } else {
         $this->validate('card');
     }
     if ($this->getCard()) {
         $data['Customer']['CardDetails'] = array();
         $data['Customer']['CardDetails']['Name'] = $this->getCard()->getName();
         $data['Customer']['CardDetails']['ExpiryMonth'] = $this->getCard()->getExpiryDate('m');
         $data['Customer']['CardDetails']['ExpiryYear'] = $this->getCard()->getExpiryDate('y');
         $data['Customer']['CardDetails']['CVN'] = $this->getCard()->getCvv();
         if ($this->getEncryptedCardNumber()) {
             $data['Customer']['CardDetails']['Number'] = $this->getEncryptedCardNumber();
         } else {
             $data['Customer']['CardDetails']['Number'] = $this->getCard()->getNumber();
         }
         if ($this->getEncryptedCardCvv()) {
             $data['Customer']['CardDetails']['CVN'] = $this->getEncryptedCardCvv();
         } else {
             $data['Customer']['CardDetails']['CVN'] = $this->getCard()->getCvv();
         }
         if ($this->getCard()->getStartMonth() and $this->getCard()->getStartYear()) {
             $data['Customer']['CardDetails']['StartMonth'] = $this->getCard()->getStartDate('m');
             $data['Customer']['CardDetails']['StartYear'] = $this->getCard()->getStartDate('y');
         }
         if ($this->getCard()->getIssueNumber()) {
             $data['Customer']['CardDetails']['IssueNumber'] = $this->getCard()->getIssueNumber();
         }
     }
     if ($this->getItems()) {
         $data['Items'] = $this->getItemData();
     }
     return $data;
 }