id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1 value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
43,900 | OXID-eSales/paypal | Model/OrderPaymentStatusCalculator.php | OrderPaymentStatusCalculator.getStatusByAction | protected function getStatusByAction($action)
{
$status = null;
switch ($action) {
case 'void':
$status = $this->getSuggestStatusOnVoid();
break;
case 'refund_partial':
case 'reauthorize':
$status = $this->getOrder()->getPaymentStatus();
break;
case 'refund':
case 'capture':
case 'capture_partial':
$status = 'completed';
break;
default:
$status = 'completed';
}
return $status;
} | php | protected function getStatusByAction($action)
{
$status = null;
switch ($action) {
case 'void':
$status = $this->getSuggestStatusOnVoid();
break;
case 'refund_partial':
case 'reauthorize':
$status = $this->getOrder()->getPaymentStatus();
break;
case 'refund':
case 'capture':
case 'capture_partial':
$status = 'completed';
break;
default:
$status = 'completed';
}
return $status;
} | [
"protected",
"function",
"getStatusByAction",
"(",
"$",
"action",
")",
"{",
"$",
"status",
"=",
"null",
";",
"switch",
"(",
"$",
"action",
")",
"{",
"case",
"'void'",
":",
"$",
"status",
"=",
"$",
"this",
"->",
"getSuggestStatusOnVoid",
"(",
")",
";",
... | Returns order suggestion for payment status on given action.
@param string $action performed action.
@return string | [
"Returns",
"order",
"suggestion",
"for",
"payment",
"status",
"on",
"given",
"action",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderPaymentStatusCalculator.php#L211-L232 |
43,901 | OXID-eSales/paypal | Controller/Admin/DeliverySetMain.php | DeliverySetMain.render | public function render()
{
$template = parent::render();
$deliverySetId = $this->getEditObjectId();
if ($deliverySetId != "-1" && isset($deliverySetId)) {
/** @var \OxidEsales\PayPalModule\Core\Config $config */
$config = oxNew(\OxidEsales\PayPalModule\Core\Config::class);
$isPayPalDefaultMobilePayment = ($deliverySetId == $config->getMobileECDefaultShippingId());
$this->_aViewData['isPayPalDefaultMobilePayment'] = $isPayPalDefaultMobilePayment;
}
return $template;
} | php | public function render()
{
$template = parent::render();
$deliverySetId = $this->getEditObjectId();
if ($deliverySetId != "-1" && isset($deliverySetId)) {
/** @var \OxidEsales\PayPalModule\Core\Config $config */
$config = oxNew(\OxidEsales\PayPalModule\Core\Config::class);
$isPayPalDefaultMobilePayment = ($deliverySetId == $config->getMobileECDefaultShippingId());
$this->_aViewData['isPayPalDefaultMobilePayment'] = $isPayPalDefaultMobilePayment;
}
return $template;
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"template",
"=",
"parent",
"::",
"render",
"(",
")",
";",
"$",
"deliverySetId",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"if",
"(",
"$",
"deliverySetId",
"!=",
"\"-1\"",
"&&",
"isset"... | Add default PayPal mobile payment.
@return string | [
"Add",
"default",
"PayPal",
"mobile",
"payment",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Admin/DeliverySetMain.php#L36-L51 |
43,902 | OXID-eSales/paypal | Controller/Admin/DeliverySetMain.php | DeliverySetMain.save | public function save()
{
parent::save();
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
/** @var \OxidEsales\PayPalModule\Core\Config $payPalConfig */
$payPalConfig = oxNew(\OxidEsales\PayPalModule\Core\Config::class);
$deliverySetId = $this->getEditObjectId();
$deliverySetMarked = (bool) $config->getRequestParameter('isPayPalDefaultMobilePayment');
$mobileECDefaultShippingId = $payPalConfig->getMobileECDefaultShippingId();
if ($deliverySetMarked && $deliverySetId != $mobileECDefaultShippingId) {
$this->saveECDefaultShippingId($config, $deliverySetId, $payPalConfig);
} elseif (!$deliverySetMarked && $deliverySetId == $mobileECDefaultShippingId) {
$this->saveECDefaultShippingId($config, '', $payPalConfig);
}
} | php | public function save()
{
parent::save();
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
/** @var \OxidEsales\PayPalModule\Core\Config $payPalConfig */
$payPalConfig = oxNew(\OxidEsales\PayPalModule\Core\Config::class);
$deliverySetId = $this->getEditObjectId();
$deliverySetMarked = (bool) $config->getRequestParameter('isPayPalDefaultMobilePayment');
$mobileECDefaultShippingId = $payPalConfig->getMobileECDefaultShippingId();
if ($deliverySetMarked && $deliverySetId != $mobileECDefaultShippingId) {
$this->saveECDefaultShippingId($config, $deliverySetId, $payPalConfig);
} elseif (!$deliverySetMarked && $deliverySetId == $mobileECDefaultShippingId) {
$this->saveECDefaultShippingId($config, '', $payPalConfig);
}
} | [
"public",
"function",
"save",
"(",
")",
"{",
"parent",
"::",
"save",
"(",
")",
";",
"$",
"config",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"/** @var \\OxidEsales\\PayPalModule\\Core\\Config $pay... | Saves default PayPal mobile payment. | [
"Saves",
"default",
"PayPal",
"mobile",
"payment",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Admin/DeliverySetMain.php#L56-L73 |
43,903 | OXID-eSales/paypal | Controller/Admin/DeliverySetMain.php | DeliverySetMain.saveECDefaultShippingId | protected function saveECDefaultShippingId($config, $shippingId, $payPalConfig)
{
$payPalModuleId = 'module:' . $payPalConfig->getModuleId();
$config->saveShopConfVar('string', 'sOEPayPalMECDefaultShippingId', $shippingId, null, $payPalModuleId);
} | php | protected function saveECDefaultShippingId($config, $shippingId, $payPalConfig)
{
$payPalModuleId = 'module:' . $payPalConfig->getModuleId();
$config->saveShopConfVar('string', 'sOEPayPalMECDefaultShippingId', $shippingId, null, $payPalModuleId);
} | [
"protected",
"function",
"saveECDefaultShippingId",
"(",
"$",
"config",
",",
"$",
"shippingId",
",",
"$",
"payPalConfig",
")",
"{",
"$",
"payPalModuleId",
"=",
"'module:'",
".",
"$",
"payPalConfig",
"->",
"getModuleId",
"(",
")",
";",
"$",
"config",
"->",
"s... | Save default shipping id.
@param \OxidEsales\Eshop\Core\Config $config Config object to save.
@param string $shippingId Shipping id.
@param \OxidEsales\PayPalModule\Core\Config $payPalConfig PayPal config. | [
"Save",
"default",
"shipping",
"id",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Admin/DeliverySetMain.php#L82-L86 |
43,904 | OXID-eSales/paypal | Model/Action/Handler/OrderRefundActionHandler.php | OrderRefundActionHandler.getPayPalRequest | public function getPayPalRequest()
{
if (is_null($this->payPalRequest)) {
$requestBuilder = $this->getPayPalRequestBuilder();
$data = $this->getData();
$requestBuilder->setTransactionId($data->getTransactionId());
$requestBuilder->setAmount($data->getAmount(), $data->getCurrency());
$requestBuilder->setRefundType($data->getType());
$requestBuilder->setComment($data->getComment());
$this->payPalRequest = $requestBuilder->getRequest();
}
return $this->payPalRequest;
} | php | public function getPayPalRequest()
{
if (is_null($this->payPalRequest)) {
$requestBuilder = $this->getPayPalRequestBuilder();
$data = $this->getData();
$requestBuilder->setTransactionId($data->getTransactionId());
$requestBuilder->setAmount($data->getAmount(), $data->getCurrency());
$requestBuilder->setRefundType($data->getType());
$requestBuilder->setComment($data->getComment());
$this->payPalRequest = $requestBuilder->getRequest();
}
return $this->payPalRequest;
} | [
"public",
"function",
"getPayPalRequest",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"payPalRequest",
")",
")",
"{",
"$",
"requestBuilder",
"=",
"$",
"this",
"->",
"getPayPalRequestBuilder",
"(",
")",
";",
"$",
"data",
"=",
"$",
"this",... | Returns PayPal request; initiates if not set
@return \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest | [
"Returns",
"PayPal",
"request",
";",
"initiates",
"if",
"not",
"set"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/Handler/OrderRefundActionHandler.php#L54-L70 |
43,905 | OXID-eSales/paypal | Controller/StandardDispatcher.php | StandardDispatcher.getTransactionMode | protected function getTransactionMode($basket)
{
$transactionMode = $this->getPayPalConfig()->getTransactionMode();
if ($transactionMode == "Automatic") {
$outOfStockValidator = new \OxidEsales\PayPalModule\Model\OutOfStockValidator();
$outOfStockValidator->setBasket($basket);
$outOfStockValidator->setEmptyStockLevel($this->getPayPalConfig()->getEmptyStockLevel());
$transactionMode = ($outOfStockValidator->hasOutOfStockArticles()) ? "Authorization" : "Sale";
return $transactionMode;
}
return $transactionMode;
} | php | protected function getTransactionMode($basket)
{
$transactionMode = $this->getPayPalConfig()->getTransactionMode();
if ($transactionMode == "Automatic") {
$outOfStockValidator = new \OxidEsales\PayPalModule\Model\OutOfStockValidator();
$outOfStockValidator->setBasket($basket);
$outOfStockValidator->setEmptyStockLevel($this->getPayPalConfig()->getEmptyStockLevel());
$transactionMode = ($outOfStockValidator->hasOutOfStockArticles()) ? "Authorization" : "Sale";
return $transactionMode;
}
return $transactionMode;
} | [
"protected",
"function",
"getTransactionMode",
"(",
"$",
"basket",
")",
"{",
"$",
"transactionMode",
"=",
"$",
"this",
"->",
"getPayPalConfig",
"(",
")",
"->",
"getTransactionMode",
"(",
")",
";",
"if",
"(",
"$",
"transactionMode",
"==",
"\"Automatic\"",
")",
... | Returns transaction mode.
@param \OxidEsales\Eshop\Application\Model\Basket $basket
@return string | [
"Returns",
"transaction",
"mode",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/StandardDispatcher.php#L102-L117 |
43,906 | OXID-eSales/paypal | Controller/StandardDispatcher.php | StandardDispatcher.getReturnUrl | protected function getReturnUrl()
{
$controllerKey = \OxidEsales\Eshop\Core\Registry::getControllerClassNameResolver()->getIdByClassName(get_class());
return $this->getSession()->processUrl($this->getBaseUrl() . "&cl=" . $controllerKey . "&fnc=getExpressCheckoutDetails");
} | php | protected function getReturnUrl()
{
$controllerKey = \OxidEsales\Eshop\Core\Registry::getControllerClassNameResolver()->getIdByClassName(get_class());
return $this->getSession()->processUrl($this->getBaseUrl() . "&cl=" . $controllerKey . "&fnc=getExpressCheckoutDetails");
} | [
"protected",
"function",
"getReturnUrl",
"(",
")",
"{",
"$",
"controllerKey",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getControllerClassNameResolver",
"(",
")",
"->",
"getIdByClassName",
"(",
"get_class",
"(",
")",
")",
"... | Returns RETURN URL
@return string | [
"Returns",
"RETURN",
"URL"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/StandardDispatcher.php#L164-L168 |
43,907 | OXID-eSales/paypal | Core/ShopLogo.php | ShopLogo.getResize | protected function getResize()
{
$resize = false;
$imagePath = $this->getImagePath();
if ($imagePath) {
$imageSize = $this->getImageSize($imagePath);
if ($imageSize['width'] > $this->getWidth() ||
$imageSize['height'] > $this->getHeight()
) {
$resize = true;
}
}
return $resize;
} | php | protected function getResize()
{
$resize = false;
$imagePath = $this->getImagePath();
if ($imagePath) {
$imageSize = $this->getImageSize($imagePath);
if ($imageSize['width'] > $this->getWidth() ||
$imageSize['height'] > $this->getHeight()
) {
$resize = true;
}
}
return $resize;
} | [
"protected",
"function",
"getResize",
"(",
")",
"{",
"$",
"resize",
"=",
"false",
";",
"$",
"imagePath",
"=",
"$",
"this",
"->",
"getImagePath",
"(",
")",
";",
"if",
"(",
"$",
"imagePath",
")",
"{",
"$",
"imageSize",
"=",
"$",
"this",
"->",
"getImage... | Calculates if logo should be resized.
@return bool | [
"Calculates",
"if",
"logo",
"should",
"be",
"resized",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ShopLogo.php#L150-L165 |
43,908 | OXID-eSales/paypal | Core/ShopLogo.php | ShopLogo.getResizedImageName | protected function getResizedImageName()
{
$resizedImageName = "";
if ($this->getImageName()) {
$resizedImageName = $this->_suffix . $this->getImageName();
}
return $resizedImageName;
} | php | protected function getResizedImageName()
{
$resizedImageName = "";
if ($this->getImageName()) {
$resizedImageName = $this->_suffix . $this->getImageName();
}
return $resizedImageName;
} | [
"protected",
"function",
"getResizedImageName",
"(",
")",
"{",
"$",
"resizedImageName",
"=",
"\"\"",
";",
"if",
"(",
"$",
"this",
"->",
"getImageName",
"(",
")",
")",
"{",
"$",
"resizedImageName",
"=",
"$",
"this",
"->",
"_suffix",
".",
"$",
"this",
"->"... | Gives new name for image to be resized.
@return string | [
"Gives",
"new",
"name",
"for",
"image",
"to",
"be",
"resized",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ShopLogo.php#L232-L240 |
43,909 | OXID-eSales/paypal | Core/ShopLogo.php | ShopLogo.getShopLogoUrl | public function getShopLogoUrl()
{
$imagePath = $this->getImageUrl();
$resizedImagePath = $this->getResizedImageUrl();
if ($this->getResize()) {
$shopLogoPath = $resizedImagePath;
if (!$this->fileExists($resizedImagePath)) {
if (!$this->resizeImage()) {
// fallback to original image if can not be resized
$shopLogoPath = $imagePath;
}
}
} else {
$shopLogoPath = $imagePath;
}
return $shopLogoPath;
} | php | public function getShopLogoUrl()
{
$imagePath = $this->getImageUrl();
$resizedImagePath = $this->getResizedImageUrl();
if ($this->getResize()) {
$shopLogoPath = $resizedImagePath;
if (!$this->fileExists($resizedImagePath)) {
if (!$this->resizeImage()) {
// fallback to original image if can not be resized
$shopLogoPath = $imagePath;
}
}
} else {
$shopLogoPath = $imagePath;
}
return $shopLogoPath;
} | [
"public",
"function",
"getShopLogoUrl",
"(",
")",
"{",
"$",
"imagePath",
"=",
"$",
"this",
"->",
"getImageUrl",
"(",
")",
";",
"$",
"resizedImagePath",
"=",
"$",
"this",
"->",
"getResizedImageUrl",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getResize"... | Get logo image path for PayPal express checkout.
@return string | [
"Get",
"logo",
"image",
"path",
"for",
"PayPal",
"express",
"checkout",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ShopLogo.php#L316-L335 |
43,910 | OXID-eSales/paypal | Core/ShopLogo.php | ShopLogo.resizeImage | protected function resizeImage()
{
$resized = false;
if ($utilsPic = $this->getImageHandler()) {
// checks if image can be resized, and resizes the image
if ($utilsPic->resizeImage($this->getImagePath(), $this->getResizedImagePath(), $this->getWidth(), $this->getHeight())) {
$resized = true;
}
}
return $resized;
} | php | protected function resizeImage()
{
$resized = false;
if ($utilsPic = $this->getImageHandler()) {
// checks if image can be resized, and resizes the image
if ($utilsPic->resizeImage($this->getImagePath(), $this->getResizedImagePath(), $this->getWidth(), $this->getHeight())) {
$resized = true;
}
}
return $resized;
} | [
"protected",
"function",
"resizeImage",
"(",
")",
"{",
"$",
"resized",
"=",
"false",
";",
"if",
"(",
"$",
"utilsPic",
"=",
"$",
"this",
"->",
"getImageHandler",
"(",
")",
")",
"{",
"// checks if image can be resized, and resizes the image",
"if",
"(",
"$",
"ut... | Resizes logo if needed to the size provided
Returns false when image does'nt exist, or can't be resized
Returns original image name when image is within boundaries
Returns resized image name when image is too large than defined
@return bool | [
"Resizes",
"logo",
"if",
"needed",
"to",
"the",
"size",
"provided",
"Returns",
"false",
"when",
"image",
"does",
"nt",
"exist",
"or",
"can",
"t",
"be",
"resized",
"Returns",
"original",
"image",
"name",
"when",
"image",
"is",
"within",
"boundaries",
"Returns... | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ShopLogo.php#L374-L386 |
43,911 | OXID-eSales/paypal | Controller/OrderController.php | OrderController.getOrder | protected function getOrder()
{
$order = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
$order->load($this->getSession()->getVariable('sess_challenge'));
return $order;
} | php | protected function getOrder()
{
$order = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
$order->load($this->getSession()->getVariable('sess_challenge'));
return $order;
} | [
"protected",
"function",
"getOrder",
"(",
")",
"{",
"$",
"order",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Order",
"::",
"class",
")",
";",
"$",
"order",
"->",
"load",
"(",
"$",
"this",
"->",
"g... | Returns current order object
@return \OxidEsales\Eshop\Application\Model\Order | [
"Returns",
"current",
"order",
"object"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/OrderController.php#L92-L98 |
43,912 | OXID-eSales/paypal | Controller/OrderController.php | OrderController.getNextStep | protected function getNextStep($success)
{
$nextStep = parent::_getNextStep($success);
// Detecting PayPal & loading order & execute payment only if go wrong
if ($this->isPayPal() && ($success == \OxidEsales\Eshop\Application\Model\Order::ORDER_STATE_PAYMENTERROR)) {
$payPalType = (int) $this->getSession()->getVariable("oepaypal");
$nextStep = ($payPalType == 2) ? "basket" : "order";
}
return $nextStep;
} | php | protected function getNextStep($success)
{
$nextStep = parent::_getNextStep($success);
// Detecting PayPal & loading order & execute payment only if go wrong
if ($this->isPayPal() && ($success == \OxidEsales\Eshop\Application\Model\Order::ORDER_STATE_PAYMENTERROR)) {
$payPalType = (int) $this->getSession()->getVariable("oepaypal");
$nextStep = ($payPalType == 2) ? "basket" : "order";
}
return $nextStep;
} | [
"protected",
"function",
"getNextStep",
"(",
"$",
"success",
")",
"{",
"$",
"nextStep",
"=",
"parent",
"::",
"_getNextStep",
"(",
"$",
"success",
")",
";",
"// Detecting PayPal & loading order & execute payment only if go wrong",
"if",
"(",
"$",
"this",
"->",
"isPay... | Checks if order payment is PayPal and redirects to payment processing part.
@param int $success order state
@return string | [
"Checks",
"if",
"order",
"payment",
"is",
"PayPal",
"and",
"redirects",
"to",
"payment",
"processing",
"part",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/OrderController.php#L107-L118 |
43,913 | OXID-eSales/paypal | Core/Curl.php | Curl.getHeader | public function getHeader()
{
if (is_null($this->header)) {
$host = $this->getHost();
$header = array();
$header[] = 'POST /cgi-bin/webscr HTTP/1.1';
$header[] = 'Content-Type: application/x-www-form-urlencoded';
if (isset($host)) {
$header[] = 'Host: ' . $host;
}
$header[] = 'Connection: close';
$this->setHeader($header);
}
return $this->header;
} | php | public function getHeader()
{
if (is_null($this->header)) {
$host = $this->getHost();
$header = array();
$header[] = 'POST /cgi-bin/webscr HTTP/1.1';
$header[] = 'Content-Type: application/x-www-form-urlencoded';
if (isset($host)) {
$header[] = 'Host: ' . $host;
}
$header[] = 'Connection: close';
$this->setHeader($header);
}
return $this->header;
} | [
"public",
"function",
"getHeader",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"header",
")",
")",
"{",
"$",
"host",
"=",
"$",
"this",
"->",
"getHost",
"(",
")",
";",
"$",
"header",
"=",
"array",
"(",
")",
";",
"$",
"header",
"... | Forms header from host.
@return array | [
"Forms",
"header",
"from",
"host",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Curl.php#L140-L157 |
43,914 | OXID-eSales/paypal | Core/Curl.php | Curl.setUrlToCall | public function setUrlToCall($urlToCall)
{
if (false === filter_var($urlToCall, FILTER_VALIDATE_URL)) {
/**
* @var \OxidEsales\PayPalModule\Core\Exception\PayPalException $exception
*/
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalException::class, 'URL to call is not valid.');
throw $exception;
}
$this->urlToCall = $urlToCall;
} | php | public function setUrlToCall($urlToCall)
{
if (false === filter_var($urlToCall, FILTER_VALIDATE_URL)) {
/**
* @var \OxidEsales\PayPalModule\Core\Exception\PayPalException $exception
*/
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalException::class, 'URL to call is not valid.');
throw $exception;
}
$this->urlToCall = $urlToCall;
} | [
"public",
"function",
"setUrlToCall",
"(",
"$",
"urlToCall",
")",
"{",
"if",
"(",
"false",
"===",
"filter_var",
"(",
"$",
"urlToCall",
",",
"FILTER_VALIDATE_URL",
")",
")",
"{",
"/**\n * @var \\OxidEsales\\PayPalModule\\Core\\Exception\\PayPalException $exceptio... | Set PayPal URL to call.
@param string $urlToCall PayPal URL to call.
@throws \OxidEsales\PayPalModule\Core\Exception\PayPalException if url is not valid | [
"Set",
"PayPal",
"URL",
"to",
"call",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Curl.php#L275-L285 |
43,915 | OXID-eSales/paypal | Core/Curl.php | Curl.setOptions | protected function setOptions()
{
foreach ($this->getEnvironmentParameters() as $name => $value) {
$this->setOption(constant($name), $value);
}
$this->setOption(CURLOPT_HTTPHEADER, $this->getHeader());
$this->setOption(CURLOPT_URL, $this->getUrlToCall());
$this->setOption(CURLOPT_POSTFIELDS, $this->getQuery());
} | php | protected function setOptions()
{
foreach ($this->getEnvironmentParameters() as $name => $value) {
$this->setOption(constant($name), $value);
}
$this->setOption(CURLOPT_HTTPHEADER, $this->getHeader());
$this->setOption(CURLOPT_URL, $this->getUrlToCall());
$this->setOption(CURLOPT_POSTFIELDS, $this->getQuery());
} | [
"protected",
"function",
"setOptions",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getEnvironmentParameters",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"setOption",
"(",
"constant",
"(",
"$",
"name",
")",
",",... | Set Curl Parameters. | [
"Set",
"Curl",
"Parameters",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Curl.php#L340-L349 |
43,916 | OXID-eSales/paypal | Core/Curl.php | Curl.curlExecute | protected function curlExecute()
{
$response = curl_exec($this->getResource());
$curlErrorNumber = $this->getErrorNumber();
if ($curlErrorNumber) {
/**
* @var \OxidEsales\PayPalModule\Core\Exception\PayPalException $exception
*/
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalException::class, 'Curl error: ' . $curlErrorNumber);
throw $exception;
}
return $response;
} | php | protected function curlExecute()
{
$response = curl_exec($this->getResource());
$curlErrorNumber = $this->getErrorNumber();
if ($curlErrorNumber) {
/**
* @var \OxidEsales\PayPalModule\Core\Exception\PayPalException $exception
*/
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalException::class, 'Curl error: ' . $curlErrorNumber);
throw $exception;
}
return $response;
} | [
"protected",
"function",
"curlExecute",
"(",
")",
"{",
"$",
"response",
"=",
"curl_exec",
"(",
"$",
"this",
"->",
"getResource",
"(",
")",
")",
";",
"$",
"curlErrorNumber",
"=",
"$",
"this",
"->",
"getErrorNumber",
"(",
")",
";",
"if",
"(",
"$",
"curlE... | Wrapper function to be mocked for testing.
@return string
@throws \OxidEsales\PayPalModule\Core\Exception\PayPalException on curl errors | [
"Wrapper",
"function",
"to",
"be",
"mocked",
"for",
"testing",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Curl.php#L369-L383 |
43,917 | OXID-eSales/paypal | Core/Curl.php | Curl.parseResponse | protected function parseResponse($response)
{
$result = [];
// processing results
parse_str($response, $result);
// stripping slashes
$result = array_map(array($this, 'decode'), $result);
return $result;
} | php | protected function parseResponse($response)
{
$result = [];
// processing results
parse_str($response, $result);
// stripping slashes
$result = array_map(array($this, 'decode'), $result);
return $result;
} | [
"protected",
"function",
"parseResponse",
"(",
"$",
"response",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"// processing results",
"parse_str",
"(",
"$",
"response",
",",
"$",
"result",
")",
";",
"// stripping slashes",
"$",
"result",
"=",
"array_map",
"(... | Parse curl response and strip it to safe form.
@param string $response curl response.
@return array | [
"Parse",
"curl",
"response",
"and",
"strip",
"it",
"to",
"safe",
"form",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Curl.php#L400-L411 |
43,918 | OXID-eSales/paypal | Core/Logger.php | Logger.log | public function log($logData)
{
$handle = fopen($this->getLogFilePath(), "a+");
if ($handle !== false) {
if (is_string($logData)) {
parse_str($logData, $result);
} else {
$result = $logData;
}
if (is_array($result)) {
foreach ($result as $key => $value) {
if (is_string($value)) {
$result[$key] = urldecode($value);
}
}
}
fwrite($handle, "======================= " . $this->getTitle() . " [" . date("Y-m-d H:i:s") . "] ======================= #\n\n");
fwrite($handle, "SESS ID: " . $this->getLoggerSessionId() . "\n");
fwrite($handle, trim(var_export($result, true)) . "\n\n");
fclose($handle);
}
//resetting log title
$this->setTitle('');
} | php | public function log($logData)
{
$handle = fopen($this->getLogFilePath(), "a+");
if ($handle !== false) {
if (is_string($logData)) {
parse_str($logData, $result);
} else {
$result = $logData;
}
if (is_array($result)) {
foreach ($result as $key => $value) {
if (is_string($value)) {
$result[$key] = urldecode($value);
}
}
}
fwrite($handle, "======================= " . $this->getTitle() . " [" . date("Y-m-d H:i:s") . "] ======================= #\n\n");
fwrite($handle, "SESS ID: " . $this->getLoggerSessionId() . "\n");
fwrite($handle, trim(var_export($result, true)) . "\n\n");
fclose($handle);
}
//resetting log title
$this->setTitle('');
} | [
"public",
"function",
"log",
"(",
"$",
"logData",
")",
"{",
"$",
"handle",
"=",
"fopen",
"(",
"$",
"this",
"->",
"getLogFilePath",
"(",
")",
",",
"\"a+\"",
")",
";",
"if",
"(",
"$",
"handle",
"!==",
"false",
")",
"{",
"if",
"(",
"is_string",
"(",
... | Writes log message.
@param mixed $logData logger data | [
"Writes",
"log",
"message",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Logger.php#L98-L124 |
43,919 | OXID-eSales/paypal | Core/PayPalCheckValidator.php | PayPalCheckValidator.isPayPalCheckValid | public function isPayPalCheckValid()
{
$newBasketAmount = $this->getNewBasketAmount();
$prevBasketAmount = $this->getOldBasketAmount();
// check only if new price is different and bigger than old price
if ($newBasketAmount > $prevBasketAmount) {
return false;
}
return true;
} | php | public function isPayPalCheckValid()
{
$newBasketAmount = $this->getNewBasketAmount();
$prevBasketAmount = $this->getOldBasketAmount();
// check only if new price is different and bigger than old price
if ($newBasketAmount > $prevBasketAmount) {
return false;
}
return true;
} | [
"public",
"function",
"isPayPalCheckValid",
"(",
")",
"{",
"$",
"newBasketAmount",
"=",
"$",
"this",
"->",
"getNewBasketAmount",
"(",
")",
";",
"$",
"prevBasketAmount",
"=",
"$",
"this",
"->",
"getOldBasketAmount",
"(",
")",
";",
"// check only if new price is dif... | Returns if order should be rechecked by PayPal
@return bool | [
"Returns",
"if",
"order",
"should",
"be",
"rechecked",
"by",
"PayPal"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalCheckValidator.php#L49-L59 |
43,920 | OXID-eSales/paypal | Controller/PaymentController.php | PaymentController.isConfirmedByPayPal | public function isConfirmedByPayPal($basket)
{
$oldBasketAmount = $this->getSession()->getVariable("oepaypal-basketAmount");
if (!$oldBasketAmount) {
return false;
}
$payPalCheckValidator = oxNew(\OxidEsales\PayPalModule\Core\PayPalCheckValidator::class);
$payPalCheckValidator->setNewBasketAmount($basket->getPrice()->getBruttoPrice());
$payPalCheckValidator->setOldBasketAmount($oldBasketAmount);
return $payPalCheckValidator->isPayPalCheckValid();
} | php | public function isConfirmedByPayPal($basket)
{
$oldBasketAmount = $this->getSession()->getVariable("oepaypal-basketAmount");
if (!$oldBasketAmount) {
return false;
}
$payPalCheckValidator = oxNew(\OxidEsales\PayPalModule\Core\PayPalCheckValidator::class);
$payPalCheckValidator->setNewBasketAmount($basket->getPrice()->getBruttoPrice());
$payPalCheckValidator->setOldBasketAmount($oldBasketAmount);
return $payPalCheckValidator->isPayPalCheckValid();
} | [
"public",
"function",
"isConfirmedByPayPal",
"(",
"$",
"basket",
")",
"{",
"$",
"oldBasketAmount",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getVariable",
"(",
"\"oepaypal-basketAmount\"",
")",
";",
"if",
"(",
"!",
"$",
"oldBasketAmount",
")",
"... | Detects if current payment was already successfully processed by PayPal
@param \OxidEsales\Eshop\Application\Model\Basket $basket basket object
@return bool | [
"Detects",
"if",
"current",
"payment",
"was",
"already",
"successfully",
"processed",
"by",
"PayPal"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/PaymentController.php#L59-L71 |
43,921 | OXID-eSales/paypal | Core/Model.php | Model.delete | public function delete($id = null)
{
if (!is_null($id)) {
$this->setId($id);
}
return $this->getDbGateway()->delete($this->getId());
} | php | public function delete($id = null)
{
if (!is_null($id)) {
$this->setId($id);
}
return $this->getDbGateway()->delete($this->getId());
} | [
"public",
"function",
"delete",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"setId",
"(",
"$",
"id",
")",
";",
"}",
"return",
"$",
"this",
"->",
"getDbGateway",
"(",
")",
... | Delete model data from db.
@param string $id model id
@return bool | [
"Delete",
"model",
"data",
"from",
"db",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Model.php#L133-L140 |
43,922 | OXID-eSales/paypal | Core/Model.php | Model.load | public function load($id = null)
{
if (!is_null($id)) {
$this->setId($id);
}
$this->isLoaded = false;
$data = $this->getDbGateway()->load($this->getId());
if ($data) {
$this->setData($data);
$this->isLoaded = true;
}
return $this->isLoaded();
} | php | public function load($id = null)
{
if (!is_null($id)) {
$this->setId($id);
}
$this->isLoaded = false;
$data = $this->getDbGateway()->load($this->getId());
if ($data) {
$this->setData($data);
$this->isLoaded = true;
}
return $this->isLoaded();
} | [
"public",
"function",
"load",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"setId",
"(",
"$",
"id",
")",
";",
"}",
"$",
"this",
"->",
"isLoaded",
"=",
"false",
";",
"$",
... | Method for loading model, if loaded returns true.
@param string $id model id
@return bool | [
"Method",
"for",
"loading",
"model",
"if",
"loaded",
"returns",
"true",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Model.php#L149-L163 |
43,923 | OXID-eSales/paypal | Model/OrderManager.php | OrderManager.getOrder | public function getOrder()
{
if ($this->order === null) {
$orderPayment = $this->getOrderPayment();
$order = $this->getOrderFromPayment($orderPayment);
$this->setOrder($order);
}
return $this->order;
} | php | public function getOrder()
{
if ($this->order === null) {
$orderPayment = $this->getOrderPayment();
$order = $this->getOrderFromPayment($orderPayment);
$this->setOrder($order);
}
return $this->order;
} | [
"public",
"function",
"getOrder",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"order",
"===",
"null",
")",
"{",
"$",
"orderPayment",
"=",
"$",
"this",
"->",
"getOrderPayment",
"(",
")",
";",
"$",
"order",
"=",
"$",
"this",
"->",
"getOrderFromPayment",... | Create object \OxidEsales\PayPalModule\Model\PayPalOrder.
If Order is not set, create order from Order Payment.
@return \OxidEsales\PayPalModule\Model\PayPalOrder | [
"Create",
"object",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"PayPalOrder",
".",
"If",
"Order",
"is",
"not",
"set",
"create",
"order",
"from",
"Order",
"Payment",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderManager.php#L85-L94 |
43,924 | OXID-eSales/paypal | Model/OrderManager.php | OrderManager.getOrderPaymentStatusCalculator | public function getOrderPaymentStatusCalculator()
{
if (is_null($this->orderPaymentStatusCalculator)) {
$orderPaymentStatusCalculator = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator::class);
$this->setOrderPaymentStatusCalculator($orderPaymentStatusCalculator);
}
return $this->orderPaymentStatusCalculator;
} | php | public function getOrderPaymentStatusCalculator()
{
if (is_null($this->orderPaymentStatusCalculator)) {
$orderPaymentStatusCalculator = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator::class);
$this->setOrderPaymentStatusCalculator($orderPaymentStatusCalculator);
}
return $this->orderPaymentStatusCalculator;
} | [
"public",
"function",
"getOrderPaymentStatusCalculator",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"orderPaymentStatusCalculator",
")",
")",
"{",
"$",
"orderPaymentStatusCalculator",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"... | Returns \OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator.
@return \OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator | [
"Returns",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"OrderPaymentStatusCalculator",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderManager.php#L111-L119 |
43,925 | OXID-eSales/paypal | Model/OrderManager.php | OrderManager.getOrderPaymentListCalculator | public function getOrderPaymentListCalculator()
{
if (is_null($this->orderPaymentListCalculator)) {
$orderPaymentListCalculator = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentListCalculator::class);
$this->setOrderPaymentListCalculator($orderPaymentListCalculator);
}
return $this->orderPaymentListCalculator;
} | php | public function getOrderPaymentListCalculator()
{
if (is_null($this->orderPaymentListCalculator)) {
$orderPaymentListCalculator = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentListCalculator::class);
$this->setOrderPaymentListCalculator($orderPaymentListCalculator);
}
return $this->orderPaymentListCalculator;
} | [
"public",
"function",
"getOrderPaymentListCalculator",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"orderPaymentListCalculator",
")",
")",
"{",
"$",
"orderPaymentListCalculator",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
... | Returns \OxidEsales\PayPalModule\Model\OrderPaymentListCalculator.
@return \OxidEsales\PayPalModule\Model\OrderPaymentListCalculator | [
"Returns",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"OrderPaymentListCalculator",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderManager.php#L136-L144 |
43,926 | OXID-eSales/paypal | Model/OrderManager.php | OrderManager.updateOrderStatus | public function updateOrderStatus()
{
$orderUpdated = false;
$order = $this->getOrder();
if (!is_null($order)) {
$orderPayment = $this->getOrderPayment();
$order = $this->recalculateAmounts($order);
$newOrderStatus = $this->calculateOrderStatus($orderPayment, $order);
$this->persistNewOrderStatus($order, $newOrderStatus);
$orderUpdated = true;
}
return $orderUpdated;
} | php | public function updateOrderStatus()
{
$orderUpdated = false;
$order = $this->getOrder();
if (!is_null($order)) {
$orderPayment = $this->getOrderPayment();
$order = $this->recalculateAmounts($order);
$newOrderStatus = $this->calculateOrderStatus($orderPayment, $order);
$this->persistNewOrderStatus($order, $newOrderStatus);
$orderUpdated = true;
}
return $orderUpdated;
} | [
"public",
"function",
"updateOrderStatus",
"(",
")",
"{",
"$",
"orderUpdated",
"=",
"false",
";",
"$",
"order",
"=",
"$",
"this",
"->",
"getOrder",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"order",
")",
")",
"{",
"$",
"orderPayment",
"=",
... | Update order manager to status get from order status calculator.
@return bool | [
"Update",
"order",
"manager",
"to",
"status",
"get",
"from",
"order",
"status",
"calculator",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderManager.php#L151-L165 |
43,927 | OXID-eSales/paypal | Model/OrderManager.php | OrderManager.calculateOrderStatus | protected function calculateOrderStatus($orderPayment, $order)
{
$orderPaymentStatusCalculator = $this->getOrderPaymentStatusCalculator();
$orderPaymentStatusCalculator->setOrderPayment($orderPayment);
$orderPaymentStatusCalculator->setOrder($order);
$newOrderStatus = $orderPaymentStatusCalculator->getStatus();
return $newOrderStatus;
} | php | protected function calculateOrderStatus($orderPayment, $order)
{
$orderPaymentStatusCalculator = $this->getOrderPaymentStatusCalculator();
$orderPaymentStatusCalculator->setOrderPayment($orderPayment);
$orderPaymentStatusCalculator->setOrder($order);
$newOrderStatus = $orderPaymentStatusCalculator->getStatus();
return $newOrderStatus;
} | [
"protected",
"function",
"calculateOrderStatus",
"(",
"$",
"orderPayment",
",",
"$",
"order",
")",
"{",
"$",
"orderPaymentStatusCalculator",
"=",
"$",
"this",
"->",
"getOrderPaymentStatusCalculator",
"(",
")",
";",
"$",
"orderPaymentStatusCalculator",
"->",
"setOrderP... | Wrapper for order payment calculator.
@param \OxidEsales\PayPalModule\Model\OrderPayment $orderPayment Order payment to set to calculator.
@param \OxidEsales\PayPalModule\Model\PayPalOrder $order Order to be set to validator.
@return null|string | [
"Wrapper",
"for",
"order",
"payment",
"calculator",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderManager.php#L200-L209 |
43,928 | OXID-eSales/paypal | Model/OrderManager.php | OrderManager.getOrderFromPayment | protected function getOrderFromPayment($orderPayment)
{
$orderId = null;
$order = null;
if (!is_null($orderPayment)) {
$orderId = $orderPayment->getOrderId();
}
if (!is_null($orderId)) {
$order = oxNew(\OxidEsales\PayPalModule\Model\PayPalOrder::class);
$order->setOrderId($orderId);
$order->load();
}
return $order;
} | php | protected function getOrderFromPayment($orderPayment)
{
$orderId = null;
$order = null;
if (!is_null($orderPayment)) {
$orderId = $orderPayment->getOrderId();
}
if (!is_null($orderId)) {
$order = oxNew(\OxidEsales\PayPalModule\Model\PayPalOrder::class);
$order->setOrderId($orderId);
$order->load();
}
return $order;
} | [
"protected",
"function",
"getOrderFromPayment",
"(",
"$",
"orderPayment",
")",
"{",
"$",
"orderId",
"=",
"null",
";",
"$",
"order",
"=",
"null",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"orderPayment",
")",
")",
"{",
"$",
"orderId",
"=",
"$",
"orderPa... | Load order by order id from order payment.
@param \OxidEsales\PayPalModule\Model\OrderPayment $orderPayment order payment to get order id.
@return \OxidEsales\PayPalModule\Model\PayPalOrder|null | [
"Load",
"order",
"by",
"order",
"id",
"from",
"order",
"payment",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderManager.php#L230-L244 |
43,929 | OXID-eSales/paypal | Model/OrderPaymentList.php | OrderPaymentList.hasPaymentWithStatus | protected function hasPaymentWithStatus($status)
{
$hasStatus = false;
$payments = $this->getArray();
foreach ($payments as $payment) {
if ($status == $payment->getStatus()) {
$hasStatus = true;
break;
}
}
return $hasStatus;
} | php | protected function hasPaymentWithStatus($status)
{
$hasStatus = false;
$payments = $this->getArray();
foreach ($payments as $payment) {
if ($status == $payment->getStatus()) {
$hasStatus = true;
break;
}
}
return $hasStatus;
} | [
"protected",
"function",
"hasPaymentWithStatus",
"(",
"$",
"status",
")",
"{",
"$",
"hasStatus",
"=",
"false",
";",
"$",
"payments",
"=",
"$",
"this",
"->",
"getArray",
"(",
")",
";",
"foreach",
"(",
"$",
"payments",
"as",
"$",
"payment",
")",
"{",
"if... | Check if list has payment with defined status.
@param string $status Payment status.
@return bool | [
"Check",
"if",
"list",
"has",
"payment",
"with",
"defined",
"status",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderPaymentList.php#L115-L128 |
43,930 | OXID-eSales/paypal | Model/PayPalRequest/PayPalRequestBuilder.php | PayPalRequestBuilder.getRequest | public function getRequest()
{
if ($this->request === null) {
$this->request = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest::class);
}
return $this->request;
} | php | public function getRequest()
{
if ($this->request === null) {
$this->request = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest::class);
}
return $this->request;
} | [
"public",
"function",
"getRequest",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"request",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"request",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"PayPalRequest",
"\\",
... | Return request object.
@return \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest | [
"Return",
"request",
"object",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalRequest/PayPalRequestBuilder.php#L107-L114 |
43,931 | OXID-eSales/paypal | Core/FullName.php | FullName.split | protected function split($fullName)
{
$names = explode(" ", trim($fullName), 2);
$this->firstName = trim($names[0]);
$this->lastName = trim($names[1]);
} | php | protected function split($fullName)
{
$names = explode(" ", trim($fullName), 2);
$this->firstName = trim($names[0]);
$this->lastName = trim($names[1]);
} | [
"protected",
"function",
"split",
"(",
"$",
"fullName",
")",
"{",
"$",
"names",
"=",
"explode",
"(",
"\" \"",
",",
"trim",
"(",
"$",
"fullName",
")",
",",
"2",
")",
";",
"$",
"this",
"->",
"firstName",
"=",
"trim",
"(",
"$",
"names",
"[",
"0",
"]... | Split user full name to first name and second name.
@param string $fullName | [
"Split",
"user",
"full",
"name",
"to",
"first",
"name",
"and",
"second",
"name",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/FullName.php#L72-L78 |
43,932 | OXID-eSales/paypal | Model/Action/Data/OrderCaptureActionData.php | OrderCaptureActionData.getAmount | public function getAmount()
{
$amount = $this->getRequest()->getRequestParameter('capture_amount');
return $amount ? $amount : $this->getOrder()->getPayPalOrder()->getRemainingOrderSum();
} | php | public function getAmount()
{
$amount = $this->getRequest()->getRequestParameter('capture_amount');
return $amount ? $amount : $this->getOrder()->getPayPalOrder()->getRemainingOrderSum();
} | [
"public",
"function",
"getAmount",
"(",
")",
"{",
"$",
"amount",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getRequestParameter",
"(",
"'capture_amount'",
")",
";",
"return",
"$",
"amount",
"?",
"$",
"amount",
":",
"$",
"this",
"->",
"getOrde... | returns action amount
@return string | [
"returns",
"action",
"amount"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/Data/OrderCaptureActionData.php#L44-L49 |
43,933 | OXID-eSales/paypal | Model/PaymentGateway.php | PaymentGateway.getPayPalOxOrder | public function getPayPalOxOrder()
{
if (is_null($this->payPalOxOrder)) {
$order = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
$order->loadPayPalOrder();
$this->setPayPalOxOrder($order);
}
return $this->payPalOxOrder;
} | php | public function getPayPalOxOrder()
{
if (is_null($this->payPalOxOrder)) {
$order = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
$order->loadPayPalOrder();
$this->setPayPalOxOrder($order);
}
return $this->payPalOxOrder;
} | [
"public",
"function",
"getPayPalOxOrder",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"payPalOxOrder",
")",
")",
"{",
"$",
"order",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Order",
... | Gets order.
@return \OxidEsales\Eshop\Application\Model\Order | [
"Gets",
"order",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PaymentGateway.php#L68-L77 |
43,934 | OXID-eSales/paypal | Model/PaymentGateway.php | PaymentGateway.doExpressCheckoutPayment | public function doExpressCheckoutPayment()
{
$success = false;
$order = $this->getPayPalOrder();
try {
// updating order state
if ($order) {
$order->oePayPalUpdateOrderNumber();
$session = $this->getSession();
$basket = $session->getBasket();
$transactionMode = $this->getTransactionMode($basket);
$builder = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\DoExpressCheckoutPaymentRequestBuilder::class);
$builder->setPayPalConfig($this->getPayPalConfig());
$builder->setSession($session);
$builder->setBasket($basket);
$builder->setTransactionMode($transactionMode);
$builder->setUser($this->getPayPalUser());
$builder->setOrder($order);
$request = $builder->buildRequest();
$payPalService = $this->getPayPalCheckoutService();
$result = $payPalService->doExpressCheckoutPayment($request);
$order->finalizePayPalOrder(
$result,
$session->getBasket(),
$transactionMode
);
$success = true;
} else {
/**
* @var $exception \OxidEsales\Eshop\Core\Exception\StandardException
*/
$exception = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'OEPAYPAL_ORDER_ERROR');
throw $exception;
}
} catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) {
// deleting order on error
if ($order) {
$order->deletePayPalOrder();
}
$this->_iLastErrorNo = \OxidEsales\Eshop\Application\Model\Order::ORDER_STATE_PAYMENTERROR;
$utilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();
$utilsView->addErrorToDisplay($exception);
}
return $success;
} | php | public function doExpressCheckoutPayment()
{
$success = false;
$order = $this->getPayPalOrder();
try {
// updating order state
if ($order) {
$order->oePayPalUpdateOrderNumber();
$session = $this->getSession();
$basket = $session->getBasket();
$transactionMode = $this->getTransactionMode($basket);
$builder = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\DoExpressCheckoutPaymentRequestBuilder::class);
$builder->setPayPalConfig($this->getPayPalConfig());
$builder->setSession($session);
$builder->setBasket($basket);
$builder->setTransactionMode($transactionMode);
$builder->setUser($this->getPayPalUser());
$builder->setOrder($order);
$request = $builder->buildRequest();
$payPalService = $this->getPayPalCheckoutService();
$result = $payPalService->doExpressCheckoutPayment($request);
$order->finalizePayPalOrder(
$result,
$session->getBasket(),
$transactionMode
);
$success = true;
} else {
/**
* @var $exception \OxidEsales\Eshop\Core\Exception\StandardException
*/
$exception = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'OEPAYPAL_ORDER_ERROR');
throw $exception;
}
} catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) {
// deleting order on error
if ($order) {
$order->deletePayPalOrder();
}
$this->_iLastErrorNo = \OxidEsales\Eshop\Application\Model\Order::ORDER_STATE_PAYMENTERROR;
$utilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();
$utilsView->addErrorToDisplay($exception);
}
return $success;
} | [
"public",
"function",
"doExpressCheckoutPayment",
"(",
")",
"{",
"$",
"success",
"=",
"false",
";",
"$",
"order",
"=",
"$",
"this",
"->",
"getPayPalOrder",
"(",
")",
";",
"try",
"{",
"// updating order state",
"if",
"(",
"$",
"order",
")",
"{",
"$",
"ord... | Executes "DoExpressCheckoutPayment" to PayPal
@return bool | [
"Executes",
"DoExpressCheckoutPayment",
"to",
"PayPal"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PaymentGateway.php#L107-L160 |
43,935 | OXID-eSales/paypal | Model/PayPalRequest/DoExpressCheckoutPaymentRequestBuilder.php | DoExpressCheckoutPaymentRequestBuilder.getOrder | public function getOrder()
{
if (is_null($this->order)) {
/** @var \OxidEsales\PayPalModule\Core\Exception\PayPalResponseException $exception */
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalResponseException::class, 'OEPAYPAL_ORDER_ERROR');
throw $exception;
}
return $this->order;
} | php | public function getOrder()
{
if (is_null($this->order)) {
/** @var \OxidEsales\PayPalModule\Core\Exception\PayPalResponseException $exception */
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalResponseException::class, 'OEPAYPAL_ORDER_ERROR');
throw $exception;
}
return $this->order;
} | [
"public",
"function",
"getOrder",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"order",
")",
")",
"{",
"/** @var \\OxidEsales\\PayPalModule\\Core\\Exception\\PayPalResponseException $exception */",
"$",
"exception",
"=",
"oxNew",
"(",
"\\",
"OxidEsales... | Tries to return basket object, but if fails throws exception.
@return \OxidEsales\Eshop\Application\Model\Order
@throws \OxidEsales\PayPalModule\Core\Exception\PayPalResponseException | [
"Tries",
"to",
"return",
"basket",
"object",
"but",
"if",
"fails",
"throws",
"exception",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalRequest/DoExpressCheckoutPaymentRequestBuilder.php#L160-L169 |
43,936 | OXID-eSales/paypal | Model/PayPalRequest/DoExpressCheckoutPaymentRequestBuilder.php | DoExpressCheckoutPaymentRequestBuilder.getLang | public function getLang()
{
if ($this->lang === null) {
$this->lang = $this->getPayPalConfig()->getLang();
}
return $this->lang;
} | php | public function getLang()
{
if ($this->lang === null) {
$this->lang = $this->getPayPalConfig()->getLang();
}
return $this->lang;
} | [
"public",
"function",
"getLang",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"lang",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"lang",
"=",
"$",
"this",
"->",
"getPayPalConfig",
"(",
")",
"->",
"getLang",
"(",
")",
";",
"}",
"return",
"$",
"th... | Returns request object.
@return \OxidEsales\Eshop\Core\Language | [
"Returns",
"request",
"object",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalRequest/DoExpressCheckoutPaymentRequestBuilder.php#L206-L213 |
43,937 | OXID-eSales/paypal | Model/PayPalRequest/DoExpressCheckoutPaymentRequestBuilder.php | DoExpressCheckoutPaymentRequestBuilder.getUser | public function getUser()
{
if (is_null($this->user)) {
/**
* @var \OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException $exception
*/
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException::class);
throw $exception;
}
return $this->user;
} | php | public function getUser()
{
if (is_null($this->user)) {
/**
* @var \OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException $exception
*/
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException::class);
throw $exception;
}
return $this->user;
} | [
"public",
"function",
"getUser",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"user",
")",
")",
"{",
"/**\n * @var \\OxidEsales\\PayPalModule\\Core\\Exception\\PayPalMissingParameterException $exception\n */",
"$",
"exception",
"=",
"... | Returns User object
@return \OxidEsales\Eshop\Application\Model\User
@throws \OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException | [
"Returns",
"User",
"object"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalRequest/DoExpressCheckoutPaymentRequestBuilder.php#L252-L263 |
43,938 | OXID-eSales/paypal | Model/PayPalRequest/DoExpressCheckoutPaymentRequestBuilder.php | DoExpressCheckoutPaymentRequestBuilder.addBaseParams | public function addBaseParams()
{
$order = $this->getOrder();
$config = $this->getPayPalConfig();
$basket = $this->getBasket();
$session = $this->getSession();
$lang = $this->getLang();
$request = $this->getRequest();
$request->setParameter("TOKEN", $session->getVariable("oepaypal-token"));
$request->setParameter("PAYERID", $session->getVariable("oepaypal-payerId"));
$request->setParameter("PAYMENTREQUEST_0_PAYMENTACTION", $this->getTransactionMode());
$request->setParameter("PAYMENTREQUEST_0_AMT", $this->formatFloat($basket->getPrice()->getBruttoPrice()));
$request->setParameter("PAYMENTREQUEST_0_CURRENCYCODE", $basket->getBasketCurrency()->name);
// IPN notify URL for PayPal
if (!$config->suppressIPNCallbackUrl()) {
$request->setParameter("PAYMENTREQUEST_0_NOTIFYURL", $config->getIPNCallbackUrl());
}
// payment description
$subj = sprintf($lang->translateString("OEPAYPAL_ORDER_CONF_SUBJECT"), $order->oxorder__oxordernr->value);
$request->setParameter("PAYMENTREQUEST_0_DESC", $subj);
$request->setParameter("PAYMENTREQUEST_0_CUSTOM", $subj);
// Please do not change this place.
// It is important to guarantee the future development of this OXID eShop extension and to keep it free of charge.
// Thanks!
$request->setParameter("BUTTONSOURCE", $config->getPartnerCode());
} | php | public function addBaseParams()
{
$order = $this->getOrder();
$config = $this->getPayPalConfig();
$basket = $this->getBasket();
$session = $this->getSession();
$lang = $this->getLang();
$request = $this->getRequest();
$request->setParameter("TOKEN", $session->getVariable("oepaypal-token"));
$request->setParameter("PAYERID", $session->getVariable("oepaypal-payerId"));
$request->setParameter("PAYMENTREQUEST_0_PAYMENTACTION", $this->getTransactionMode());
$request->setParameter("PAYMENTREQUEST_0_AMT", $this->formatFloat($basket->getPrice()->getBruttoPrice()));
$request->setParameter("PAYMENTREQUEST_0_CURRENCYCODE", $basket->getBasketCurrency()->name);
// IPN notify URL for PayPal
if (!$config->suppressIPNCallbackUrl()) {
$request->setParameter("PAYMENTREQUEST_0_NOTIFYURL", $config->getIPNCallbackUrl());
}
// payment description
$subj = sprintf($lang->translateString("OEPAYPAL_ORDER_CONF_SUBJECT"), $order->oxorder__oxordernr->value);
$request->setParameter("PAYMENTREQUEST_0_DESC", $subj);
$request->setParameter("PAYMENTREQUEST_0_CUSTOM", $subj);
// Please do not change this place.
// It is important to guarantee the future development of this OXID eShop extension and to keep it free of charge.
// Thanks!
$request->setParameter("BUTTONSOURCE", $config->getPartnerCode());
} | [
"public",
"function",
"addBaseParams",
"(",
")",
"{",
"$",
"order",
"=",
"$",
"this",
"->",
"getOrder",
"(",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"getPayPalConfig",
"(",
")",
";",
"$",
"basket",
"=",
"$",
"this",
"->",
"getBasket",
"(",
... | Sets basic parameters to request. | [
"Sets",
"basic",
"parameters",
"to",
"request",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalRequest/DoExpressCheckoutPaymentRequestBuilder.php#L333-L362 |
43,939 | OXID-eSales/paypal | Model/IPNPaymentCreator.php | IPNPaymentCreator.handleOrderPayment | public function handleOrderPayment($requestOrderPayment)
{
$return = null;
$authId = $this->getRequest()->getRequestParameter(self::PAYPAL_IPN_AUTH_ID);
$transactionEntity = $this->getRequest()->getRequestParameter(self::PAYPAL_IPN_TRANSACTION_ENTITY);
$parentTransactionId = $this->getRequest()->getRequestParameter(self::PAYPAL_IPN_PARENT_TRANSACTION_ID);
$orderPaymentAuthorization = $this->loadOrderPayment($authId);
$orderPaymentParent = $this->loadOrderPayment($parentTransactionId);
$orderId = $orderPaymentParent->getOrderId();
if ((self::HANDLE_TRANSACTION_ENTITY == $transactionEntity) && $orderId) {
$requestOrderPayment->setOrderId($orderId);
$requestOrderPayment->save();
$requestOrderPayment = $this->addRequestPaymentComment($requestOrderPayment);
if (\OxidEsales\PayPalModule\Model\IPNRequestPaymentSetter::REFUND_ACTION == $requestOrderPayment->getAction()) {
$this->updateParentTransactionRefundAmount($orderPaymentParent, $requestOrderPayment->getAmount());
}
if ((\OxidEsales\PayPalModule\Model\IPNRequestPaymentSetter::AUTHORIZATION_ACTION == $orderPaymentAuthorization->getAction())
&& ($orderId == $orderPaymentAuthorization->getOrderId())
) {
$this->updateOrderPaymentAuthorizationStatus($orderPaymentAuthorization);
}
$return = $requestOrderPayment;
}
return $return;
} | php | public function handleOrderPayment($requestOrderPayment)
{
$return = null;
$authId = $this->getRequest()->getRequestParameter(self::PAYPAL_IPN_AUTH_ID);
$transactionEntity = $this->getRequest()->getRequestParameter(self::PAYPAL_IPN_TRANSACTION_ENTITY);
$parentTransactionId = $this->getRequest()->getRequestParameter(self::PAYPAL_IPN_PARENT_TRANSACTION_ID);
$orderPaymentAuthorization = $this->loadOrderPayment($authId);
$orderPaymentParent = $this->loadOrderPayment($parentTransactionId);
$orderId = $orderPaymentParent->getOrderId();
if ((self::HANDLE_TRANSACTION_ENTITY == $transactionEntity) && $orderId) {
$requestOrderPayment->setOrderId($orderId);
$requestOrderPayment->save();
$requestOrderPayment = $this->addRequestPaymentComment($requestOrderPayment);
if (\OxidEsales\PayPalModule\Model\IPNRequestPaymentSetter::REFUND_ACTION == $requestOrderPayment->getAction()) {
$this->updateParentTransactionRefundAmount($orderPaymentParent, $requestOrderPayment->getAmount());
}
if ((\OxidEsales\PayPalModule\Model\IPNRequestPaymentSetter::AUTHORIZATION_ACTION == $orderPaymentAuthorization->getAction())
&& ($orderId == $orderPaymentAuthorization->getOrderId())
) {
$this->updateOrderPaymentAuthorizationStatus($orderPaymentAuthorization);
}
$return = $requestOrderPayment;
}
return $return;
} | [
"public",
"function",
"handleOrderPayment",
"(",
"$",
"requestOrderPayment",
")",
"{",
"$",
"return",
"=",
"null",
";",
"$",
"authId",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getRequestParameter",
"(",
"self",
"::",
"PAYPAL_IPN_AUTH_ID",
")",
... | Handling of IPN data that has not yet a paypal order payment
entry in shop database.
Checks if information from IPN is relevant for Shop. That is the case
if the related PayPal parent transaction can be found in table oepaypal_orderpayments.
If data is relevant, we need to
- create paypal order payment, store it in database and return it.
- if it is a refund, update the parent transaction's refunded amount
- update authorization status (can be Pending, In Progress, Completed)
@param \OxidEsales\PayPalModule\Model\OrderPayment $requestOrderPayment
@return \OxidEsales\PayPalModule\Model\OrderPayment|null | [
"Handling",
"of",
"IPN",
"data",
"that",
"has",
"not",
"yet",
"a",
"paypal",
"order",
"payment",
"entry",
"in",
"shop",
"database",
".",
"Checks",
"if",
"information",
"from",
"IPN",
"is",
"relevant",
"for",
"Shop",
".",
"That",
"is",
"the",
"case",
"if"... | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentCreator.php#L87-L116 |
43,940 | OXID-eSales/paypal | Model/IPNPaymentCreator.php | IPNPaymentCreator.updateOrderPaymentAuthorizationStatus | private function updateOrderPaymentAuthorizationStatus($orderPaymentAuthorization)
{
$authStatus = $this->getRequest()->getRequestParameter(self::PAYPAL_IPN_AUTH_STATUS);
if ($authStatus) {
$orderPaymentAuthorization->setStatus($authStatus);
$orderPaymentAuthorization->save();
}
} | php | private function updateOrderPaymentAuthorizationStatus($orderPaymentAuthorization)
{
$authStatus = $this->getRequest()->getRequestParameter(self::PAYPAL_IPN_AUTH_STATUS);
if ($authStatus) {
$orderPaymentAuthorization->setStatus($authStatus);
$orderPaymentAuthorization->save();
}
} | [
"private",
"function",
"updateOrderPaymentAuthorizationStatus",
"(",
"$",
"orderPaymentAuthorization",
")",
"{",
"$",
"authStatus",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getRequestParameter",
"(",
"self",
"::",
"PAYPAL_IPN_AUTH_STATUS",
")",
";",
"i... | The status of the related authorization transaction might have changed.
We need to update that transaction status as well if we got a value in IPN request data.
@param \OxidEsales\PayPalModule\Model\OrderPayment $orderPaymentAuthorization Authorization PayPal order payment | [
"The",
"status",
"of",
"the",
"related",
"authorization",
"transaction",
"might",
"have",
"changed",
".",
"We",
"need",
"to",
"update",
"that",
"transaction",
"status",
"as",
"well",
"if",
"we",
"got",
"a",
"value",
"in",
"IPN",
"request",
"data",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentCreator.php#L136-L144 |
43,941 | OXID-eSales/paypal | Model/IPNPaymentCreator.php | IPNPaymentCreator.addRequestPaymentComment | private function addRequestPaymentComment($paypalOrderPayment)
{
$request = $this->getRequest();
$memo = $request->getRequestParameter(self::PAYPAL_IPN_MEMO);
if ($memo) {
$comment = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentComment::class);
$comment->setComment($memo);
$paypalOrderPayment->addComment($comment);
if (0 < $paypalOrderPayment->getId()) {
$paypalOrderPayment->save();
}
}
return $paypalOrderPayment;
} | php | private function addRequestPaymentComment($paypalOrderPayment)
{
$request = $this->getRequest();
$memo = $request->getRequestParameter(self::PAYPAL_IPN_MEMO);
if ($memo) {
$comment = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentComment::class);
$comment->setComment($memo);
$paypalOrderPayment->addComment($comment);
if (0 < $paypalOrderPayment->getId()) {
$paypalOrderPayment->save();
}
}
return $paypalOrderPayment;
} | [
"private",
"function",
"addRequestPaymentComment",
"(",
"$",
"paypalOrderPayment",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"memo",
"=",
"$",
"request",
"->",
"getRequestParameter",
"(",
"self",
"::",
"PAYPAL_IPN_MEMO... | Add comment for request payment if comment exists.
Function must only be called when the payment object this
comment is related to is already stored in the database and has an oxid.
Comment will be immediately saved to database.
@param \OxidEsales\PayPalModule\Model\OrderPayment $paypalOrderPayment
@return \OxidEsales\PayPalModule\Model\OrderPayment | [
"Add",
"comment",
"for",
"request",
"payment",
"if",
"comment",
"exists",
".",
"Function",
"must",
"only",
"be",
"called",
"when",
"the",
"payment",
"object",
"this",
"comment",
"is",
"related",
"to",
"is",
"already",
"stored",
"in",
"the",
"database",
"and"... | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentCreator.php#L171-L185 |
43,942 | OXID-eSales/paypal | Model/IPNProcessor.php | IPNProcessor.getPaymentBuilder | public function getPaymentBuilder()
{
if (is_null($this->paymentBuilder)) {
$this->paymentBuilder = oxNew(\OxidEsales\PayPalModule\Model\IPNPaymentBuilder::class);
}
return $this->paymentBuilder;
} | php | public function getPaymentBuilder()
{
if (is_null($this->paymentBuilder)) {
$this->paymentBuilder = oxNew(\OxidEsales\PayPalModule\Model\IPNPaymentBuilder::class);
}
return $this->paymentBuilder;
} | [
"public",
"function",
"getPaymentBuilder",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"paymentBuilder",
")",
")",
"{",
"$",
"this",
"->",
"paymentBuilder",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
... | Creates \OxidEsales\PayPalModule\Model\IPNPaymentBuilder, sets if it was not set and than returns it.
@return \OxidEsales\PayPalModule\Model\IPNPaymentBuilder | [
"Creates",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"IPNPaymentBuilder",
"sets",
"if",
"it",
"was",
"not",
"set",
"and",
"than",
"returns",
"it",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNProcessor.php#L101-L108 |
43,943 | OXID-eSales/paypal | Model/IPNProcessor.php | IPNProcessor.getOrderManager | public function getOrderManager()
{
if (is_null($this->orderManager)) {
$this->orderManager = oxNew(\OxidEsales\PayPalModule\Model\OrderManager::class);
}
return $this->orderManager;
} | php | public function getOrderManager()
{
if (is_null($this->orderManager)) {
$this->orderManager = oxNew(\OxidEsales\PayPalModule\Model\OrderManager::class);
}
return $this->orderManager;
} | [
"public",
"function",
"getOrderManager",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"orderManager",
")",
")",
"{",
"$",
"this",
"->",
"orderManager",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"Ord... | Returns order manager.
@return \OxidEsales\PayPalModule\Model\OrderManager | [
"Returns",
"order",
"manager",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNProcessor.php#L125-L132 |
43,944 | OXID-eSales/paypal | Model/IPNProcessor.php | IPNProcessor.process | public function process()
{
$lang = $this->getLang();
$request = $this->getRequest();
$paymentBuilder = $this->getPaymentBuilder();
$payPalOrderManager = $this->getOrderManager();
// Create Payment from Request.
$paymentBuilder->setLang($lang);
$paymentBuilder->setRequest($request);
$orderPayment = $paymentBuilder->buildPayment();
$payPalOrderManager->setOrderPayment($orderPayment);
$processSuccess = $payPalOrderManager->updateOrderStatus();
return $processSuccess;
} | php | public function process()
{
$lang = $this->getLang();
$request = $this->getRequest();
$paymentBuilder = $this->getPaymentBuilder();
$payPalOrderManager = $this->getOrderManager();
// Create Payment from Request.
$paymentBuilder->setLang($lang);
$paymentBuilder->setRequest($request);
$orderPayment = $paymentBuilder->buildPayment();
$payPalOrderManager->setOrderPayment($orderPayment);
$processSuccess = $payPalOrderManager->updateOrderStatus();
return $processSuccess;
} | [
"public",
"function",
"process",
"(",
")",
"{",
"$",
"lang",
"=",
"$",
"this",
"->",
"getLang",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"paymentBuilder",
"=",
"$",
"this",
"->",
"getPaymentBuilder",
"(... | Initiate payment status changes according to IPN information.
@return bool | [
"Initiate",
"payment",
"status",
"changes",
"according",
"to",
"IPN",
"information",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNProcessor.php#L139-L155 |
43,945 | OXID-eSales/paypal | Controller/Dispatcher.php | Dispatcher.getBaseUrl | protected function getBaseUrl()
{
$session = $this->getSession();
$url = \OxidEsales\Eshop\Core\Registry::getConfig()->getSslShopUrl() . "index.php?lang=" . \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage() . "&sid=" . $session->getId() . "&rtoken=" . $session->getRemoteAccessToken();
$url .= "&shp=" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
return $url;
} | php | protected function getBaseUrl()
{
$session = $this->getSession();
$url = \OxidEsales\Eshop\Core\Registry::getConfig()->getSslShopUrl() . "index.php?lang=" . \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage() . "&sid=" . $session->getId() . "&rtoken=" . $session->getRemoteAccessToken();
$url .= "&shp=" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
return $url;
} | [
"protected",
"function",
"getBaseUrl",
"(",
")",
"{",
"$",
"session",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
";",
"$",
"url",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getSslSho... | Returns base url, which is used to construct Callback, Return and Cancel Urls
@return string | [
"Returns",
"base",
"url",
"which",
"is",
"used",
"to",
"construct",
"Callback",
"Return",
"and",
"Cancel",
"Urls"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Dispatcher.php#L115-L122 |
43,946 | OXID-eSales/paypal | Controller/Dispatcher.php | Dispatcher.getPayPalOrder | protected function getPayPalOrder()
{
$order = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
if ($order->loadPayPalOrder()) {
return $order;
}
} | php | protected function getPayPalOrder()
{
$order = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
if ($order->loadPayPalOrder()) {
return $order;
}
} | [
"protected",
"function",
"getPayPalOrder",
"(",
")",
"{",
"$",
"order",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Order",
"::",
"class",
")",
";",
"if",
"(",
"$",
"order",
"->",
"loadPayPalOrder",
"(... | Returns PayPal order object
@return \OxidEsales\Eshop\Application\Model\Order|null | [
"Returns",
"PayPal",
"order",
"object"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Dispatcher.php#L129-L135 |
43,947 | OXID-eSales/paypal | Controller/Dispatcher.php | Dispatcher.getPayPalPayment | protected function getPayPalPayment()
{
$userPayment = null;
if (($order = $this->getPayPalOrder())) {
$userPayment = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class);
$userPayment->load($order->oxorder__oxpaymentid->value);
}
return $userPayment;
} | php | protected function getPayPalPayment()
{
$userPayment = null;
if (($order = $this->getPayPalOrder())) {
$userPayment = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class);
$userPayment->load($order->oxorder__oxpaymentid->value);
}
return $userPayment;
} | [
"protected",
"function",
"getPayPalPayment",
"(",
")",
"{",
"$",
"userPayment",
"=",
"null",
";",
"if",
"(",
"(",
"$",
"order",
"=",
"$",
"this",
"->",
"getPayPalOrder",
"(",
")",
")",
")",
"{",
"$",
"userPayment",
"=",
"oxNew",
"(",
"\\",
"OxidEsales"... | Returns PayPal payment object
@return \OxidEsales\Eshop\Application\Model\Payment|null | [
"Returns",
"PayPal",
"payment",
"object"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Dispatcher.php#L142-L152 |
43,948 | OXID-eSales/paypal | Model/PayPalOrder.php | PayPalOrder.setPaymentStatus | public function setPaymentStatus($status, \OxidEsales\Eshop\Application\Model\Order $order = null)
{
$this->setValue('oepaypal_paymentstatus', $status);
// if payment completed, set order paid
if ($status == \OxidEsales\PayPalModule\Model\PayPalOrder::PAYPAL_ORDER_STATE_COMPLETED) {
if (is_null($order)) {
$order = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
$order->load($this->getOrderId());
}
$order->markOrderPaid();
}
} | php | public function setPaymentStatus($status, \OxidEsales\Eshop\Application\Model\Order $order = null)
{
$this->setValue('oepaypal_paymentstatus', $status);
// if payment completed, set order paid
if ($status == \OxidEsales\PayPalModule\Model\PayPalOrder::PAYPAL_ORDER_STATE_COMPLETED) {
if (is_null($order)) {
$order = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
$order->load($this->getOrderId());
}
$order->markOrderPaid();
}
} | [
"public",
"function",
"setPaymentStatus",
"(",
"$",
"status",
",",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Order",
"$",
"order",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setValue",
"(",
"'oepaypal_paymentstatus'",
",",... | Set payment status.
@param string $status
@param \OxidEsales\Eshop\Application\Model\Order $order Shop order object | [
"Set",
"payment",
"status",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalOrder.php#L195-L207 |
43,949 | OXID-eSales/paypal | Model/PayPalOrder.php | PayPalOrder.getPaymentStatus | public function getPaymentStatus()
{
$state = $this->getValue('oepaypal_paymentstatus');
if (empty($state)) {
$state = self::PAYPAL_ORDER_STATE_COMPLETED;
}
return $state;
} | php | public function getPaymentStatus()
{
$state = $this->getValue('oepaypal_paymentstatus');
if (empty($state)) {
$state = self::PAYPAL_ORDER_STATE_COMPLETED;
}
return $state;
} | [
"public",
"function",
"getPaymentStatus",
"(",
")",
"{",
"$",
"state",
"=",
"$",
"this",
"->",
"getValue",
"(",
"'oepaypal_paymentstatus'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"state",
")",
")",
"{",
"$",
"state",
"=",
"self",
"::",
"PAYPAL_ORDER_STA... | Get payment status.
@return string | [
"Get",
"payment",
"status",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalOrder.php#L214-L222 |
43,950 | OXID-eSales/paypal | Model/PayPalOrder.php | PayPalOrder.addPayment | public function addPayment(\OxidEsales\PayPalModule\Model\OrderPayment $payment)
{
$paymentList = $this->getPaymentList();
$paymentList->addPayment($payment);
$this->setPaymentList(null);
} | php | public function addPayment(\OxidEsales\PayPalModule\Model\OrderPayment $payment)
{
$paymentList = $this->getPaymentList();
$paymentList->addPayment($payment);
$this->setPaymentList(null);
} | [
"public",
"function",
"addPayment",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"OrderPayment",
"$",
"payment",
")",
"{",
"$",
"paymentList",
"=",
"$",
"this",
"->",
"getPaymentList",
"(",
")",
";",
"$",
"paymentList",
"->",
"addPayme... | Adds new payment.
@param \OxidEsales\PayPalModule\Model\OrderPayment $payment order payment | [
"Adds",
"new",
"payment",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalOrder.php#L279-L284 |
43,951 | OXID-eSales/paypal | Model/PayPalOrder.php | PayPalOrder.getPaymentList | public function getPaymentList()
{
if (is_null($this->paymentList)) {
$paymentList = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentList::class);
$paymentList->load($this->getOrderId());
$this->setPaymentList($paymentList);
}
return $this->paymentList;
} | php | public function getPaymentList()
{
if (is_null($this->paymentList)) {
$paymentList = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentList::class);
$paymentList->load($this->getOrderId());
$this->setPaymentList($paymentList);
}
return $this->paymentList;
} | [
"public",
"function",
"getPaymentList",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"paymentList",
")",
")",
"{",
"$",
"paymentList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"OrderPaymentList",
"::... | Return order payment list.
@return \OxidEsales\PayPalModule\Model\OrderPaymentList | [
"Return",
"order",
"payment",
"list",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalOrder.php#L305-L314 |
43,952 | OXID-eSales/paypal | Model/OrderPaymentActionManager.php | OrderPaymentActionManager.getAvailableActions | protected function getAvailableActions($paymentAction, $paymentStatus)
{
$actions = $this->availableActions[$paymentAction][$paymentStatus];
return $actions ? $actions : array();
} | php | protected function getAvailableActions($paymentAction, $paymentStatus)
{
$actions = $this->availableActions[$paymentAction][$paymentStatus];
return $actions ? $actions : array();
} | [
"protected",
"function",
"getAvailableActions",
"(",
"$",
"paymentAction",
",",
"$",
"paymentStatus",
")",
"{",
"$",
"actions",
"=",
"$",
"this",
"->",
"availableActions",
"[",
"$",
"paymentAction",
"]",
"[",
"$",
"paymentStatus",
"]",
";",
"return",
"$",
"a... | Returns available actions for given payment action
@param string $paymentAction
@param string $paymentStatus
@return array | [
"Returns",
"available",
"actions",
"for",
"given",
"payment",
"action"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderPaymentActionManager.php#L77-L82 |
43,953 | OXID-eSales/paypal | Model/Action/Data/OrderRefundActionData.php | OrderRefundActionData.getAmount | public function getAmount()
{
$amount = $this->getRequest()->getRequestParameter('refund_amount');
return $amount ? $amount : $this->getPaymentBeingRefunded()->getRemainingRefundAmount();
} | php | public function getAmount()
{
$amount = $this->getRequest()->getRequestParameter('refund_amount');
return $amount ? $amount : $this->getPaymentBeingRefunded()->getRemainingRefundAmount();
} | [
"public",
"function",
"getAmount",
"(",
")",
"{",
"$",
"amount",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getRequestParameter",
"(",
"'refund_amount'",
")",
";",
"return",
"$",
"amount",
"?",
"$",
"amount",
":",
"$",
"this",
"->",
"getPayme... | Returns amount to refund.
@return float | [
"Returns",
"amount",
"to",
"refund",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/Data/OrderRefundActionData.php#L59-L64 |
43,954 | OXID-eSales/paypal | Model/Action/Data/OrderRefundActionData.php | OrderRefundActionData.getPaymentBeingRefunded | public function getPaymentBeingRefunded()
{
if (is_null($this->paymentBeingRefunded)) {
$this->paymentBeingRefunded = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$this->paymentBeingRefunded->loadByTransactionId($this->getTransactionId());
}
return $this->paymentBeingRefunded;
} | php | public function getPaymentBeingRefunded()
{
if (is_null($this->paymentBeingRefunded)) {
$this->paymentBeingRefunded = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$this->paymentBeingRefunded->loadByTransactionId($this->getTransactionId());
}
return $this->paymentBeingRefunded;
} | [
"public",
"function",
"getPaymentBeingRefunded",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"paymentBeingRefunded",
")",
")",
"{",
"$",
"this",
"->",
"paymentBeingRefunded",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
... | Returns payment to refund.
@return \OxidEsales\PayPalModule\Model\OrderPayment | [
"Returns",
"payment",
"to",
"refund",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/Data/OrderRefundActionData.php#L81-L89 |
43,955 | OXID-eSales/paypal | Model/OrderPayment.php | OrderPayment.loadByTransactionId | public function loadByTransactionId($transactionId)
{
$result = false;
$data = $this->getDbGateway()->loadByTransactionId($transactionId);
if ($data) {
$this->setData($data);
$result = true;
}
return $result;
} | php | public function loadByTransactionId($transactionId)
{
$result = false;
$data = $this->getDbGateway()->loadByTransactionId($transactionId);
if ($data) {
$this->setData($data);
$result = true;
}
return $result;
} | [
"public",
"function",
"loadByTransactionId",
"(",
"$",
"transactionId",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"getDbGateway",
"(",
")",
"->",
"loadByTransactionId",
"(",
"$",
"transactionId",
")",
";",
"if",
"(",
... | Load payment data by given transaction id
@param string $transactionId transaction id
@return bool | [
"Load",
"payment",
"data",
"by",
"given",
"transaction",
"id"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderPayment.php#L293-L303 |
43,956 | OXID-eSales/paypal | Core/Caller.php | Caller.getCurl | public function getCurl()
{
if (is_null($this->curl)) {
$curl = oxNew(\OxidEsales\PayPalModule\Core\Curl::class);
$this->setCurl($curl);
}
return $this->curl;
} | php | public function getCurl()
{
if (is_null($this->curl)) {
$curl = oxNew(\OxidEsales\PayPalModule\Core\Curl::class);
$this->setCurl($curl);
}
return $this->curl;
} | [
"public",
"function",
"getCurl",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"curl",
")",
")",
"{",
"$",
"curl",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Core",
"\\",
"Curl",
"::",
"class",
")",
";",
"$",... | Returns curl instance
@return \OxidEsales\PayPalModule\Core\Curl | [
"Returns",
"curl",
"instance"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Caller.php#L85-L93 |
43,957 | OXID-eSales/paypal | Core/Caller.php | Caller.call | public function call($methodName = null)
{
$this->setMethod($methodName);
$curl = $this->getCurl();
$curl->setParameters($this->getParameters());
$this->log($this->getParameters(), 'Request to PayPal');
$response = $curl->execute();
$this->log($response, 'Response from PayPal');
$this->validateResponse($response);
return $response;
} | php | public function call($methodName = null)
{
$this->setMethod($methodName);
$curl = $this->getCurl();
$curl->setParameters($this->getParameters());
$this->log($this->getParameters(), 'Request to PayPal');
$response = $curl->execute();
$this->log($response, 'Response from PayPal');
$this->validateResponse($response);
return $response;
} | [
"public",
"function",
"call",
"(",
"$",
"methodName",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setMethod",
"(",
"$",
"methodName",
")",
";",
"$",
"curl",
"=",
"$",
"this",
"->",
"getCurl",
"(",
")",
";",
"$",
"curl",
"->",
"setParameters",
"(",
"... | Calls given remote PayPal method.
@param string $methodName .
@return array | [
"Calls",
"given",
"remote",
"PayPal",
"method",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Caller.php#L133-L149 |
43,958 | OXID-eSales/paypal | Core/Caller.php | Caller.validateResponse | protected function validateResponse($response)
{
if ('Failure' == $response['ACK']) {
/**
* @var \OxidEsales\PayPalModule\Core\Exception\PayPalResponseException $exception
*/
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalResponseException::class, $response['L_LONGMESSAGE0'], $response['L_ERRORCODE0']);
throw $exception;
}
} | php | protected function validateResponse($response)
{
if ('Failure' == $response['ACK']) {
/**
* @var \OxidEsales\PayPalModule\Core\Exception\PayPalResponseException $exception
*/
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalResponseException::class, $response['L_LONGMESSAGE0'], $response['L_ERRORCODE0']);
throw $exception;
}
} | [
"protected",
"function",
"validateResponse",
"(",
"$",
"response",
")",
"{",
"if",
"(",
"'Failure'",
"==",
"$",
"response",
"[",
"'ACK'",
"]",
")",
"{",
"/**\n * @var \\OxidEsales\\PayPalModule\\Core\\Exception\\PayPalResponseException $exception\n */",
... | Validates response from PayPal errors.
@param array $response
@throws \OxidEsales\PayPalModule\Core\Exception\PayPalResponseException if response has error from PayPal | [
"Validates",
"response",
"from",
"PayPal",
"errors",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Caller.php#L170-L179 |
43,959 | OXID-eSales/paypal | Core/Caller.php | Caller.getCallBackResponse | public function getCallBackResponse($methodName)
{
$this->setParameter("METHOD", $methodName);
$curl = $this->getCurl();
$curl->setParameters($this->getParameters());
$request = $curl->getQuery();
$this->log($request, 'Callback response from eShop to PayPal');
return $request;
} | php | public function getCallBackResponse($methodName)
{
$this->setParameter("METHOD", $methodName);
$curl = $this->getCurl();
$curl->setParameters($this->getParameters());
$request = $curl->getQuery();
$this->log($request, 'Callback response from eShop to PayPal');
return $request;
} | [
"public",
"function",
"getCallBackResponse",
"(",
"$",
"methodName",
")",
"{",
"$",
"this",
"->",
"setParameter",
"(",
"\"METHOD\"",
",",
"$",
"methodName",
")",
";",
"$",
"curl",
"=",
"$",
"this",
"->",
"getCurl",
"(",
")",
";",
"$",
"curl",
"->",
"se... | Outputs given request data.
@param string $methodName
@return string | [
"Outputs",
"given",
"request",
"data",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Caller.php#L188-L199 |
43,960 | OXID-eSales/paypal | Core/Caller.php | Caller.log | public function log($value, $title = '')
{
if (!is_null($this->getLogger())) {
$this->getLogger()->setTitle($title);
$this->getLogger()->log($value);
}
} | php | public function log($value, $title = '')
{
if (!is_null($this->getLogger())) {
$this->getLogger()->setTitle($title);
$this->getLogger()->log($value);
}
} | [
"public",
"function",
"log",
"(",
"$",
"value",
",",
"$",
"title",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"getLogger",
"(",
")",
")",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"setTitle",
"(",
"$... | Logs given request and responds parameters to log file.
@param mixed $value request / response parameters
@param string $title section title in log file | [
"Logs",
"given",
"request",
"and",
"responds",
"parameters",
"to",
"log",
"file",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Caller.php#L207-L213 |
43,961 | OXID-eSales/paypal | Core/Caller.php | Caller.setRequest | public function setRequest(\OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request)
{
$this->setParameters($request->getData());
} | php | public function setRequest(\OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request)
{
$this->setParameters($request->getData());
} | [
"public",
"function",
"setRequest",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"PayPalRequest",
"\\",
"PayPalRequest",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"setParameters",
"(",
"$",
"request",
"->",
"getData",
"(",
")",
")",... | Set parameter from request.
@param \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request request | [
"Set",
"parameter",
"from",
"request",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Caller.php#L220-L223 |
43,962 | OXID-eSales/paypal | Core/Events.php | Events.addPaymentMethod | public static function addPaymentMethod()
{
$paymentDescriptions = array(
'en' => '<div>When selecting this payment method you are being redirected to PayPal where you can login into your account or open a new account. In PayPal you are able to authorize the payment. As soon you have authorized the payment, you are again redirected to our shop where you can confirm your order.</div> <div style="margin-top: 5px">Only after confirming the order, transfer of money takes place.</div>',
'de' => '<div>Bei Auswahl der Zahlungsart PayPal werden Sie im nächsten Schritt zu PayPal weitergeleitet. Dort können Sie sich in Ihr PayPal-Konto einloggen oder ein neues PayPal-Konto eröffnen und die Zahlung autorisieren. Sobald Sie Ihre Daten für die Zahlung bestätigt haben, werden Sie automatisch wieder zurück in den Shop geleitet, um die Bestellung abzuschließen.</div> <div style="margin-top: 5px">Erst dann wird die Zahlung ausgeführt.</div>'
);
$payment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
if (!$payment->load('oxidpaypal')) {
$payment->setId('oxidpaypal');
$payment->oxpayments__oxactive = new \OxidEsales\Eshop\Core\Field(1);
$payment->oxpayments__oxdesc = new \OxidEsales\Eshop\Core\Field('PayPal');
$payment->oxpayments__oxaddsum = new \OxidEsales\Eshop\Core\Field(0);
$payment->oxpayments__oxaddsumtype = new \OxidEsales\Eshop\Core\Field('abs');
$payment->oxpayments__oxfromboni = new \OxidEsales\Eshop\Core\Field(0);
$payment->oxpayments__oxfromamount = new \OxidEsales\Eshop\Core\Field(0);
$payment->oxpayments__oxtoamount = new \OxidEsales\Eshop\Core\Field(10000);
$language = \OxidEsales\Eshop\Core\Registry::getLang();
$languages = $language->getLanguageIds();
foreach ($paymentDescriptions as $languageAbbreviation => $description) {
$languageId = array_search($languageAbbreviation, $languages);
if ($languageId !== false) {
$payment->setLanguage($languageId);
$payment->oxpayments__oxlongdesc = new \OxidEsales\Eshop\Core\Field($description);
$payment->save();
}
}
}
} | php | public static function addPaymentMethod()
{
$paymentDescriptions = array(
'en' => '<div>When selecting this payment method you are being redirected to PayPal where you can login into your account or open a new account. In PayPal you are able to authorize the payment. As soon you have authorized the payment, you are again redirected to our shop where you can confirm your order.</div> <div style="margin-top: 5px">Only after confirming the order, transfer of money takes place.</div>',
'de' => '<div>Bei Auswahl der Zahlungsart PayPal werden Sie im nächsten Schritt zu PayPal weitergeleitet. Dort können Sie sich in Ihr PayPal-Konto einloggen oder ein neues PayPal-Konto eröffnen und die Zahlung autorisieren. Sobald Sie Ihre Daten für die Zahlung bestätigt haben, werden Sie automatisch wieder zurück in den Shop geleitet, um die Bestellung abzuschließen.</div> <div style="margin-top: 5px">Erst dann wird die Zahlung ausgeführt.</div>'
);
$payment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
if (!$payment->load('oxidpaypal')) {
$payment->setId('oxidpaypal');
$payment->oxpayments__oxactive = new \OxidEsales\Eshop\Core\Field(1);
$payment->oxpayments__oxdesc = new \OxidEsales\Eshop\Core\Field('PayPal');
$payment->oxpayments__oxaddsum = new \OxidEsales\Eshop\Core\Field(0);
$payment->oxpayments__oxaddsumtype = new \OxidEsales\Eshop\Core\Field('abs');
$payment->oxpayments__oxfromboni = new \OxidEsales\Eshop\Core\Field(0);
$payment->oxpayments__oxfromamount = new \OxidEsales\Eshop\Core\Field(0);
$payment->oxpayments__oxtoamount = new \OxidEsales\Eshop\Core\Field(10000);
$language = \OxidEsales\Eshop\Core\Registry::getLang();
$languages = $language->getLanguageIds();
foreach ($paymentDescriptions as $languageAbbreviation => $description) {
$languageId = array_search($languageAbbreviation, $languages);
if ($languageId !== false) {
$payment->setLanguage($languageId);
$payment->oxpayments__oxlongdesc = new \OxidEsales\Eshop\Core\Field($description);
$payment->save();
}
}
}
} | [
"public",
"static",
"function",
"addPaymentMethod",
"(",
")",
"{",
"$",
"paymentDescriptions",
"=",
"array",
"(",
"'en'",
"=>",
"'<div>When selecting this payment method you are being redirected to PayPal where you can login into your account or open a new account. In PayPal you are able... | Add PayPal payment method set EN and DE long descriptions | [
"Add",
"PayPal",
"payment",
"method",
"set",
"EN",
"and",
"DE",
"long",
"descriptions"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Events.php#L54-L83 |
43,963 | OXID-eSales/paypal | Core/Events.php | Events.isPayPalActiveOnSubShops | public static function isPayPalActiveOnSubShops()
{
$active = false;
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$extensionChecker = oxNew(\OxidEsales\PayPalModule\Core\ExtensionChecker::class);
$shops = $config->getShopIds();
$activeShopId = $config->getShopId();
foreach ($shops as $shopId) {
if ($shopId != $activeShopId) {
$extensionChecker->setShopId($shopId);
$extensionChecker->setExtensionId('oepaypal');
if ($extensionChecker->isActive()) {
$active = true;
break;
}
}
}
return $active;
} | php | public static function isPayPalActiveOnSubShops()
{
$active = false;
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$extensionChecker = oxNew(\OxidEsales\PayPalModule\Core\ExtensionChecker::class);
$shops = $config->getShopIds();
$activeShopId = $config->getShopId();
foreach ($shops as $shopId) {
if ($shopId != $activeShopId) {
$extensionChecker->setShopId($shopId);
$extensionChecker->setExtensionId('oepaypal');
if ($extensionChecker->isActive()) {
$active = true;
break;
}
}
}
return $active;
} | [
"public",
"static",
"function",
"isPayPalActiveOnSubShops",
"(",
")",
"{",
"$",
"active",
"=",
"false",
";",
"$",
"config",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"extensionChecker",
"... | Check if PayPal is used for sub-shops.
@return bool | [
"Check",
"if",
"PayPal",
"is",
"used",
"for",
"sub",
"-",
"shops",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Events.php#L90-L110 |
43,964 | OXID-eSales/paypal | Core/Events.php | Events.disablePaymentMethod | public static function disablePaymentMethod()
{
$payment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
if ($payment->load('oxidpaypal')) {
$payment->oxpayments__oxactive = new \OxidEsales\Eshop\Core\Field(0);
$payment->save();
}
} | php | public static function disablePaymentMethod()
{
$payment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
if ($payment->load('oxidpaypal')) {
$payment->oxpayments__oxactive = new \OxidEsales\Eshop\Core\Field(0);
$payment->save();
}
} | [
"public",
"static",
"function",
"disablePaymentMethod",
"(",
")",
"{",
"$",
"payment",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Payment",
"::",
"class",
")",
";",
"if",
"(",
"$",
"payment",
"->",
"l... | Disables PayPal payment method | [
"Disables",
"PayPal",
"payment",
"method"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Events.php#L115-L122 |
43,965 | OXID-eSales/paypal | Core/Events.php | Events.enablePayPalRDFA | public static function enablePayPalRDFA()
{
// If PayPal activated on other sub shops do not change global RDF setting.
if ('EE' == \OxidEsales\Eshop\Core\Registry::getConfig()->getEdition() && self::isPayPalActiveOnSubShops()) {
return;
}
$query = "INSERT IGNORE INTO `oxobject2payment` (`OXID`, `OXPAYMENTID`, `OXOBJECTID`, `OXTYPE`) VALUES('oepaypalrdfa', 'oxidpaypal', 'PayPal', 'rdfapayment')";
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->execute($query);
} | php | public static function enablePayPalRDFA()
{
// If PayPal activated on other sub shops do not change global RDF setting.
if ('EE' == \OxidEsales\Eshop\Core\Registry::getConfig()->getEdition() && self::isPayPalActiveOnSubShops()) {
return;
}
$query = "INSERT IGNORE INTO `oxobject2payment` (`OXID`, `OXPAYMENTID`, `OXOBJECTID`, `OXTYPE`) VALUES('oepaypalrdfa', 'oxidpaypal', 'PayPal', 'rdfapayment')";
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->execute($query);
} | [
"public",
"static",
"function",
"enablePayPalRDFA",
"(",
")",
"{",
"// If PayPal activated on other sub shops do not change global RDF setting.",
"if",
"(",
"'EE'",
"==",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"... | Enables PayPal RDF
@return null | [
"Enables",
"PayPal",
"RDF"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Events.php#L184-L193 |
43,966 | OXID-eSales/paypal | Core/Events.php | Events.addMissingFieldsOnUpdate | public static function addMissingFieldsOnUpdate()
{
$dbMetaDataHandler = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
$tableFields = array(
'oepaypal_order' => 'OEPAYPAL_TIMESTAMP',
'oepaypal_orderpayments' => 'OEPAYPAL_TIMESTAMP',
'oepaypal_orderpaymentcomments' => 'OEPAYPAL_TIMESTAMP',
);
foreach ($tableFields as $tableName => $fieldName) {
if (!$dbMetaDataHandler->fieldExists($fieldName, $tableName)) {
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->execute(
"ALTER TABLE `" . $tableName
. "` ADD `" . $fieldName . "` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;"
);
}
}
} | php | public static function addMissingFieldsOnUpdate()
{
$dbMetaDataHandler = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
$tableFields = array(
'oepaypal_order' => 'OEPAYPAL_TIMESTAMP',
'oepaypal_orderpayments' => 'OEPAYPAL_TIMESTAMP',
'oepaypal_orderpaymentcomments' => 'OEPAYPAL_TIMESTAMP',
);
foreach ($tableFields as $tableName => $fieldName) {
if (!$dbMetaDataHandler->fieldExists($fieldName, $tableName)) {
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->execute(
"ALTER TABLE `" . $tableName
. "` ADD `" . $fieldName . "` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;"
);
}
}
} | [
"public",
"static",
"function",
"addMissingFieldsOnUpdate",
"(",
")",
"{",
"$",
"dbMetaDataHandler",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DbMetaDataHandler",
"::",
"class",
")",
";",
"$",
"tableFields",
"=",
"array",
"(",
... | Add missing field if it activates on old DB | [
"Add",
"missing",
"field",
"if",
"it",
"activates",
"on",
"old",
"DB"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Events.php#L208-L226 |
43,967 | OXID-eSales/paypal | Core/Events.php | Events.onDeactivate | public static function onDeactivate()
{
// If PayPal activated on other sub shops do not remove payment method and RDF setting
if ('EE' == \OxidEsales\Eshop\Core\Registry::getConfig()->getEdition() && self::isPayPalActiveOnSubShops()) {
return;
}
self::disablePaymentMethod();
self::disablePayPalRDFA();
self::deleteSessionBasket();
} | php | public static function onDeactivate()
{
// If PayPal activated on other sub shops do not remove payment method and RDF setting
if ('EE' == \OxidEsales\Eshop\Core\Registry::getConfig()->getEdition() && self::isPayPalActiveOnSubShops()) {
return;
}
self::disablePaymentMethod();
self::disablePayPalRDFA();
self::deleteSessionBasket();
} | [
"public",
"static",
"function",
"onDeactivate",
"(",
")",
"{",
"// If PayPal activated on other sub shops do not remove payment method and RDF setting",
"if",
"(",
"'EE'",
"==",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
"... | Execute action on deactivate event
@return null | [
"Execute",
"action",
"on",
"deactivate",
"event"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Events.php#L305-L314 |
43,968 | OXID-eSales/paypal | Model/IPNPaymentBuilder.php | IPNPaymentBuilder.getOrderPaymentSetter | public function getOrderPaymentSetter()
{
if (is_null($this->payPalIPNPaymentSetter)) {
$payPalIPNPaymentSetter = oxNew(\OxidEsales\PayPalModule\Model\IPNRequestPaymentSetter::class);
$this->setOrderPaymentSetter($payPalIPNPaymentSetter);
}
return $this->payPalIPNPaymentSetter;
} | php | public function getOrderPaymentSetter()
{
if (is_null($this->payPalIPNPaymentSetter)) {
$payPalIPNPaymentSetter = oxNew(\OxidEsales\PayPalModule\Model\IPNRequestPaymentSetter::class);
$this->setOrderPaymentSetter($payPalIPNPaymentSetter);
}
return $this->payPalIPNPaymentSetter;
} | [
"public",
"function",
"getOrderPaymentSetter",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"payPalIPNPaymentSetter",
")",
")",
"{",
"$",
"payPalIPNPaymentSetter",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\"... | Creates and sets \OxidEsales\PayPalModule\Model\IPNRequestPaymentSetter object if it was not set.
@return \OxidEsales\PayPalModule\Model\IPNRequestPaymentSetter | [
"Creates",
"and",
"sets",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"IPNRequestPaymentSetter",
"object",
"if",
"it",
"was",
"not",
"set",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentBuilder.php#L62-L70 |
43,969 | OXID-eSales/paypal | Model/IPNPaymentBuilder.php | IPNPaymentBuilder.getOrderPaymentValidator | public function getOrderPaymentValidator()
{
if (is_null($this->payPalIPNPaymentValidator)) {
$payPalIPNPaymentValidator = oxNew(\OxidEsales\PayPalModule\Model\IPNPaymentValidator::class);
$this->setOrderPaymentValidator($payPalIPNPaymentValidator);
}
return $this->payPalIPNPaymentValidator;
} | php | public function getOrderPaymentValidator()
{
if (is_null($this->payPalIPNPaymentValidator)) {
$payPalIPNPaymentValidator = oxNew(\OxidEsales\PayPalModule\Model\IPNPaymentValidator::class);
$this->setOrderPaymentValidator($payPalIPNPaymentValidator);
}
return $this->payPalIPNPaymentValidator;
} | [
"public",
"function",
"getOrderPaymentValidator",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"payPalIPNPaymentValidator",
")",
")",
"{",
"$",
"payPalIPNPaymentValidator",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model... | Creates and sets \OxidEsales\PayPalModule\Model\IPNPaymentValidator object if it was not set.
@return \OxidEsales\PayPalModule\Model\IPNPaymentValidator | [
"Creates",
"and",
"sets",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"IPNPaymentValidator",
"object",
"if",
"it",
"was",
"not",
"set",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentBuilder.php#L87-L95 |
43,970 | OXID-eSales/paypal | Model/IPNPaymentBuilder.php | IPNPaymentBuilder.getPaymentCreator | public function getPaymentCreator()
{
if (is_null($this->payPalIPNPaymentCreator)) {
$payPalIPNPaymentCreator = oxNew(\OxidEsales\PayPalModule\Model\IPNPaymentCreator::class);
$payPalIPNPaymentCreator->setRequest($this->getRequest());
$this->setPaymentCreator($payPalIPNPaymentCreator);
}
return $this->payPalIPNPaymentCreator;
} | php | public function getPaymentCreator()
{
if (is_null($this->payPalIPNPaymentCreator)) {
$payPalIPNPaymentCreator = oxNew(\OxidEsales\PayPalModule\Model\IPNPaymentCreator::class);
$payPalIPNPaymentCreator->setRequest($this->getRequest());
$this->setPaymentCreator($payPalIPNPaymentCreator);
}
return $this->payPalIPNPaymentCreator;
} | [
"public",
"function",
"getPaymentCreator",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"payPalIPNPaymentCreator",
")",
")",
"{",
"$",
"payPalIPNPaymentCreator",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
... | Creates and sets \OxidEsales\PayPalModule\Model\IPNPaymentCreator object if it was not set.
@return \OxidEsales\PayPalModule\Model\IPNPaymentCreator | [
"Creates",
"and",
"sets",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"IPNPaymentCreator",
"object",
"if",
"it",
"was",
"not",
"set",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentBuilder.php#L112-L121 |
43,971 | OXID-eSales/paypal | Model/IPNPaymentBuilder.php | IPNPaymentBuilder.buildPayment | public function buildPayment()
{
$return = null;
// Setter forms request payment from request parameters.
$requestOrderPayment = $this->prepareRequestOrderPayment();
// Create order payment from database to check if it match created from request.
$orderPayment = $this->loadOrderPayment($requestOrderPayment->getTransactionId());
// Only need validate if there is order in database.
// If request payment do not have matching payment with order return null.
if ($orderPayment->getOrderId()) {
// Validator change request payment by adding information if it is valid.
$orderPayment = $this->addPaymentValidationInformation($requestOrderPayment, $orderPayment);
$orderPayment = $this->changePaymentStatusInfo($requestOrderPayment, $orderPayment);
$orderPayment->save();
$return = $orderPayment;
} else {
//IPN request might be for a transaction that does not yet exist in the shop database.
$paymentCreator = $this->getPaymentCreator();
$return = $paymentCreator->handleOrderPayment($requestOrderPayment);
}
return $return;
} | php | public function buildPayment()
{
$return = null;
// Setter forms request payment from request parameters.
$requestOrderPayment = $this->prepareRequestOrderPayment();
// Create order payment from database to check if it match created from request.
$orderPayment = $this->loadOrderPayment($requestOrderPayment->getTransactionId());
// Only need validate if there is order in database.
// If request payment do not have matching payment with order return null.
if ($orderPayment->getOrderId()) {
// Validator change request payment by adding information if it is valid.
$orderPayment = $this->addPaymentValidationInformation($requestOrderPayment, $orderPayment);
$orderPayment = $this->changePaymentStatusInfo($requestOrderPayment, $orderPayment);
$orderPayment->save();
$return = $orderPayment;
} else {
//IPN request might be for a transaction that does not yet exist in the shop database.
$paymentCreator = $this->getPaymentCreator();
$return = $paymentCreator->handleOrderPayment($requestOrderPayment);
}
return $return;
} | [
"public",
"function",
"buildPayment",
"(",
")",
"{",
"$",
"return",
"=",
"null",
";",
"// Setter forms request payment from request parameters.",
"$",
"requestOrderPayment",
"=",
"$",
"this",
"->",
"prepareRequestOrderPayment",
"(",
")",
";",
"// Create order payment from... | Create payment from given request.
@return \OxidEsales\PayPalModule\Model\OrderPayment|null | [
"Create",
"payment",
"from",
"given",
"request",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentBuilder.php#L168-L193 |
43,972 | OXID-eSales/paypal | Model/IPNPaymentBuilder.php | IPNPaymentBuilder.loadOrderPayment | protected function loadOrderPayment($transactionId)
{
$orderPayment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$orderPayment->loadByTransactionId($transactionId);
return $orderPayment;
} | php | protected function loadOrderPayment($transactionId)
{
$orderPayment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$orderPayment->loadByTransactionId($transactionId);
return $orderPayment;
} | [
"protected",
"function",
"loadOrderPayment",
"(",
"$",
"transactionId",
")",
"{",
"$",
"orderPayment",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"OrderPayment",
"::",
"class",
")",
";",
"$",
"orderPayment",
"->",
"loadBy... | Load order payment from transaction id.
@param string $transactionId transaction id to load object.
@return \OxidEsales\PayPalModule\Model\OrderPayment|null | [
"Load",
"order",
"payment",
"from",
"transaction",
"id",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentBuilder.php#L202-L208 |
43,973 | OXID-eSales/paypal | Model/IPNPaymentBuilder.php | IPNPaymentBuilder.prepareRequestOrderPayment | protected function prepareRequestOrderPayment()
{
$requestOrderPayment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$request = $this->getRequest();
$requestPaymentSetter = $this->getOrderPaymentSetter();
$requestPaymentSetter->setRequest($request);
$requestPaymentSetter->setRequestOrderPayment($requestOrderPayment);
$requestOrderPayment = $requestPaymentSetter->getRequestOrderPayment();
return $requestOrderPayment;
} | php | protected function prepareRequestOrderPayment()
{
$requestOrderPayment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$request = $this->getRequest();
$requestPaymentSetter = $this->getOrderPaymentSetter();
$requestPaymentSetter->setRequest($request);
$requestPaymentSetter->setRequestOrderPayment($requestOrderPayment);
$requestOrderPayment = $requestPaymentSetter->getRequestOrderPayment();
return $requestOrderPayment;
} | [
"protected",
"function",
"prepareRequestOrderPayment",
"(",
")",
"{",
"$",
"requestOrderPayment",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"OrderPayment",
"::",
"class",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",... | Wrapper to set parameters to order payment from request.
@return \OxidEsales\PayPalModule\Model\OrderPayment | [
"Wrapper",
"to",
"set",
"parameters",
"to",
"order",
"payment",
"from",
"request",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentBuilder.php#L215-L227 |
43,974 | OXID-eSales/paypal | Model/IPNPaymentBuilder.php | IPNPaymentBuilder.addPaymentValidationInformation | protected function addPaymentValidationInformation($requestOrderPayment, $orderPayment)
{
$lang = $this->getLang();
$paymentValidator = $this->getOrderPaymentValidator();
$paymentValidator->setRequestOrderPayment($requestOrderPayment);
$paymentValidator->setOrderPayment($orderPayment);
$paymentValidator->setLang($lang);
$paymentIsValid = $paymentValidator->isValid();
if (!$paymentIsValid) {
$orderPayment->setIsValid($paymentIsValid);
$comment = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentComment::class);
$comment->setComment($paymentValidator->getValidationFailureMessage());
$orderPayment->addComment($comment);
}
return $orderPayment;
} | php | protected function addPaymentValidationInformation($requestOrderPayment, $orderPayment)
{
$lang = $this->getLang();
$paymentValidator = $this->getOrderPaymentValidator();
$paymentValidator->setRequestOrderPayment($requestOrderPayment);
$paymentValidator->setOrderPayment($orderPayment);
$paymentValidator->setLang($lang);
$paymentIsValid = $paymentValidator->isValid();
if (!$paymentIsValid) {
$orderPayment->setIsValid($paymentIsValid);
$comment = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentComment::class);
$comment->setComment($paymentValidator->getValidationFailureMessage());
$orderPayment->addComment($comment);
}
return $orderPayment;
} | [
"protected",
"function",
"addPaymentValidationInformation",
"(",
"$",
"requestOrderPayment",
",",
"$",
"orderPayment",
")",
"{",
"$",
"lang",
"=",
"$",
"this",
"->",
"getLang",
"(",
")",
";",
"$",
"paymentValidator",
"=",
"$",
"this",
"->",
"getOrderPaymentValid... | Adds payment validation information.
@param \OxidEsales\PayPalModule\Model\OrderPayment $requestOrderPayment
@param \OxidEsales\PayPalModule\Model\OrderPayment $orderPayment
@return \OxidEsales\PayPalModule\Model\OrderPayment | [
"Adds",
"payment",
"validation",
"information",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentBuilder.php#L237-L255 |
43,975 | OXID-eSales/paypal | Core/IpnConfig.php | IpnConfig.getPayPalIpnHost | public function getPayPalIpnHost()
{
if (empty($this->payPalIpnHost)) {
$this->payPalIpnHost = self::OEPAYPAL_IPN_HOST;
}
return $this->payPalIpnHost;
} | php | public function getPayPalIpnHost()
{
if (empty($this->payPalIpnHost)) {
$this->payPalIpnHost = self::OEPAYPAL_IPN_HOST;
}
return $this->payPalIpnHost;
} | [
"public",
"function",
"getPayPalIpnHost",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"payPalIpnHost",
")",
")",
"{",
"$",
"this",
"->",
"payPalIpnHost",
"=",
"self",
"::",
"OEPAYPAL_IPN_HOST",
";",
"}",
"return",
"$",
"this",
"->",
"payPa... | Returns PayPal IPN host.
@return string | [
"Returns",
"PayPal",
"IPN",
"host",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/IpnConfig.php#L155-L162 |
43,976 | OXID-eSales/paypal | Core/IpnConfig.php | IpnConfig.getIpnHost | public function getIpnHost()
{
if ($this->getPayPalConfig()->isSandboxEnabled()) {
$url = $this->getPayPalSandboxIpnHost();
} else {
$url = $this->getPayPalIpnHost();
}
return $url;
} | php | public function getIpnHost()
{
if ($this->getPayPalConfig()->isSandboxEnabled()) {
$url = $this->getPayPalSandboxIpnHost();
} else {
$url = $this->getPayPalIpnHost();
}
return $url;
} | [
"public",
"function",
"getIpnHost",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getPayPalConfig",
"(",
")",
"->",
"isSandboxEnabled",
"(",
")",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getPayPalSandboxIpnHost",
"(",
")",
";",
"}",
"else",
"{",
... | Returns PayPal OR PayPal IPN sandbox host.
@return string | [
"Returns",
"PayPal",
"OR",
"PayPal",
"IPN",
"sandbox",
"host",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/IpnConfig.php#L193-L202 |
43,977 | OXID-eSales/paypal | Core/IpnConfig.php | IpnConfig.getPayPalIpnUrl | public function getPayPalIpnUrl()
{
if (empty($this->payPalIpnUrl)) {
$this->payPalIpnUrl = self::OEPAYPAL_IPN_CALLBACK_URL;
}
return $this->payPalIpnUrl;
} | php | public function getPayPalIpnUrl()
{
if (empty($this->payPalIpnUrl)) {
$this->payPalIpnUrl = self::OEPAYPAL_IPN_CALLBACK_URL;
}
return $this->payPalIpnUrl;
} | [
"public",
"function",
"getPayPalIpnUrl",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"payPalIpnUrl",
")",
")",
"{",
"$",
"this",
"->",
"payPalIpnUrl",
"=",
"self",
"::",
"OEPAYPAL_IPN_CALLBACK_URL",
";",
"}",
"return",
"$",
"this",
"->",
"... | IPN Url getter
@return string | [
"IPN",
"Url",
"getter"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/IpnConfig.php#L219-L226 |
43,978 | OXID-eSales/paypal | Core/IpnConfig.php | IpnConfig.getPayPalSandboxIpnUrl | public function getPayPalSandboxIpnUrl()
{
if (empty($this->payPalSandboxIpnUrl)) {
$this->payPalSandboxIpnUrl = self::OEPAYPAL_SANDBOX_IPN_CALLBACK_URL;
}
return $this->payPalSandboxIpnUrl;
} | php | public function getPayPalSandboxIpnUrl()
{
if (empty($this->payPalSandboxIpnUrl)) {
$this->payPalSandboxIpnUrl = self::OEPAYPAL_SANDBOX_IPN_CALLBACK_URL;
}
return $this->payPalSandboxIpnUrl;
} | [
"public",
"function",
"getPayPalSandboxIpnUrl",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"payPalSandboxIpnUrl",
")",
")",
"{",
"$",
"this",
"->",
"payPalSandboxIpnUrl",
"=",
"self",
"::",
"OEPAYPAL_SANDBOX_IPN_CALLBACK_URL",
";",
"}",
"return",... | PayPal sandbox IPN url getter
@return string | [
"PayPal",
"sandbox",
"IPN",
"url",
"getter"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/IpnConfig.php#L243-L250 |
43,979 | OXID-eSales/paypal | Core/IpnConfig.php | IpnConfig.getPayPalConfig | protected function getPayPalConfig()
{
if (is_null($this->payPalConfig)) {
$this->payPalConfig = oxNew(\OxidEsales\PayPalModule\Core\Config::class);
}
return $this->payPalConfig;
} | php | protected function getPayPalConfig()
{
if (is_null($this->payPalConfig)) {
$this->payPalConfig = oxNew(\OxidEsales\PayPalModule\Core\Config::class);
}
return $this->payPalConfig;
} | [
"protected",
"function",
"getPayPalConfig",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"payPalConfig",
")",
")",
"{",
"$",
"this",
"->",
"payPalConfig",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Core",
"\\",
"C... | Getter for oepaypal config.
@return \OxidEsales\PayPalModule\Core\Config | [
"Getter",
"for",
"oepaypal",
"config",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/IpnConfig.php#L283-L290 |
43,980 | OXID-eSales/paypal | Model/Action/OrderAction.php | OrderAction.getDate | public function getDate()
{
$utilsDate = \OxidEsales\Eshop\Core\Registry::getUtilsDate();
return date('Y-m-d H:i:s', $utilsDate->getTime());
} | php | public function getDate()
{
$utilsDate = \OxidEsales\Eshop\Core\Registry::getUtilsDate();
return date('Y-m-d H:i:s', $utilsDate->getTime());
} | [
"public",
"function",
"getDate",
"(",
")",
"{",
"$",
"utilsDate",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsDate",
"(",
")",
";",
"return",
"date",
"(",
"'Y-m-d H:i:s'",
",",
"$",
"utilsDate",
"->",
"getTime",
... | Returns formatted date
@return string | [
"Returns",
"formatted",
"date"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/OrderAction.php#L82-L87 |
43,981 | OXID-eSales/paypal | Core/ExtensionChecker.php | ExtensionChecker.getShopId | public function getShopId()
{
if (is_null($this->shopId)) {
$this->setShopId(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId());
}
return $this->shopId;
} | php | public function getShopId()
{
if (is_null($this->shopId)) {
$this->setShopId(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId());
}
return $this->shopId;
} | [
"public",
"function",
"getShopId",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"shopId",
")",
")",
"{",
"$",
"this",
"->",
"setShopId",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
"... | Return shop id
@return string | [
"Return",
"shop",
"id"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ExtensionChecker.php#L58-L65 |
43,982 | OXID-eSales/paypal | Core/ExtensionChecker.php | ExtensionChecker.getConfigValue | protected function getConfigValue($configName)
{
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$configKey = $config->getConfigParam('sConfigKey');
$select = "SELECT DECODE( `oxvarvalue` , " . $db->quote($configKey) . " ) AS `oxvarvalue` " .
"FROM `oxconfig` WHERE `oxvarname` = " . $db->quote($configName) . " AND `oxshopid` = " . $db->quote($this->getShopId());
return unserialize($db->getOne($select));
} | php | protected function getConfigValue($configName)
{
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$configKey = $config->getConfigParam('sConfigKey');
$select = "SELECT DECODE( `oxvarvalue` , " . $db->quote($configKey) . " ) AS `oxvarvalue` " .
"FROM `oxconfig` WHERE `oxvarname` = " . $db->quote($configName) . " AND `oxshopid` = " . $db->quote($this->getShopId());
return unserialize($db->getOne($select));
} | [
"protected",
"function",
"getConfigValue",
"(",
"$",
"configName",
")",
"{",
"$",
"db",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"config",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"... | Return config value
@param string $configName - config parameter name were stored arrays od extended classes
@return array | [
"Return",
"config",
"value"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ExtensionChecker.php#L114-L124 |
43,983 | OXID-eSales/paypal | Core/ExtensionChecker.php | ExtensionChecker.isActive | public function isActive()
{
$moduleId = $this->getExtensionId();
$moduleIsActive = false;
$modules = $this->getExtendedClasses();
if (is_array($modules)) {
// Check if module was ever installed.
$moduleExists = false;
foreach ($modules as $extendPath) {
if (false !== strpos($extendPath, '/' . $moduleId . '/')) {
$moduleExists = true;
break;
}
}
// If module exists, check if it is not disabled.
if ($moduleExists) {
$disabledModules = $this->getDisabledModules();
if (!(is_array($disabledModules) && in_array($moduleId, $disabledModules))) {
$moduleIsActive = true;
}
}
}
return $moduleIsActive;
} | php | public function isActive()
{
$moduleId = $this->getExtensionId();
$moduleIsActive = false;
$modules = $this->getExtendedClasses();
if (is_array($modules)) {
// Check if module was ever installed.
$moduleExists = false;
foreach ($modules as $extendPath) {
if (false !== strpos($extendPath, '/' . $moduleId . '/')) {
$moduleExists = true;
break;
}
}
// If module exists, check if it is not disabled.
if ($moduleExists) {
$disabledModules = $this->getDisabledModules();
if (!(is_array($disabledModules) && in_array($moduleId, $disabledModules))) {
$moduleIsActive = true;
}
}
}
return $moduleIsActive;
} | [
"public",
"function",
"isActive",
"(",
")",
"{",
"$",
"moduleId",
"=",
"$",
"this",
"->",
"getExtensionId",
"(",
")",
";",
"$",
"moduleIsActive",
"=",
"false",
";",
"$",
"modules",
"=",
"$",
"this",
"->",
"getExtendedClasses",
"(",
")",
";",
"if",
"(",... | Check if module is active.
@return bool | [
"Check",
"if",
"module",
"is",
"active",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ExtensionChecker.php#L131-L158 |
43,984 | OXID-eSales/paypal | Model/IPNRequestValidator.php | IPNRequestValidator.getValidationFailureMessage | public function getValidationFailureMessage()
{
$payPalRequest = $this->getPayPalRequest();
$payPalResponse = $this->getPayPalResponse();
$shopOwnerUserName = $this->getShopOwnerUserName();
$receiverEmailPayPal = $payPalRequest[self::RECEIVER_EMAIL];
$validationMessage = array(
'Shop owner' => (string) $shopOwnerUserName,
'PayPal ID' => (string) $receiverEmailPayPal,
'PayPal ACK' => ($payPalResponse->isPayPalAck() ? 'VERIFIED' : 'NOT VERIFIED'),
'PayPal Full Request' => print_r($payPalRequest, true),
'PayPal Full Response' => print_r($payPalResponse->getData(), true),
);
return $validationMessage;
} | php | public function getValidationFailureMessage()
{
$payPalRequest = $this->getPayPalRequest();
$payPalResponse = $this->getPayPalResponse();
$shopOwnerUserName = $this->getShopOwnerUserName();
$receiverEmailPayPal = $payPalRequest[self::RECEIVER_EMAIL];
$validationMessage = array(
'Shop owner' => (string) $shopOwnerUserName,
'PayPal ID' => (string) $receiverEmailPayPal,
'PayPal ACK' => ($payPalResponse->isPayPalAck() ? 'VERIFIED' : 'NOT VERIFIED'),
'PayPal Full Request' => print_r($payPalRequest, true),
'PayPal Full Response' => print_r($payPalResponse->getData(), true),
);
return $validationMessage;
} | [
"public",
"function",
"getValidationFailureMessage",
"(",
")",
"{",
"$",
"payPalRequest",
"=",
"$",
"this",
"->",
"getPayPalRequest",
"(",
")",
";",
"$",
"payPalResponse",
"=",
"$",
"this",
"->",
"getPayPalResponse",
"(",
")",
";",
"$",
"shopOwnerUserName",
"=... | Returns validation failure messages.
@return array | [
"Returns",
"validation",
"failure",
"messages",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNRequestValidator.php#L122-L138 |
43,985 | OXID-eSales/paypal | Model/IPNRequestValidator.php | IPNRequestValidator.isValid | public function isValid()
{
$payPalRequest = $this->getPayPalRequest();
$payPalResponse = $this->getPayPalResponse();
$shopOwnerUserName = $this->getShopOwnerUserName();
$receiverEmailPayPal = $payPalRequest[self::RECEIVER_EMAIL];
return ($payPalResponse->isPayPalAck() && $receiverEmailPayPal == $shopOwnerUserName);
} | php | public function isValid()
{
$payPalRequest = $this->getPayPalRequest();
$payPalResponse = $this->getPayPalResponse();
$shopOwnerUserName = $this->getShopOwnerUserName();
$receiverEmailPayPal = $payPalRequest[self::RECEIVER_EMAIL];
return ($payPalResponse->isPayPalAck() && $receiverEmailPayPal == $shopOwnerUserName);
} | [
"public",
"function",
"isValid",
"(",
")",
"{",
"$",
"payPalRequest",
"=",
"$",
"this",
"->",
"getPayPalRequest",
"(",
")",
";",
"$",
"payPalResponse",
"=",
"$",
"this",
"->",
"getPayPalResponse",
"(",
")",
";",
"$",
"shopOwnerUserName",
"=",
"$",
"this",
... | Validate if IPN request from PayPal and to correct shop.
@return bool | [
"Validate",
"if",
"IPN",
"request",
"from",
"PayPal",
"and",
"to",
"correct",
"shop",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNRequestValidator.php#L145-L153 |
43,986 | OXID-eSales/paypal | Model/IPNPaymentValidator.php | IPNPaymentValidator.getValidationFailureMessage | public function getValidationFailureMessage()
{
$requestPayment = $this->getRequestOrderPayment();
$orderPayment = $this->getOrderPayment();
$currencyPayPal = $requestPayment->getCurrency();
$pricePayPal = $requestPayment->getAmount();
$currencyPayment = $orderPayment->getCurrency();
$amountPayment = $orderPayment->getAmount();
$lang = $this->getLang();
$validationMessage = $lang->translateString('OEPAYPAL_PAYMENT_INFORMATION') . ': ' . $amountPayment . ' ' . $currencyPayment . '. ' . $lang->translateString('OEPAYPAL_INFORMATION') . ': ' . $pricePayPal . ' ' . $currencyPayPal . '.';
return $validationMessage;
} | php | public function getValidationFailureMessage()
{
$requestPayment = $this->getRequestOrderPayment();
$orderPayment = $this->getOrderPayment();
$currencyPayPal = $requestPayment->getCurrency();
$pricePayPal = $requestPayment->getAmount();
$currencyPayment = $orderPayment->getCurrency();
$amountPayment = $orderPayment->getAmount();
$lang = $this->getLang();
$validationMessage = $lang->translateString('OEPAYPAL_PAYMENT_INFORMATION') . ': ' . $amountPayment . ' ' . $currencyPayment . '. ' . $lang->translateString('OEPAYPAL_INFORMATION') . ': ' . $pricePayPal . ' ' . $currencyPayPal . '.';
return $validationMessage;
} | [
"public",
"function",
"getValidationFailureMessage",
"(",
")",
"{",
"$",
"requestPayment",
"=",
"$",
"this",
"->",
"getRequestOrderPayment",
"(",
")",
";",
"$",
"orderPayment",
"=",
"$",
"this",
"->",
"getOrderPayment",
"(",
")",
";",
"$",
"currencyPayPal",
"=... | Returns validation failure message.
@return string | [
"Returns",
"validation",
"failure",
"message",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentValidator.php#L115-L130 |
43,987 | OXID-eSales/paypal | Model/IPNPaymentValidator.php | IPNPaymentValidator.isValid | public function isValid()
{
$requestPayment = $this->getRequestOrderPayment();
$orderPayment = $this->getOrderPayment();
$currencyPayPal = $requestPayment->getCurrency();
$pricePayPal = $requestPayment->getAmount();
$currencyPayment = $orderPayment->getCurrency();
$amountPayment = $orderPayment->getAmount();
return ($currencyPayPal == $currencyPayment && $pricePayPal == $amountPayment);
} | php | public function isValid()
{
$requestPayment = $this->getRequestOrderPayment();
$orderPayment = $this->getOrderPayment();
$currencyPayPal = $requestPayment->getCurrency();
$pricePayPal = $requestPayment->getAmount();
$currencyPayment = $orderPayment->getCurrency();
$amountPayment = $orderPayment->getAmount();
return ($currencyPayPal == $currencyPayment && $pricePayPal == $amountPayment);
} | [
"public",
"function",
"isValid",
"(",
")",
"{",
"$",
"requestPayment",
"=",
"$",
"this",
"->",
"getRequestOrderPayment",
"(",
")",
";",
"$",
"orderPayment",
"=",
"$",
"this",
"->",
"getOrderPayment",
"(",
")",
";",
"$",
"currencyPayPal",
"=",
"$",
"request... | Check if PayPal response fits payment information.
@return bool | [
"Check",
"if",
"PayPal",
"response",
"fits",
"payment",
"information",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNPaymentValidator.php#L137-L149 |
43,988 | OXID-eSales/paypal | Controller/FrontendController.php | FrontendController.getRequest | public function getRequest()
{
if (is_null($this->request)) {
$this->request = oxNew(\OxidEsales\PayPalModule\Core\Request::class);
}
return $this->request;
} | php | public function getRequest()
{
if (is_null($this->request)) {
$this->request = oxNew(\OxidEsales\PayPalModule\Core\Request::class);
}
return $this->request;
} | [
"public",
"function",
"getRequest",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"request",
")",
")",
"{",
"$",
"this",
"->",
"request",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Core",
"\\",
"Request",
"::",
... | Return request object
@return \OxidEsales\PayPalModule\Core\Request | [
"Return",
"request",
"object"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/FrontendController.php#L48-L55 |
43,989 | OXID-eSales/paypal | Controller/FrontendController.php | FrontendController.getLogger | public function getLogger()
{
if (is_null($this->logger)) {
$this->logger = oxNew(\OxidEsales\PayPalModule\Core\Logger::class);
$this->logger->setLoggerSessionId($this->getSession()->getId());
}
return $this->logger;
} | php | public function getLogger()
{
if (is_null($this->logger)) {
$this->logger = oxNew(\OxidEsales\PayPalModule\Core\Logger::class);
$this->logger->setLoggerSessionId($this->getSession()->getId());
}
return $this->logger;
} | [
"public",
"function",
"getLogger",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"logger",
")",
")",
"{",
"$",
"this",
"->",
"logger",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Core",
"\\",
"Logger",
"::",
"cl... | Return PayPal logger
@return \OxidEsales\PayPalModule\Core\Logger | [
"Return",
"PayPal",
"logger"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/FrontendController.php#L62-L70 |
43,990 | OXID-eSales/paypal | Model/Order.php | Order.loadPayPalOrder | public function loadPayPalOrder()
{
$orderId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("sess_challenge");
// if order is not created yet - generating it
if ($orderId === null) {
$orderId = \OxidEsales\Eshop\Core\UtilsObject::getInstance()->generateUID();
$this->setId($orderId);
$this->save();
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("sess_challenge", $orderId);
}
return $this->load($orderId);
} | php | public function loadPayPalOrder()
{
$orderId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("sess_challenge");
// if order is not created yet - generating it
if ($orderId === null) {
$orderId = \OxidEsales\Eshop\Core\UtilsObject::getInstance()->generateUID();
$this->setId($orderId);
$this->save();
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("sess_challenge", $orderId);
}
return $this->load($orderId);
} | [
"public",
"function",
"loadPayPalOrder",
"(",
")",
"{",
"$",
"orderId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getSession",
"(",
")",
"->",
"getVariable",
"(",
"\"sess_challenge\"",
")",
";",
"// if order is not created ye... | Loads order associated with current PayPal order
@return bool | [
"Loads",
"order",
"associated",
"with",
"current",
"PayPal",
"order"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L49-L62 |
43,991 | OXID-eSales/paypal | Model/Order.php | Order.oePayPalUpdateOrderNumber | public function oePayPalUpdateOrderNumber()
{
if ($this->oxorder__oxordernr->value) {
$updated = (bool) oxNew(\OxidEsales\Eshop\Core\Counter::class)->update($this->_getCounterIdent(), $this->oxorder__oxordernr->value);
} else {
$updated = $this->_setNumber();
}
return $updated;
} | php | public function oePayPalUpdateOrderNumber()
{
if ($this->oxorder__oxordernr->value) {
$updated = (bool) oxNew(\OxidEsales\Eshop\Core\Counter::class)->update($this->_getCounterIdent(), $this->oxorder__oxordernr->value);
} else {
$updated = $this->_setNumber();
}
return $updated;
} | [
"public",
"function",
"oePayPalUpdateOrderNumber",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"oxorder__oxordernr",
"->",
"value",
")",
"{",
"$",
"updated",
"=",
"(",
"bool",
")",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Co... | Updates order number.
@return bool | [
"Updates",
"order",
"number",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L69-L78 |
43,992 | OXID-eSales/paypal | Model/Order.php | Order.deletePayPalOrder | public function deletePayPalOrder()
{
$result = false;
if ($this->loadPayPalOrder()) {
$this->getPayPalOrder()->delete();
$result = $this->delete();
}
return $result;
} | php | public function deletePayPalOrder()
{
$result = false;
if ($this->loadPayPalOrder()) {
$this->getPayPalOrder()->delete();
$result = $this->delete();
}
return $result;
} | [
"public",
"function",
"deletePayPalOrder",
"(",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"loadPayPalOrder",
"(",
")",
")",
"{",
"$",
"this",
"->",
"getPayPalOrder",
"(",
")",
"->",
"delete",
"(",
")",
";",
"$",
"resul... | Delete order created by current PayPal ordering process
@return bool | [
"Delete",
"order",
"created",
"by",
"current",
"PayPal",
"ordering",
"process"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L85-L95 |
43,993 | OXID-eSales/paypal | Model/Order.php | Order.delete | public function delete($oxId = null)
{
$this->getPayPalOrder($oxId)->delete();
return parent::delete($oxId);
} | php | public function delete($oxId = null)
{
$this->getPayPalOrder($oxId)->delete();
return parent::delete($oxId);
} | [
"public",
"function",
"delete",
"(",
"$",
"oxId",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getPayPalOrder",
"(",
"$",
"oxId",
")",
"->",
"delete",
"(",
")",
";",
"return",
"parent",
"::",
"delete",
"(",
"$",
"oxId",
")",
";",
"}"
] | Delete order together with PayPal order data.
@param string $oxId
@return bool | [
"Delete",
"order",
"together",
"with",
"PayPal",
"order",
"data",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L104-L109 |
43,994 | OXID-eSales/paypal | Model/Order.php | Order.setPaymentInfoPayPalOrder | protected function setPaymentInfoPayPalOrder($transactionId)
{
// set transaction ID and payment date to order
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$query = 'update oxorder set oxtransid=' . $db->quote($transactionId) . ' where oxid=' . $db->quote($this->getId());
$db->execute($query);
//updating order object
$this->oxorder__oxtransid = new \OxidEsales\Eshop\Core\Field($transactionId);
} | php | protected function setPaymentInfoPayPalOrder($transactionId)
{
// set transaction ID and payment date to order
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$query = 'update oxorder set oxtransid=' . $db->quote($transactionId) . ' where oxid=' . $db->quote($this->getId());
$db->execute($query);
//updating order object
$this->oxorder__oxtransid = new \OxidEsales\Eshop\Core\Field($transactionId);
} | [
"protected",
"function",
"setPaymentInfoPayPalOrder",
"(",
"$",
"transactionId",
")",
"{",
"// set transaction ID and payment date to order",
"$",
"db",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$"... | Updates order transaction status, ID and date.
@param string $transactionId Order transaction ID | [
"Updates",
"order",
"transaction",
"status",
"ID",
"and",
"date",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L116-L126 |
43,995 | OXID-eSales/paypal | Model/Order.php | Order.finalizePayPalOrder | public function finalizePayPalOrder($result, $basket, $transactionMode)
{
$utilsDate = \OxidEsales\Eshop\Core\Registry::getUtilsDate();
$date = date('Y-m-d H:i:s', $utilsDate->getTime());
// set order status, transaction ID and payment date to order
$this->setPaymentInfoPayPalOrder($result->getTransactionId());
$currency = $result->getCurrencyCode();
if (!$currency) {
$currency = $this->getOrderCurrency()->name;
}
// PayPal order info
$payPalOrder = $this->getPayPalOrder();
$payPalOrder->setOrderId($this->getId());
$payPalOrder->setPaymentStatus('pending');
$payPalOrder->setTransactionMode($transactionMode);
$payPalOrder->setCurrency($currency);
$payPalOrder->setTotalOrderSum($basket->getPrice()->getBruttoPrice());
if ($transactionMode == 'Sale') {
$payPalOrder->setCapturedAmount($basket->getPrice()->getBruttoPrice());
}
$payPalOrder->save();
$orderPayment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$orderPayment->setTransactionId($result->getTransactionId());
$orderPayment->setCorrelationId($result->getCorrelationId());
$orderPayment->setDate($date);
$orderPayment->setAction(($transactionMode == 'Sale') ? 'capture' : 'authorization');
$orderPayment->setStatus($result->getPaymentStatus());
$orderPayment->setAmount($result->getAmount());
$orderPayment->setCurrency($result->getCurrencyCode());
//Adding payment information
$paymentList = $this->getPayPalOrder()->getPaymentList();
$paymentList->addPayment($orderPayment);
//setting order payment status after
$paymentStatusCalculator = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator::class);
$paymentStatusCalculator->setOrder($this->getPayPalOrder());
$this->getPayPalOrder()->setPaymentStatus($paymentStatusCalculator->getStatus(), $this);
$this->getPayPalOrder()->save();
//clear PayPal identification
$this->getSession()->deleteVariable('oepaypal');
$this->getSession()->deleteVariable("oepaypal-payerId");
$this->getSession()->deleteVariable("oepaypal-userId");
$this->getSession()->deleteVariable('oepaypal-basketAmount');
} | php | public function finalizePayPalOrder($result, $basket, $transactionMode)
{
$utilsDate = \OxidEsales\Eshop\Core\Registry::getUtilsDate();
$date = date('Y-m-d H:i:s', $utilsDate->getTime());
// set order status, transaction ID and payment date to order
$this->setPaymentInfoPayPalOrder($result->getTransactionId());
$currency = $result->getCurrencyCode();
if (!$currency) {
$currency = $this->getOrderCurrency()->name;
}
// PayPal order info
$payPalOrder = $this->getPayPalOrder();
$payPalOrder->setOrderId($this->getId());
$payPalOrder->setPaymentStatus('pending');
$payPalOrder->setTransactionMode($transactionMode);
$payPalOrder->setCurrency($currency);
$payPalOrder->setTotalOrderSum($basket->getPrice()->getBruttoPrice());
if ($transactionMode == 'Sale') {
$payPalOrder->setCapturedAmount($basket->getPrice()->getBruttoPrice());
}
$payPalOrder->save();
$orderPayment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$orderPayment->setTransactionId($result->getTransactionId());
$orderPayment->setCorrelationId($result->getCorrelationId());
$orderPayment->setDate($date);
$orderPayment->setAction(($transactionMode == 'Sale') ? 'capture' : 'authorization');
$orderPayment->setStatus($result->getPaymentStatus());
$orderPayment->setAmount($result->getAmount());
$orderPayment->setCurrency($result->getCurrencyCode());
//Adding payment information
$paymentList = $this->getPayPalOrder()->getPaymentList();
$paymentList->addPayment($orderPayment);
//setting order payment status after
$paymentStatusCalculator = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator::class);
$paymentStatusCalculator->setOrder($this->getPayPalOrder());
$this->getPayPalOrder()->setPaymentStatus($paymentStatusCalculator->getStatus(), $this);
$this->getPayPalOrder()->save();
//clear PayPal identification
$this->getSession()->deleteVariable('oepaypal');
$this->getSession()->deleteVariable("oepaypal-payerId");
$this->getSession()->deleteVariable("oepaypal-userId");
$this->getSession()->deleteVariable('oepaypal-basketAmount');
} | [
"public",
"function",
"finalizePayPalOrder",
"(",
"$",
"result",
",",
"$",
"basket",
",",
"$",
"transactionMode",
")",
"{",
"$",
"utilsDate",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsDate",
"(",
")",
";",
"$",
... | Finalizes PayPal order.
@param \OxidEsales\PayPalModule\Model\Response\ResponseDoExpressCheckoutPayment $result PayPal results array.
@param \OxidEsales\Eshop\Application\Model\Basket $basket Basket object.
@param string $transactionMode Transaction mode Sale|Authorization. | [
"Finalizes",
"PayPal",
"order",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L135-L184 |
43,996 | OXID-eSales/paypal | Model/Order.php | Order._setOrderStatus | protected function _setOrderStatus($status)
{
$paymentTypeObject = $this->getPaymentType();
$paymentType = $paymentTypeObject ? $paymentTypeObject->getFieldData('oxpaymentsid') : null;
if ($paymentType != 'oxidpaypal' || $status != self::OEPAYPAL_TRANSACTION_STATUS_OK) {
parent::_setOrderStatus($status);
}
} | php | protected function _setOrderStatus($status)
{
$paymentTypeObject = $this->getPaymentType();
$paymentType = $paymentTypeObject ? $paymentTypeObject->getFieldData('oxpaymentsid') : null;
if ($paymentType != 'oxidpaypal' || $status != self::OEPAYPAL_TRANSACTION_STATUS_OK) {
parent::_setOrderStatus($status);
}
} | [
"protected",
"function",
"_setOrderStatus",
"(",
"$",
"status",
")",
"{",
"$",
"paymentTypeObject",
"=",
"$",
"this",
"->",
"getPaymentType",
"(",
")",
";",
"$",
"paymentType",
"=",
"$",
"paymentTypeObject",
"?",
"$",
"paymentTypeObject",
"->",
"getFieldData",
... | Paypal specific status checking.
If status comes as OK, lets check real paypal payment state,
and if really ok, so lets set it, otherwise dont change status.
@param string $status order transaction status | [
"Paypal",
"specific",
"status",
"checking",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L194-L201 |
43,997 | OXID-eSales/paypal | Model/Order.php | Order.markOrderPaid | public function markOrderPaid()
{
parent::_setOrderStatus(self::OEPAYPAL_TRANSACTION_STATUS_OK);
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$utilsDate = \OxidEsales\Eshop\Core\Registry::getUtilsDate();
$date = date('Y-m-d H:i:s', $utilsDate->getTime());
$query = 'update oxorder set oxpaid=? where oxid=?';
$db->execute($query, array($date, $this->getId()));
//updating order object
$this->oxorder__oxpaid = new \OxidEsales\Eshop\Core\Field($date);
} | php | public function markOrderPaid()
{
parent::_setOrderStatus(self::OEPAYPAL_TRANSACTION_STATUS_OK);
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$utilsDate = \OxidEsales\Eshop\Core\Registry::getUtilsDate();
$date = date('Y-m-d H:i:s', $utilsDate->getTime());
$query = 'update oxorder set oxpaid=? where oxid=?';
$db->execute($query, array($date, $this->getId()));
//updating order object
$this->oxorder__oxpaid = new \OxidEsales\Eshop\Core\Field($date);
} | [
"public",
"function",
"markOrderPaid",
"(",
")",
"{",
"parent",
"::",
"_setOrderStatus",
"(",
"self",
"::",
"OEPAYPAL_TRANSACTION_STATUS_OK",
")",
";",
"$",
"db",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(... | Update order oxpaid to current time. | [
"Update",
"order",
"oxpaid",
"to",
"current",
"time",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L206-L219 |
43,998 | OXID-eSales/paypal | Model/Order.php | Order.getPayPalOrder | public function getPayPalOrder($oxId = null)
{
if (is_null($this->payPalOrder)) {
$orderId = is_null($oxId) ? $this->getId() : $oxId;
$order = oxNew(\OxidEsales\PayPalModule\Model\PayPalOrder::class);
$order->load($orderId);
$this->payPalOrder = $order;
}
return $this->payPalOrder;
} | php | public function getPayPalOrder($oxId = null)
{
if (is_null($this->payPalOrder)) {
$orderId = is_null($oxId) ? $this->getId() : $oxId;
$order = oxNew(\OxidEsales\PayPalModule\Model\PayPalOrder::class);
$order->load($orderId);
$this->payPalOrder = $order;
}
return $this->payPalOrder;
} | [
"public",
"function",
"getPayPalOrder",
"(",
"$",
"oxId",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"payPalOrder",
")",
")",
"{",
"$",
"orderId",
"=",
"is_null",
"(",
"$",
"oxId",
")",
"?",
"$",
"this",
"->",
"getId",
"("... | Returns PayPal order object.
@param string $oxId
@return \OxidEsales\PayPalModule\Model\PayPalOrder|null | [
"Returns",
"PayPal",
"order",
"object",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L257-L267 |
43,999 | OXID-eSales/paypal | Model/Order.php | Order.isPayPalPaymentValid | protected function isPayPalPaymentValid($user, $basketPrice, $shippingId)
{
$valid = true;
$payPalPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
$payPalPayment->load('oxidpaypal');
if (!$payPalPayment->isValidPayment(null, null, $user, $basketPrice, $shippingId)) {
$valid = $this->isEmptyPaymentValid($user, $basketPrice, $shippingId);
}
return $valid;
} | php | protected function isPayPalPaymentValid($user, $basketPrice, $shippingId)
{
$valid = true;
$payPalPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
$payPalPayment->load('oxidpaypal');
if (!$payPalPayment->isValidPayment(null, null, $user, $basketPrice, $shippingId)) {
$valid = $this->isEmptyPaymentValid($user, $basketPrice, $shippingId);
}
return $valid;
} | [
"protected",
"function",
"isPayPalPaymentValid",
"(",
"$",
"user",
",",
"$",
"basketPrice",
",",
"$",
"shippingId",
")",
"{",
"$",
"valid",
"=",
"true",
";",
"$",
"payPalPayment",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"... | Checks whether PayPal payment is available.
@param object $user
@param double $basketPrice
@param string $shippingId
@return bool | [
"Checks",
"whether",
"PayPal",
"payment",
"is",
"available",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L298-L309 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.