Get the card data.

Because the stripe gateway uses a common format for passing
card data to the API, this function can be called to get the
data from the associated card object in the format that the
API requires.

@return array
193677
protected function getCardData()
    {
        $card = $this->getCard();
        $card->validate();

        $data = array();
        $data['object'] = 'card';
        $data['number'] = $card->getNumber();
        $data['exp_month'] = $card->getExpiryMonth();
        $data['exp_year'] = $card->getExpiryYear();
        if ($card->getCvv()) {
            $data['cvc'] = $card->getCvv();
        }
        $data['name'] = $card->getName();
        $data['address_line1'] = $card->getAddress1();
        $data['address_line2'] = $card->getAddress2();
        $data['address_city'] = $card->getCity();
        $data['address_zip'] = $card->getPostcode();
        $data['address_state'] = $card->getState();
        $data['address_country'] = $card->getCountry();
        $data['email'] = $card->getEmail();

        return $data;
    }
978946
public function getData()
    {
        $this->validate(
            'amount',
            'card',
            'transactionId',
            'clientIp',
            'productId'
        );

        $card = $this->getCard();

        $card->validate();

        $data = [
            'opcode'      => 0,
            'product_id'  => $this->getProductId(),
            'amount'      => $this->getAmount(),
            'cf'          => $this->getTransactionId(),
            'ip_address'  => $this->getClientIp(),
            'pan'         => $card->getNumber(),
            'cardholder'  => $card->getName(),
            'exp_month'   => $card->getExpiryMonth(),
            'exp_year'    => $card->getExpiryYear(),
            'cvv'         => $card->getCvv(),
            'pp_identity' => 'card',
            'token'       => $this->getRequestToken(),
        ];

        if ($this->getPhone()) {
            $data['phone'] = $this->getPhone();
        }
        if ($this->getCf2()) {
            $data['cf2'] = $this->getCf2();
        }
        if ($this->getCf3()) {
            $data['cf3'] = $this->getCf3();
        }
        if ($this->getCallbackUrl()) {
            $data['cb_url'] = $this->getCallbackUrl();
        }

        return $data;
    }
454033
public function getData()
    {
        $this->validate('accountNumber', 'privateKey', 'token', 'amount', 'transactionId');

        $data = array();
        $data['sellerId'] = $this->getAccountNumber();
        $data['privateKey'] = $this->getPrivateKey();
        $data['merchantOrderId'] = $this->getTransactionId();
        $data['token'] = $this->getToken();
        $data['currency'] = $this->getCurrency();
        $data['total'] = $this->getAmount();

        if ($this->getCard()) {
            $data['billingAddr']['name'] = $this->getCard()->getName();
            $data['billingAddr']['addrLine1'] = $this->getCard()->getAddress1();
            $data['billingAddr']['addrLine2'] = $this->getCard()->getAddress2();
            $data['billingAddr']['city'] = $this->getCard()->getCity();
            $data['billingAddr']['state'] = $this->getCard()->getState();
            $data['billingAddr']['zipCode'] = $this->getCard()->getPostcode();
            $data['billingAddr']['email'] = $this->getCard()->getEmail();
            $data['billingAddr']['country'] = $this->getCard()->getCountry();
            $data['billingAddr']['phoneNumber'] = $this->getCard()->getPhone();
            $data['billingAddr']['phoneExt'] = $this->getCard()->getPhoneExtension();
        }

        if ($this->getCart()) {
            // remove amount parameter if lineItem attributes / cart is set
            unset($data['total']);

            $data['lineItems'] = $this->getCart();
        }

        // remove null values item from $data['billingAddr']
        $data['billingAddr'] = array_filter($data['billingAddr'], array($this, 'isNotNull'));

        // remove null values item from $data.
        $data = array_filter($data, array($this, 'isNotNull'));

        return $data;
    }
