public function getCustomerList($count = null, $offset = null, $startDate = null, $endDate = null, $singleDay = false) { $customerUri = $this->_apiUrl->getCustomersApiUri(); $delimiter = '?'; $createdAt = 'created='; $startDateUnix = $startDate ? time($startDate) : null; $endDateUnix = $endDate ? time($endDate) : null; if ($count) { $customerUri = "{$customerUri}{$delimiter}count={$count}"; $delimiter = '&'; } if ($offset) { $customerUri = "{$customerUri}{$delimiter}offset={$offset}"; $delimiter = '&'; } if ($singleDay && $startDateUnix) { $customerUri = "{$customerUri}{$delimiter}{$createdAt}{$startDateUnix}|"; } else { if ($startDateUnix) { $customerUri = "{$customerUri}{$delimiter}{$createdAt}{$startDateUnix}"; $createdAt = '|'; } if ($endDateUnix) { $customerUri = "{$customerUri}{$createdAt}{$endDateUnix}"; } } $requestPayload = array('authorization' => $this->_apiSetting->getSecretKey(), 'mode' => $this->_apiSetting->getMode()); $processCharge = \com\checkout\helpers\ApiHttpClient::getRequest($customerUri, $this->_apiSetting->getSecretKey(), $requestPayload); $responseModel = new ResponseModels\CustomerList($processCharge); return $responseModel; }
public function getCartList($customerId) { $requestPayload = array('authorization' => $this->_apiSetting->getSecretKey(), 'mode' => $this->_apiSetting->getMode()); $getCardUri = sprintf($this->_apiUrl->getCardsApiUri(), $customerId); $processCharge = \com\checkout\helpers\ApiHttpClient::getRequest($getCardUri, $this->_apiSetting->getSecretKey(), $requestPayload); $responseModel = new ResponseModels\CardList($processCharge); return $responseModel; }
public function createPaymentToken(RequestModels\PaymentTokenCreate $requestModel) { $chargeMapper = new \com\checkout\ApiServices\Charges\ChargesMapper($requestModel); $requestPayload = array('authorization' => $this->_apiSetting->getSecretKey(), 'mode' => $this->_apiSetting->getMode(), 'postedParam' => $chargeMapper->requestPayloadConverter()); $processCharge = \com\checkout\helpers\ApiHttpClient::postRequest($this->_apiUrl->getPaymentTokensApiUri(), $this->_apiSetting->getSecretKey(), $requestPayload); $responseModel = new ResponseModels\PaymentToken($processCharge); return $responseModel; }
public function getCardProvider($id) { $requestPayload = array('authorization' => $this->_apiSetting->getPublicKey(), 'mode' => $this->_apiSetting->getMode()); $cardProviderByIdUri = $this->_apiUrl->getCardProvidersUri() . "/{$id}"; $processCharge = \com\checkout\helpers\ApiHttpClient::getRequest($cardProviderByIdUri, $this->_apiSetting->getPublicKey(), $requestPayload); $responseModel = new \com\checkout\ApiServices\PaymentProviders\ResponseModels\CardProvider($processCharge); return $responseModel; }
/** * retrieve a Charge With a ChargeId * @param RequestModels\ChargeRetrieve $requestModel * @return ResponseModels\Charge */ public function getCharge($chargeId) { $requestPayload = array('authorization' => $this->_apiSetting->getSecretKey(), 'mode' => $this->_apiSetting->getMode(), 'method' => 'GET'); $retrieveChargeWithChargeUri = sprintf($this->_apiUrl->getRetrieveChargesApiUri(), $chargeId); $processCharge = \com\checkout\helpers\ApiHttpClient::getRequest($retrieveChargeWithChargeUri, $this->_apiSetting->getSecretKey(), $requestPayload); $responseModel = new ResponseModels\Charge($processCharge); return $responseModel; }