601964
protected function getPaymentTransactionStructure()
    {
        return [
            'amount'              => $this->transformAmount($this->amount, $this->currency),
            'currency'            => $this->currency,
            'customer_email'      => $this->customer_email,
            'customer_phone'      => $this->customer_phone,
            'return_success_url'  => $this->return_success_url,
            'return_failure_url'  => $this->return_failure_url,
            'bank_code'           => $this->bank_code,
            'bank_name'           => $this->bank_name,
            'bank_branch'         => $this->bank_branch,
            'bank_account_name'   => $this->bank_account_name,
            'bank_account_number' => $this->bank_account_number,
            'billing_address'     => $this->getBillingAddressParamsStructure(),
            'shipping_address'    => $this->getShippingAddressParamsStructure()
        ];
    }
470582
protected function getPaymentTransactionStructure()
    {
        return [
            'amount'           => $this->transformAmount($this->amount, $this->currency),
            'currency'         => $this->currency,
            'iban'             => $this->iban,
            'bic'              => $this->bic,
            'customer_email'   => $this->customer_email,
            'customer_phone'   => $this->customer_phone,
            'billing_address'  => $this->getBillingAddressParamsStructure(),
            'shipping_address' => $this->getShippingAddressParamsStructure()
        ];
    }
30028
protected function fetchData()
	{
		if(($sort=$this->getSort())!==false && ($order=$sort->getOrderBy())!='')
			$this->sortData($this->getSortDirections($order));

		if(($pagination=$this->getPagination())!==false)
		{
			$pagination->setItemCount($this->getTotalItemCount());
			return array_slice($this->rawData, $pagination->getOffset(), $pagination->getLimit());
		}
		else
			return $this->rawData;
	}
25824
public function getData() : array
    {
        $data = [];
        $request = $this->getRequest();
        $method = $request->getMethod();

        switch ($method) {

            //GET
            case Request::METHOD_GET:
                $data = $_GET ?: [];
            break;

            //POST
            case Request::METHOD_POST:
                $data = $_POST ?: [];
            break;

            //Other supported
            case Request::METHOD_DELETE:
            case Request::METHOD_PUT:
            case Request::METHOD_PATCH:
                parse_str($request->getRequestBody(), $data);
            break;

        }

        return $data;
    }
130409
protected function getPaymentTransactionStructure()
    {
        return [
            'payment_type'       => $this->payment_type,
            'amount'             => $this->transformAmount($this->amount, $this->currency),
            'currency'           => $this->currency,
            'return_success_url' => $this->return_success_url,
            'return_failure_url' => $this->return_failure_url,
            'customer_email'     => $this->customer_email,
            'customer_phone'     => $this->customer_phone,
            'account_number'     => $this->account_number,
            'bank_code'          => $this->bank_code,
            'bic'                => $this->bic,
            'iban'               => $this->iban,
            'account_phone'      => $this->account_phone,
            'billing_address'    => $this->getBillingAddressParamsStructure(),
            'shipping_address'   => $this->getShippingAddressParamsStructure()
        ];
    }
905587
public function getData()
    {
        $data = $this->getBaseAuthorizeData();

        if ($this->getToken() || $this->getCardReference()) {
            // If using a token, then set that data.
            $data = $this->getTokenData($data);
        } else {
            // Otherwise, a credit card has to have been provided.
            $data = $this->getCardData($data);
        }

        // A CVV may be supplied whether using a token or credit card details.
        // On *first* use of a token for which a CVV was provided, that CVV will
        // be used when making a transaction. The CVV will then be deleted by the
        // gateway. For each *resuse* of a cardReference, a new CVV must be provided,
        // if the security rules require it.

        if ($this->getCard()->getCvv() !== null) {
            $data['CV2'] = $this->getCard()->getCvv();
        }

        return $data;
    }
954444
public function getStorableData()
    {
        return [
            'id' => 'Transaction',
            'flat' => [
                'Total' => \Heystack\Ecommerce\convertMoneyToString($this->total),
                'Status' => $this->status,
                'Currency' => $this->currencyService->getActiveCurrencyCode()
            ],
            'related' => []
        ];

    }
647458
protected function getCustomerData()
    {
        $card = $this->getCard();
        $data = array();

        $data['customer']['name'] = $card->getName();
        $data['customer']['email'] = $card->getEmail();
        $data['customer']['sex'] = $card->getGender();
        $data['customer']['born_at'] = $card->getBirthday('m-d-Y');
        $data['customer']['document_number'] = $card->getHolderDocumentNumber();

        $arrayAddress = $this->extractAddress($card->getAddress1());
        if ( ! empty($arrayAddress['street']) ) {
            $data['customer']['address'] = $arrayAddress;
            $data['customer']['address']['zipcode'] = $card->getPostcode();
            if ( $card->getAddress2() ) {
                $data['customer']['address']['neighborhood'] = $card->getAddress2();
            }

            $data['customer']['address']['city']    = $card->getCity();
            $data['customer']['address']['state']   = $card->getState();
            $data['customer']['address']['country'] = $card->getCountry();
        }

        $arrayPhone = $this->extractDddPhone($card->getPhone());
        if ( ! empty($arrayPhone['ddd']) ) {
            $data['customer']['phone'] = $arrayPhone;
        }

        return $data;
    }
944803
protected function getPaymentTransactionStructure()
    {
        return [
            'amount'             => $this->transformAmount($this->amount, $this->currency),
            'currency'           => $this->currency,
            'bank_code'          => $this->bank_code,
            'return_success_url' => $this->return_success_url,
            'return_failure_url' => $this->return_failure_url,
            'customer_email'     => $this->customer_email,
            'customer_phone'     => $this->customer_phone,
            'payment_type'       => $this->payment_type,
            'document_id'        => $this->document_id,
            'billing_address'    => $this->getBillingAddressParamsStructure(),
            'shipping_address'   => $this->getShippingAddressParamsStructure()
        ];
    }
881730
public function getCardData($data = array())
    {
        // Validate the card details (number, date, cardholder name).
        $this->getCard()->validate();

        if ($this->getCardholderName()) {
            $data['CardHolder'] = $this->getCardholderName();
        } else {
            $data['CardHolder'] = $this->getCard()->getName();
        }

        // Card number should not be provided if token is being provided instead
        if (! $this->getToken()) {
            $data['CardNumber'] = $this->getCard()->getNumber();
        }

        $data['ExpiryDate'] = $this->getCard()->getExpiryDate('my');
        $data['CardType'] = $this->getCardBrand();

        if ($this->getCard()->getStartMonth() and $this->getCard()->getStartYear()) {
            $data['StartDate'] = $this->getCard()->getStartDate('my');
        }

        if ($this->getCard()->getIssueNumber()) {
            $data['IssueNumber'] = $this->getCard()->getIssueNumber();
        }

        // If we want the card details to be saved on the gateway as a
        // token or card reference, then request for that to be done.

        $createCard = $this->getCreateToken() ?: $this->getCreateCard();

        if ($createCard !== null) {
            $data['CreateToken'] = $createCard ? static::CREATE_TOKEN_YES : static::CREATE_TOKEN_NO;
        }

        if ($this->getCard()->getCvv() !== null) {
            $data['CV2'] = $this->getCard()->getCvv();
        }

        return $data;
    }
79895
public function getData()
    {
        $this->validateParams();

        $data = [
            'service'        => $this->service,
            'partner'        => $this->getPartner(),
            'trade_no'       => $this->getTradeNo(),
            'out_trade_no'   => $this->getOutTradeNo(),
            '_input_charset' => $this->getInputCharset(),
            'sign_type'      => $this->getSignType()
        ];
        $data['sign'] = $this->sign($data, $this->getSignType());
        
        return $data;
    }
85209
protected function getPaymentTransactionStructure()
    {
        return [
            'reference_id' => $this->reference_id,
            'amount'       => $this->transformAmount($this->amount, $this->currency),
            'currency'     => $this->currency
        ];
    }
1316792
private function loadDashboardCards()
	{
		// Fetch all the dashboard cards for the current user
		$model = UserMetadata::model()->getPrototype('UserMetadata', array(
		             'user_id' => $this->user->id,
		             'key' => 'dashboard_cards'
		         ), array('value' => '{}'));

		$model->value = CJSON::decode($model->value);

		return $model;
	}
1023875
protected function getPaymentData()
    {
        $data = array(
            'cancel_url'   => $this->getCancelUrl(),
            'close_window' => $this->getCloseWindow(),
            'notification_url' => $this->getNotifyUrl(),
            'redirect_url'   => $this->getReturnUrl(),
        );

        return array_filter($data);
    }