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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
44,000 | OXID-eSales/paypal | Model/Order.php | Order.isEmptyPaymentValid | protected function isEmptyPaymentValid($user, $basketPrice, $shippingId)
{
$valid = true;
$emptyPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
$emptyPayment->load('oxempty');
if (!$emptyPayment->isValidPayment(null, null, $user, $basketPrice, $shippingId)) {
$valid = false;
}
return $valid;
} | php | protected function isEmptyPaymentValid($user, $basketPrice, $shippingId)
{
$valid = true;
$emptyPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
$emptyPayment->load('oxempty');
if (!$emptyPayment->isValidPayment(null, null, $user, $basketPrice, $shippingId)) {
$valid = false;
}
return $valid;
} | [
"protected",
"function",
"isEmptyPaymentValid",
"(",
"$",
"user",
",",
"$",
"basketPrice",
",",
"$",
"shippingId",
")",
"{",
"$",
"valid",
"=",
"true",
";",
"$",
"emptyPayment",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\... | Checks whether Empty payment is available.
@param object $user
@param double $basketPrice
@param string $shippingId
@return bool | [
"Checks",
"whether",
"Empty",
"payment",
"is",
"available",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Order.php#L320-L331 |
44,001 | OXID-eSales/paypal | Model/IPNRequestPaymentSetter.php | IPNRequestPaymentSetter.prepareOrderPayment | protected function prepareOrderPayment($requestOrderPayment)
{
$request = $this->getRequest();
$requestOrderPayment->setStatus($request->getRequestParameter(self::PAYPAL_PAYMENT_STATUS));
$requestOrderPayment->setTransactionId($request->getRequestParameter(self::PAYPAL_TRANSACTION_ID));
$requestOrderPayment->setCurrency($request->getRequestParameter(self::MC_CURRENCY));
$requestOrderPayment->setAmount($this->getAmount());
$requestOrderPayment->setAction($this->getAction());
$correlationId = $request->getRequestParameter(self::CORRELATION_ID);
if (!$correlationId) {
$correlationId = $request->getRequestParameter(self::IPN_TRACK_ID);
}
$requestOrderPayment->setCorrelationId($correlationId);
$date = 0 < strlen($request->getRequestParameter(self::PAYMENT_DATE)) ?
date('Y-m-d H:i:s', strtotime($request->getRequestParameter(self::PAYMENT_DATE))) : null;
$requestOrderPayment->setDate($date);
} | php | protected function prepareOrderPayment($requestOrderPayment)
{
$request = $this->getRequest();
$requestOrderPayment->setStatus($request->getRequestParameter(self::PAYPAL_PAYMENT_STATUS));
$requestOrderPayment->setTransactionId($request->getRequestParameter(self::PAYPAL_TRANSACTION_ID));
$requestOrderPayment->setCurrency($request->getRequestParameter(self::MC_CURRENCY));
$requestOrderPayment->setAmount($this->getAmount());
$requestOrderPayment->setAction($this->getAction());
$correlationId = $request->getRequestParameter(self::CORRELATION_ID);
if (!$correlationId) {
$correlationId = $request->getRequestParameter(self::IPN_TRACK_ID);
}
$requestOrderPayment->setCorrelationId($correlationId);
$date = 0 < strlen($request->getRequestParameter(self::PAYMENT_DATE)) ?
date('Y-m-d H:i:s', strtotime($request->getRequestParameter(self::PAYMENT_DATE))) : null;
$requestOrderPayment->setDate($date);
} | [
"protected",
"function",
"prepareOrderPayment",
"(",
"$",
"requestOrderPayment",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"requestOrderPayment",
"->",
"setStatus",
"(",
"$",
"request",
"->",
"getRequestParameter",
"(",
... | Prepare PayPal payment. Fill up with request values.
@param \OxidEsales\PayPalModule\Model\OrderPayment $requestOrderPayment order to set params. | [
"Prepare",
"PayPal",
"payment",
".",
"Fill",
"up",
"with",
"request",
"values",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNRequestPaymentSetter.php#L118-L137 |
44,002 | OXID-eSales/paypal | Model/IPNRequestPaymentSetter.php | IPNRequestPaymentSetter.getAction | protected function getAction()
{
$action = self::CAPTURE_ACTION;
$request = $this->getRequest();
$rawAmount = $request->getRequestParameter(self::MC_GROSS);
$status = $request->getRequestParameter(self::PAYPAL_PAYMENT_STATUS);
if ((0 > $rawAmount) && (self::PAYPAL_STATUS_REFUND_DONE == $status)) {
$action = self::REFUND_ACTION;
}
return $action;
} | php | protected function getAction()
{
$action = self::CAPTURE_ACTION;
$request = $this->getRequest();
$rawAmount = $request->getRequestParameter(self::MC_GROSS);
$status = $request->getRequestParameter(self::PAYPAL_PAYMENT_STATUS);
if ((0 > $rawAmount) && (self::PAYPAL_STATUS_REFUND_DONE == $status)) {
$action = self::REFUND_ACTION;
}
return $action;
} | [
"protected",
"function",
"getAction",
"(",
")",
"{",
"$",
"action",
"=",
"self",
"::",
"CAPTURE_ACTION",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"rawAmount",
"=",
"$",
"request",
"->",
"getRequestParameter",
"(",
"s... | Get PayPal action from request, we might have a refund.
@return string | [
"Get",
"PayPal",
"action",
"from",
"request",
"we",
"might",
"have",
"a",
"refund",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNRequestPaymentSetter.php#L144-L156 |
44,003 | OXID-eSales/paypal | Model/IPNRequestPaymentSetter.php | IPNRequestPaymentSetter.getAmount | protected function getAmount()
{
$request = $this->getRequest();
return !is_null($request->getRequestParameter(self::MC_GROSS)) ? abs($request->getRequestParameter(self::MC_GROSS)) : null;
} | php | protected function getAmount()
{
$request = $this->getRequest();
return !is_null($request->getRequestParameter(self::MC_GROSS)) ? abs($request->getRequestParameter(self::MC_GROSS)) : null;
} | [
"protected",
"function",
"getAmount",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"return",
"!",
"is_null",
"(",
"$",
"request",
"->",
"getRequestParameter",
"(",
"self",
"::",
"MC_GROSS",
")",
")",
"?",
"abs",
"... | Get amount from request.
@return number | [
"Get",
"amount",
"from",
"request",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNRequestPaymentSetter.php#L163-L167 |
44,004 | OXID-eSales/paypal | Model/Action/OrderActionFactory.php | OrderActionFactory.createAction | public function createAction($action)
{
$method = "get" . ucfirst($action) . "Action";
if (!method_exists($this, $method)) {
/** @var \OxidEsales\PayPalModule\Core\Exception\PayPalInvalidActionException $exception */
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalInvalidActionException::class);
throw $exception;
}
return $this->$method();
} | php | public function createAction($action)
{
$method = "get" . ucfirst($action) . "Action";
if (!method_exists($this, $method)) {
/** @var \OxidEsales\PayPalModule\Core\Exception\PayPalInvalidActionException $exception */
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalInvalidActionException::class);
throw $exception;
}
return $this->$method();
} | [
"public",
"function",
"createAction",
"(",
"$",
"action",
")",
"{",
"$",
"method",
"=",
"\"get\"",
".",
"ucfirst",
"(",
"$",
"action",
")",
".",
"\"Action\"",
";",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"$",
"method",
")",
")",
"{",
... | Creates action object by given action name.
@param string $action
@return object
@throws \OxidEsales\PayPalModule\Core\Exception\PayPalInvalidActionException | [
"Creates",
"action",
"object",
"by",
"given",
"action",
"name",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/OrderActionFactory.php#L80-L91 |
44,005 | OXID-eSales/paypal | Model/Action/OrderActionFactory.php | OrderActionFactory.getCaptureAction | public function getCaptureAction()
{
$order = $this->getOrder();
$request = $this->getRequest();
$data = oxNew(\OxidEsales\PayPalModule\Model\Action\Data\OrderCaptureActionData::class, $request, $order);
$handler = oxNew(\OxidEsales\PayPalModule\Model\Action\Handler\OrderCaptureActionHandler::class, $data);
$reauthorizeData = oxNew(\OxidEsales\PayPalModule\Model\Action\Data\OrderReauthorizeActionData::class, $request, $order);
$reauthorizeHandler = oxNew(\OxidEsales\PayPalModule\Model\Action\Handler\OrderReauthorizeActionHandler::class, $reauthorizeData);
$action = oxNew(\OxidEsales\PayPalModule\Model\Action\OrderCaptureAction::class, $handler, $order->getPayPalOrder(), $reauthorizeHandler);
return $action;
} | php | public function getCaptureAction()
{
$order = $this->getOrder();
$request = $this->getRequest();
$data = oxNew(\OxidEsales\PayPalModule\Model\Action\Data\OrderCaptureActionData::class, $request, $order);
$handler = oxNew(\OxidEsales\PayPalModule\Model\Action\Handler\OrderCaptureActionHandler::class, $data);
$reauthorizeData = oxNew(\OxidEsales\PayPalModule\Model\Action\Data\OrderReauthorizeActionData::class, $request, $order);
$reauthorizeHandler = oxNew(\OxidEsales\PayPalModule\Model\Action\Handler\OrderReauthorizeActionHandler::class, $reauthorizeData);
$action = oxNew(\OxidEsales\PayPalModule\Model\Action\OrderCaptureAction::class, $handler, $order->getPayPalOrder(), $reauthorizeHandler);
return $action;
} | [
"public",
"function",
"getCaptureAction",
"(",
")",
"{",
"$",
"order",
"=",
"$",
"this",
"->",
"getOrder",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"data",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
... | Returns capture action object
@return \OxidEsales\PayPalModule\Model\Action\OrderCaptureAction | [
"Returns",
"capture",
"action",
"object"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/OrderActionFactory.php#L98-L112 |
44,006 | OXID-eSales/paypal | Model/Action/OrderActionFactory.php | OrderActionFactory.getRefundAction | public function getRefundAction()
{
$order = $this->getOrder();
$data = oxNew(\OxidEsales\PayPalModule\Model\Action\Data\OrderRefundActionData::class, $this->getRequest(), $order);
$handler = oxNew(\OxidEsales\PayPalModule\Model\Action\Handler\OrderRefundActionHandler::class, $data);
$action = oxNew(\OxidEsales\PayPalModule\Model\Action\OrderRefundAction::class, $handler, $order->getPayPalOrder());
return $action;
} | php | public function getRefundAction()
{
$order = $this->getOrder();
$data = oxNew(\OxidEsales\PayPalModule\Model\Action\Data\OrderRefundActionData::class, $this->getRequest(), $order);
$handler = oxNew(\OxidEsales\PayPalModule\Model\Action\Handler\OrderRefundActionHandler::class, $data);
$action = oxNew(\OxidEsales\PayPalModule\Model\Action\OrderRefundAction::class, $handler, $order->getPayPalOrder());
return $action;
} | [
"public",
"function",
"getRefundAction",
"(",
")",
"{",
"$",
"order",
"=",
"$",
"this",
"->",
"getOrder",
"(",
")",
";",
"$",
"data",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"Action",
"\\",
"Data",
"\\",
"Order... | Returns refund action object
@return \OxidEsales\PayPalModule\Model\Action\OrderRefundAction | [
"Returns",
"refund",
"action",
"object"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/OrderActionFactory.php#L119-L128 |
44,007 | OXID-eSales/paypal | Model/Action/OrderActionFactory.php | OrderActionFactory.getVoidAction | public function getVoidAction()
{
$order = $this->getOrder();
$data = oxNew(\OxidEsales\PayPalModule\Model\Action\Data\OrderVoidActionData::class, $this->getRequest(), $order);
$handler = oxNew(\OxidEsales\PayPalModule\Model\Action\Handler\OrderVoidActionHandler::class, $data);
$action = oxNew(\OxidEsales\PayPalModule\Model\Action\OrderVoidAction::class, $handler, $order->getPayPalOrder());
return $action;
} | php | public function getVoidAction()
{
$order = $this->getOrder();
$data = oxNew(\OxidEsales\PayPalModule\Model\Action\Data\OrderVoidActionData::class, $this->getRequest(), $order);
$handler = oxNew(\OxidEsales\PayPalModule\Model\Action\Handler\OrderVoidActionHandler::class, $data);
$action = oxNew(\OxidEsales\PayPalModule\Model\Action\OrderVoidAction::class, $handler, $order->getPayPalOrder());
return $action;
} | [
"public",
"function",
"getVoidAction",
"(",
")",
"{",
"$",
"order",
"=",
"$",
"this",
"->",
"getOrder",
"(",
")",
";",
"$",
"data",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"Action",
"\\",
"Data",
"\\",
"OrderVo... | Returns void action object
@return \OxidEsales\PayPalModule\Model\Action\OrderVoidAction | [
"Returns",
"void",
"action",
"object"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/OrderActionFactory.php#L135-L144 |
44,008 | OXID-eSales/paypal | Model/OrderPaymentCommentList.php | OrderPaymentCommentList.getDbGateway | protected function getDbGateway()
{
if (is_null($this->dbGateway)) {
$this->setDbGateway(oxNew(\OxidEsales\PayPalModule\Model\DbGateways\OrderPaymentCommentDbGateway::class));
}
return $this->dbGateway;
} | php | protected function getDbGateway()
{
if (is_null($this->dbGateway)) {
$this->setDbGateway(oxNew(\OxidEsales\PayPalModule\Model\DbGateways\OrderPaymentCommentDbGateway::class));
}
return $this->dbGateway;
} | [
"protected",
"function",
"getDbGateway",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"dbGateway",
")",
")",
"{",
"$",
"this",
"->",
"setDbGateway",
"(",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"DbGate... | Returns DB gateway. If it's not set- creates object and sets.
@return oePayPalPayPalDbGateway | [
"Returns",
"DB",
"gateway",
".",
"If",
"it",
"s",
"not",
"set",
"-",
"creates",
"object",
"and",
"sets",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderPaymentCommentList.php#L66-L73 |
44,009 | OXID-eSales/paypal | Model/PayPalRequest/GetExpressCheckoutDetailsRequestBuilder.php | GetExpressCheckoutDetailsRequestBuilder.getSession | public function getSession()
{
if (!$this->session) {
/**
* @var \OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException $exception
*/
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException::class);
throw $exception;
}
return $this->session;
} | php | public function getSession()
{
if (!$this->session) {
/**
* @var \OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException $exception
*/
$exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException::class);
throw $exception;
}
return $this->session;
} | [
"public",
"function",
"getSession",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"session",
")",
"{",
"/**\n * @var \\OxidEsales\\PayPalModule\\Core\\Exception\\PayPalMissingParameterException $exception\n */",
"$",
"exception",
"=",
"oxNew",
"(",... | Returns Session.
@return \OxidEsales\Eshop\Core\Session
@throws \OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException | [
"Returns",
"Session",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalRequest/GetExpressCheckoutDetailsRequestBuilder.php#L84-L95 |
44,010 | OXID-eSales/paypal | Model/PayPalRequest/GetExpressCheckoutDetailsRequestBuilder.php | GetExpressCheckoutDetailsRequestBuilder.buildRequest | public function buildRequest()
{
$request = $this->getPayPalRequest();
$request->setParameter('TOKEN', $this->getSession()->getVariable('oepaypal-token'));
return $request;
} | php | public function buildRequest()
{
$request = $this->getPayPalRequest();
$request->setParameter('TOKEN', $this->getSession()->getVariable('oepaypal-token'));
return $request;
} | [
"public",
"function",
"buildRequest",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getPayPalRequest",
"(",
")",
";",
"$",
"request",
"->",
"setParameter",
"(",
"'TOKEN'",
",",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getVariable",
"("... | Builds Request.
@return \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest | [
"Builds",
"Request",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/PayPalRequest/GetExpressCheckoutDetailsRequestBuilder.php#L102-L108 |
44,011 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.processCallBack | public function processCallBack()
{
$payPalService = $this->getPayPalCheckoutService();
$this->setParamsForCallbackResponse($payPalService);
$request = $payPalService->callbackResponse();
\OxidEsales\Eshop\Core\Registry::getUtils()->showMessageAndExit($request);
} | php | public function processCallBack()
{
$payPalService = $this->getPayPalCheckoutService();
$this->setParamsForCallbackResponse($payPalService);
$request = $payPalService->callbackResponse();
\OxidEsales\Eshop\Core\Registry::getUtils()->showMessageAndExit($request);
} | [
"public",
"function",
"processCallBack",
"(",
")",
"{",
"$",
"payPalService",
"=",
"$",
"this",
"->",
"getPayPalCheckoutService",
"(",
")",
";",
"$",
"this",
"->",
"setParamsForCallbackResponse",
"(",
"$",
"payPalService",
")",
";",
"$",
"request",
"=",
"$",
... | Processes PayPal callback | [
"Processes",
"PayPal",
"callback"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L38-L44 |
44,012 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.getCancelUrl | protected function getCancelUrl()
{
$cancelURLFromRequest = $this->getRequest()->getRequestParameter('oePayPalCancelURL');
$cancelUrl = $this->getSession()->processUrl($this->getBaseUrl() . "&cl=basket");
if ($cancelURLFromRequest) {
$cancelUrl = html_entity_decode(urldecode($cancelURLFromRequest));
} elseif ($requestedControllerKey = $this->getRequestedControllerKey()) {
$cancelUrl = $this->getSession()->processUrl($this->getBaseUrl() . '&cl=' . $requestedControllerKey);
}
return $cancelUrl;
} | php | protected function getCancelUrl()
{
$cancelURLFromRequest = $this->getRequest()->getRequestParameter('oePayPalCancelURL');
$cancelUrl = $this->getSession()->processUrl($this->getBaseUrl() . "&cl=basket");
if ($cancelURLFromRequest) {
$cancelUrl = html_entity_decode(urldecode($cancelURLFromRequest));
} elseif ($requestedControllerKey = $this->getRequestedControllerKey()) {
$cancelUrl = $this->getSession()->processUrl($this->getBaseUrl() . '&cl=' . $requestedControllerKey);
}
return $cancelUrl;
} | [
"protected",
"function",
"getCancelUrl",
"(",
")",
"{",
"$",
"cancelURLFromRequest",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getRequestParameter",
"(",
"'oePayPalCancelURL'",
")",
";",
"$",
"cancelUrl",
"=",
"$",
"this",
"->",
"getSession",
"(",... | Returns CANCEL URL
@return string | [
"Returns",
"CANCEL",
"URL"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L256-L268 |
44,013 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.getCallBackUser | protected function getCallBackUser($data)
{
// simulating user object
$user = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
$user->initializeUserForCallBackPayPalUser($data);
return $user;
} | php | protected function getCallBackUser($data)
{
// simulating user object
$user = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
$user->initializeUserForCallBackPayPalUser($data);
return $user;
} | [
"protected",
"function",
"getCallBackUser",
"(",
"$",
"data",
")",
"{",
"// simulating user object",
"$",
"user",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"User",
"::",
"class",
")",
";",
"$",
"user",
... | Initialize new user from user data.
@param array $data User data array.
@return \OxidEsales\Eshop\Application\Model\User | [
"Initialize",
"new",
"user",
"from",
"user",
"data",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L305-L312 |
44,014 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.setParamsForCallbackResponse | protected function setParamsForCallbackResponse($payPalService)
{
//logging request from PayPal
$logger = $this->getLogger();
$logger->setTitle("CALLBACK REQUEST FROM PAYPAL");
$logger->log(http_build_query($_REQUEST, "", "&"));
// initializing user..
$user = $this->getCallBackUser($_REQUEST);
// unknown country?
if (!$this->getUserShippingCountryId($user)) {
$logger = $this->getLogger();
$logger->log("Callback error: NO SHIPPING COUNTRY ID");
// unknown country - no delivery
$this->setPayPalIsNotAvailable($payPalService);
return;
}
//basket
$basket = $this->getSession()->getBasket();
// get possible delivery sets
$delSetList = $this->getDeliverySetList($user);
//no shipping methods for user country
if (!count($delSetList)) {
$logger = $this->getLogger();
$logger->log("Callback error: NO DELIVERY LIST SET");
$this->setPayPalIsNotAvailable($payPalService);
return;
}
$deliverySetList = $this->makeUniqueNames($delSetList);
// checking if PayPal is valid payment for selected user country
if (!$this->isPaymentValidForUserCountry($user)) {
$logger->log("Callback error: NOT VALID COUNTRY ID");
// PayPal payment is not possible for user country
$this->setPayPalIsNotAvailable($payPalService);
return;
}
$this->getSession()->setVariable('oepaypal-oxDelSetList', $deliverySetList);
$totalDeliveries = $this->setDeliverySetListForCallbackResponse($payPalService, $deliverySetList, $user, $basket);
// if none of deliveries contain PayPal - disabling PayPal
if ($totalDeliveries == 0) {
$logger->log("Callback error: DELIVERY SET LIST HAS NO PAYPAL");
$this->setPayPalIsNotAvailable($payPalService);
return;
}
$payPalService->setParameter("OFFERINSURANCEOPTION", "false");
} | php | protected function setParamsForCallbackResponse($payPalService)
{
//logging request from PayPal
$logger = $this->getLogger();
$logger->setTitle("CALLBACK REQUEST FROM PAYPAL");
$logger->log(http_build_query($_REQUEST, "", "&"));
// initializing user..
$user = $this->getCallBackUser($_REQUEST);
// unknown country?
if (!$this->getUserShippingCountryId($user)) {
$logger = $this->getLogger();
$logger->log("Callback error: NO SHIPPING COUNTRY ID");
// unknown country - no delivery
$this->setPayPalIsNotAvailable($payPalService);
return;
}
//basket
$basket = $this->getSession()->getBasket();
// get possible delivery sets
$delSetList = $this->getDeliverySetList($user);
//no shipping methods for user country
if (!count($delSetList)) {
$logger = $this->getLogger();
$logger->log("Callback error: NO DELIVERY LIST SET");
$this->setPayPalIsNotAvailable($payPalService);
return;
}
$deliverySetList = $this->makeUniqueNames($delSetList);
// checking if PayPal is valid payment for selected user country
if (!$this->isPaymentValidForUserCountry($user)) {
$logger->log("Callback error: NOT VALID COUNTRY ID");
// PayPal payment is not possible for user country
$this->setPayPalIsNotAvailable($payPalService);
return;
}
$this->getSession()->setVariable('oepaypal-oxDelSetList', $deliverySetList);
$totalDeliveries = $this->setDeliverySetListForCallbackResponse($payPalService, $deliverySetList, $user, $basket);
// if none of deliveries contain PayPal - disabling PayPal
if ($totalDeliveries == 0) {
$logger->log("Callback error: DELIVERY SET LIST HAS NO PAYPAL");
$this->setPayPalIsNotAvailable($payPalService);
return;
}
$payPalService->setParameter("OFFERINSURANCEOPTION", "false");
} | [
"protected",
"function",
"setParamsForCallbackResponse",
"(",
"$",
"payPalService",
")",
"{",
"//logging request from PayPal",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"logger",
"->",
"setTitle",
"(",
"\"CALLBACK REQUEST FROM PAYPAL\"",
... | Sets parameters to PayPal callback
@param \OxidEsales\PayPalModule\Core\PayPalService $payPalService PayPal service
@return null | [
"Sets",
"parameters",
"to",
"PayPal",
"callback"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L321-L384 |
44,015 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.setDeliverySetListForCallbackResponse | protected function setDeliverySetListForCallbackResponse($payPalService, $deliverySetList, $user, $basket)
{
$maxDeliveryAmount = $this->getPayPalConfig()->getMaxPayPalDeliveryAmount();
$cur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
$basketPrice = $basket->getPriceForPayment() / $cur->rate;
$actShipSet = $basket->getShippingId();
$hasActShipSet = false;
$cnt = 0;
// VAT for delivery will be calculated always
$delVATPercent = $basket->getAdditionalServicesVatPercent();
foreach ($deliverySetList as $delSetId => $delSetName) {
// checking if PayPal is valid payment for selected delivery set
if (!$this->isPayPalInDeliverySet($delSetId, $basketPrice, $user)) {
continue;
}
$deliveryListProvider = oxNew(\OxidEsales\Eshop\Application\Model\DeliveryList::class);
$deliveryList = array();
// list of active delivery costs
if ($deliveryListProvider->hasDeliveries($basket, $user, $this->getUserShippingCountryId($user), $delSetId)) {
$deliveryList = $deliveryListProvider->getDeliveryList($basket, $user, $this->getUserShippingCountryId($user), $delSetId);
}
if (count($deliveryList) > 0) {
$price = 0;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadDelivery')) {
foreach ($deliveryList as $delivery) {
$price += $delivery->getDeliveryPrice($delVATPercent)->getBruttoPrice();
}
}
if ($price <= $maxDeliveryAmount) {
$payPalService->setParameter("L_SHIPPINGOPTIONNAME{$cnt}", \OxidEsales\Eshop\Core\Str::getStr()->html_entity_decode($delSetName));
$payPalService->setParameter("L_SHIPPINGOPTIONLABEL{$cnt}", \OxidEsales\Eshop\Core\Registry::getLang()->translateString("OEPAYPAL_PRICE"));
$payPalService->setParameter("L_SHIPPINGOPTIONAMOUNT{$cnt}", $this->formatFloat($price));
//setting active delivery set
if ($delSetId == $actShipSet) {
$hasActShipSet = true;
$payPalService->setParameter("L_SHIPPINGOPTIONISDEFAULT{$cnt}", "true");
} else {
$payPalService->setParameter("L_SHIPPINGOPTIONISDEFAULT{$cnt}", "false");
}
if ($basket->isCalculationModeNetto()) {
$payPalService->setParameter("L_TAXAMT{$cnt}", $this->formatFloat($basket->getPayPalBasketVatValue()));
} else {
$payPalService->setParameter("L_TAXAMT{$cnt}", $this->formatFloat(0));
}
}
$cnt++;
}
}
//checking if active delivery set was set - if not, setting first in the list
if ($cnt > 0 && !$hasActShipSet) {
$payPalService->setParameter("L_SHIPPINGOPTIONISDEFAULT0", "true");
}
return $cnt;
} | php | protected function setDeliverySetListForCallbackResponse($payPalService, $deliverySetList, $user, $basket)
{
$maxDeliveryAmount = $this->getPayPalConfig()->getMaxPayPalDeliveryAmount();
$cur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
$basketPrice = $basket->getPriceForPayment() / $cur->rate;
$actShipSet = $basket->getShippingId();
$hasActShipSet = false;
$cnt = 0;
// VAT for delivery will be calculated always
$delVATPercent = $basket->getAdditionalServicesVatPercent();
foreach ($deliverySetList as $delSetId => $delSetName) {
// checking if PayPal is valid payment for selected delivery set
if (!$this->isPayPalInDeliverySet($delSetId, $basketPrice, $user)) {
continue;
}
$deliveryListProvider = oxNew(\OxidEsales\Eshop\Application\Model\DeliveryList::class);
$deliveryList = array();
// list of active delivery costs
if ($deliveryListProvider->hasDeliveries($basket, $user, $this->getUserShippingCountryId($user), $delSetId)) {
$deliveryList = $deliveryListProvider->getDeliveryList($basket, $user, $this->getUserShippingCountryId($user), $delSetId);
}
if (count($deliveryList) > 0) {
$price = 0;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadDelivery')) {
foreach ($deliveryList as $delivery) {
$price += $delivery->getDeliveryPrice($delVATPercent)->getBruttoPrice();
}
}
if ($price <= $maxDeliveryAmount) {
$payPalService->setParameter("L_SHIPPINGOPTIONNAME{$cnt}", \OxidEsales\Eshop\Core\Str::getStr()->html_entity_decode($delSetName));
$payPalService->setParameter("L_SHIPPINGOPTIONLABEL{$cnt}", \OxidEsales\Eshop\Core\Registry::getLang()->translateString("OEPAYPAL_PRICE"));
$payPalService->setParameter("L_SHIPPINGOPTIONAMOUNT{$cnt}", $this->formatFloat($price));
//setting active delivery set
if ($delSetId == $actShipSet) {
$hasActShipSet = true;
$payPalService->setParameter("L_SHIPPINGOPTIONISDEFAULT{$cnt}", "true");
} else {
$payPalService->setParameter("L_SHIPPINGOPTIONISDEFAULT{$cnt}", "false");
}
if ($basket->isCalculationModeNetto()) {
$payPalService->setParameter("L_TAXAMT{$cnt}", $this->formatFloat($basket->getPayPalBasketVatValue()));
} else {
$payPalService->setParameter("L_TAXAMT{$cnt}", $this->formatFloat(0));
}
}
$cnt++;
}
}
//checking if active delivery set was set - if not, setting first in the list
if ($cnt > 0 && !$hasActShipSet) {
$payPalService->setParameter("L_SHIPPINGOPTIONISDEFAULT0", "true");
}
return $cnt;
} | [
"protected",
"function",
"setDeliverySetListForCallbackResponse",
"(",
"$",
"payPalService",
",",
"$",
"deliverySetList",
",",
"$",
"user",
",",
"$",
"basket",
")",
"{",
"$",
"maxDeliveryAmount",
"=",
"$",
"this",
"->",
"getPayPalConfig",
"(",
")",
"->",
"getMax... | Sets delivery sets parameters to PayPal callback
@param \OxidEsales\PayPalModule\Core\PayPalService $payPalService PayPal service.
@param array $deliverySetList Delivery list.
@param \OxidEsales\Eshop\Application\Model\User $user User object.
@param \OxidEsales\Eshop\Application\Model\Basket $basket Basket object.
@return int Total amount of deliveries | [
"Sets",
"delivery",
"sets",
"parameters",
"to",
"PayPal",
"callback"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L396-L461 |
44,016 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.makeUniqueNames | public function makeUniqueNames($deliverySetList)
{
$result = array();
$nameCounts = array();
foreach ($deliverySetList as $deliverySet) {
$deliverySetName = trim($deliverySet->oxdeliveryset__oxtitle->value);
if (isset($nameCounts[$deliverySetName])) {
$nameCounts[$deliverySetName] += 1;
} else {
$nameCounts[$deliverySetName] = 1;
}
$suffix = ($nameCounts[$deliverySetName] > 1) ? " (" . $nameCounts[$deliverySetName] . ")" : '';
$result[$deliverySet->oxdeliveryset__oxid->value] = $deliverySetName . $suffix;
}
return $result;
} | php | public function makeUniqueNames($deliverySetList)
{
$result = array();
$nameCounts = array();
foreach ($deliverySetList as $deliverySet) {
$deliverySetName = trim($deliverySet->oxdeliveryset__oxtitle->value);
if (isset($nameCounts[$deliverySetName])) {
$nameCounts[$deliverySetName] += 1;
} else {
$nameCounts[$deliverySetName] = 1;
}
$suffix = ($nameCounts[$deliverySetName] > 1) ? " (" . $nameCounts[$deliverySetName] . ")" : '';
$result[$deliverySet->oxdeliveryset__oxid->value] = $deliverySetName . $suffix;
}
return $result;
} | [
"public",
"function",
"makeUniqueNames",
"(",
"$",
"deliverySetList",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"nameCounts",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"deliverySetList",
"as",
"$",
"deliverySet",
")",
"{",
"$",
... | Makes delivery set array with unique names
@param array $deliverySetList delivery list
@return array | [
"Makes",
"delivery",
"set",
"array",
"with",
"unique",
"names"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L470-L489 |
44,017 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.extractShippingId | protected function extractShippingId($shippingOptionName, $user)
{
$result = null;
$charset = $this->getPayPalConfig()->getCharset();
$shippingOptionName = htmlentities(html_entity_decode($shippingOptionName, ENT_QUOTES, $charset), ENT_QUOTES, $charset);
$name = trim(str_replace(\OxidEsales\Eshop\Core\Registry::getLang()->translateString("OEPAYPAL_PRICE"), "", $shippingOptionName));
$deliverySetList = $this->getSession()->getVariable("oepaypal-oxDelSetList");
if (!$deliverySetList) {
$delSetList = $this->getDeliverySetList($user);
$deliverySetList = $this->makeUniqueNames($delSetList);
}
if (is_array($deliverySetList)) {
$flipped = array_flip($deliverySetList);
$result = $flipped[$name];
}
return $result;
} | php | protected function extractShippingId($shippingOptionName, $user)
{
$result = null;
$charset = $this->getPayPalConfig()->getCharset();
$shippingOptionName = htmlentities(html_entity_decode($shippingOptionName, ENT_QUOTES, $charset), ENT_QUOTES, $charset);
$name = trim(str_replace(\OxidEsales\Eshop\Core\Registry::getLang()->translateString("OEPAYPAL_PRICE"), "", $shippingOptionName));
$deliverySetList = $this->getSession()->getVariable("oepaypal-oxDelSetList");
if (!$deliverySetList) {
$delSetList = $this->getDeliverySetList($user);
$deliverySetList = $this->makeUniqueNames($delSetList);
}
if (is_array($deliverySetList)) {
$flipped = array_flip($deliverySetList);
$result = $flipped[$name];
}
return $result;
} | [
"protected",
"function",
"extractShippingId",
"(",
"$",
"shippingOptionName",
",",
"$",
"user",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"charset",
"=",
"$",
"this",
"->",
"getPayPalConfig",
"(",
")",
"->",
"getCharset",
"(",
")",
";",
"$",
"shipp... | Extracts shipping id from given parameter
@param string $shippingOptionName Shipping option name, which comes from PayPal.
@param \OxidEsales\Eshop\Application\Model\User $user User object.
@return string | [
"Extracts",
"shipping",
"id",
"from",
"given",
"parameter"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L514-L537 |
44,018 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.initializeUserData | protected function initializeUserData($details)
{
$userEmail = $details->getEmail();
$loggedUser = $this->getUser();
if ($loggedUser) {
$userEmail = $loggedUser->oxuser__oxusername->value;
}
$user = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
if ($userId = $user->isRealPayPalUser($userEmail)) {
// if user exist
$user->load($userId);
if (!$loggedUser) {
if (!$user->isSamePayPalUser($details)) {
/**
* @var $exception \OxidEsales\Eshop\Core\Exception\StandardException
*/
$exception = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class);
$exception->setMessage('OEPAYPAL_ERROR_USER_ADDRESS');
throw $exception;
}
} elseif (!$user->isSameAddressUserPayPalUser($details) || !$user->isSameAddressPayPalUser($details)) {
// user has selected different address in PayPal (not equal with usr shop address)
// so adding PayPal address as new user address to shop user account
$this->createUserAddress($details, $userId);
} else {
// removing custom shipping address ID from session as user uses billing
// address for shipping
$this->getSession()->deleteVariable('deladrid');
}
} else {
$user->createPayPalUser($details);
}
$this->getSession()->setVariable('usr', $user->getId());
return $user;
} | php | protected function initializeUserData($details)
{
$userEmail = $details->getEmail();
$loggedUser = $this->getUser();
if ($loggedUser) {
$userEmail = $loggedUser->oxuser__oxusername->value;
}
$user = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
if ($userId = $user->isRealPayPalUser($userEmail)) {
// if user exist
$user->load($userId);
if (!$loggedUser) {
if (!$user->isSamePayPalUser($details)) {
/**
* @var $exception \OxidEsales\Eshop\Core\Exception\StandardException
*/
$exception = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class);
$exception->setMessage('OEPAYPAL_ERROR_USER_ADDRESS');
throw $exception;
}
} elseif (!$user->isSameAddressUserPayPalUser($details) || !$user->isSameAddressPayPalUser($details)) {
// user has selected different address in PayPal (not equal with usr shop address)
// so adding PayPal address as new user address to shop user account
$this->createUserAddress($details, $userId);
} else {
// removing custom shipping address ID from session as user uses billing
// address for shipping
$this->getSession()->deleteVariable('deladrid');
}
} else {
$user->createPayPalUser($details);
}
$this->getSession()->setVariable('usr', $user->getId());
return $user;
} | [
"protected",
"function",
"initializeUserData",
"(",
"$",
"details",
")",
"{",
"$",
"userEmail",
"=",
"$",
"details",
"->",
"getEmail",
"(",
")",
";",
"$",
"loggedUser",
"=",
"$",
"this",
"->",
"getUser",
"(",
")",
";",
"if",
"(",
"$",
"loggedUser",
")"... | Creates new or returns session user
@param \OxidEsales\PayPalModule\Model\Response\ResponseGetExpressCheckoutDetails $details
@throws \OxidEsales\Eshop\Core\Exception\StandardException
@return \OxidEsales\Eshop\Application\Model\User | [
"Creates",
"new",
"or",
"returns",
"session",
"user"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L548-L586 |
44,019 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.createUserAddress | protected function createUserAddress($details, $userId)
{
$address = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
return $address->createPayPalAddress($details, $userId);
} | php | protected function createUserAddress($details, $userId)
{
$address = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
return $address->createPayPalAddress($details, $userId);
} | [
"protected",
"function",
"createUserAddress",
"(",
"$",
"details",
",",
"$",
"userId",
")",
"{",
"$",
"address",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Address",
"::",
"class",
")",
";",
"return",
... | Creates user address and sets address id into session
@param \OxidEsales\PayPalModule\Model\Response\ResponseGetExpressCheckoutDetails $details User address info.
@param string $userId User id.
@return bool | [
"Creates",
"user",
"address",
"and",
"sets",
"address",
"id",
"into",
"session"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L596-L601 |
44,020 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.isPaymentValidForUserCountry | protected function isPaymentValidForUserCountry($user)
{
$payment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
$payment->load("oxidpaypal");
$paymentCountries = $payment->getCountries();
if (!is_array($paymentCountries) || empty($paymentCountries)) {
// not assigned to any country - valid to all countries
return true;
}
return in_array($this->getUserShippingCountryId($user), $paymentCountries);
} | php | protected function isPaymentValidForUserCountry($user)
{
$payment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
$payment->load("oxidpaypal");
$paymentCountries = $payment->getCountries();
if (!is_array($paymentCountries) || empty($paymentCountries)) {
// not assigned to any country - valid to all countries
return true;
}
return in_array($this->getUserShippingCountryId($user), $paymentCountries);
} | [
"protected",
"function",
"isPaymentValidForUserCountry",
"(",
"$",
"user",
")",
"{",
"$",
"payment",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Payment",
"::",
"class",
")",
";",
"$",
"payment",
"->",
"... | Checking if PayPal payment is available in user country
@param \OxidEsales\Eshop\Application\Model\User $user User object.
@return boolean | [
"Checking",
"if",
"PayPal",
"payment",
"is",
"available",
"in",
"user",
"country"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L610-L622 |
44,021 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.isPayPalInDeliverySet | protected function isPayPalInDeliverySet($delSetId, $basketPrice, $user)
{
$paymentList = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\PaymentList::class);
$paymentList = $paymentList->getPaymentList($delSetId, $basketPrice, $user);
if (is_array($paymentList) && array_key_exists("oxidpaypal", $paymentList)) {
return true;
}
return false;
} | php | protected function isPayPalInDeliverySet($delSetId, $basketPrice, $user)
{
$paymentList = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\PaymentList::class);
$paymentList = $paymentList->getPaymentList($delSetId, $basketPrice, $user);
if (is_array($paymentList) && array_key_exists("oxidpaypal", $paymentList)) {
return true;
}
return false;
} | [
"protected",
"function",
"isPayPalInDeliverySet",
"(",
"$",
"delSetId",
",",
"$",
"basketPrice",
",",
"$",
"user",
")",
"{",
"$",
"paymentList",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"get",
"(",
"\\",
"OxidEsales",
"... | Checks if selected delivery set has PayPal payment.
@param string $delSetId Delivery set ID.
@param double $basketPrice Basket price.
@param \OxidEsales\Eshop\Application\Model\User $user User object.
@return boolean | [
"Checks",
"if",
"selected",
"delivery",
"set",
"has",
"PayPal",
"payment",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L633-L643 |
44,022 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.getDeliverySetList | protected function getDeliverySetList($user)
{
$delSetList = oxNew(\OxidEsales\Eshop\Application\Model\DeliverySetList::class);
return $delSetList->getDeliverySetList($user, $this->getUserShippingCountryId($user));
} | php | protected function getDeliverySetList($user)
{
$delSetList = oxNew(\OxidEsales\Eshop\Application\Model\DeliverySetList::class);
return $delSetList->getDeliverySetList($user, $this->getUserShippingCountryId($user));
} | [
"protected",
"function",
"getDeliverySetList",
"(",
"$",
"user",
")",
"{",
"$",
"delSetList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"DeliverySetList",
"::",
"class",
")",
";",
"return",
"$",
"delSetLi... | Get delivery set list for PayPal callback
@param \OxidEsales\Eshop\Application\Model\User $user User object.
@return array | [
"Get",
"delivery",
"set",
"list",
"for",
"PayPal",
"callback"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L664-L669 |
44,023 | OXID-eSales/paypal | Controller/ExpressCheckoutDispatcher.php | ExpressCheckoutDispatcher.getUserShippingCountryId | protected function getUserShippingCountryId($user)
{
if ($user->getSelectedAddressId() && $user->getSelectedAddress()) {
$countryId = $user->getSelectedAddress()->oxaddress__oxcountryid->value;
} else {
$countryId = $user->oxuser__oxcountryid->value;
}
return $countryId;
} | php | protected function getUserShippingCountryId($user)
{
if ($user->getSelectedAddressId() && $user->getSelectedAddress()) {
$countryId = $user->getSelectedAddress()->oxaddress__oxcountryid->value;
} else {
$countryId = $user->oxuser__oxcountryid->value;
}
return $countryId;
} | [
"protected",
"function",
"getUserShippingCountryId",
"(",
"$",
"user",
")",
"{",
"if",
"(",
"$",
"user",
"->",
"getSelectedAddressId",
"(",
")",
"&&",
"$",
"user",
"->",
"getSelectedAddress",
"(",
")",
")",
"{",
"$",
"countryId",
"=",
"$",
"user",
"->",
... | Returns user shipping address country id.
@param \OxidEsales\Eshop\Application\Model\User $user
@return string | [
"Returns",
"user",
"shipping",
"address",
"country",
"id",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/ExpressCheckoutDispatcher.php#L678-L687 |
44,024 | OXID-eSales/paypal | Core/Config.php | Config.getPayPalHost | public function getPayPalHost()
{
$host = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sPayPalHost');
if ($host) {
$this->setPayPalHost($host);
}
return $this->payPalHost;
} | php | public function getPayPalHost()
{
$host = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sPayPalHost');
if ($host) {
$this->setPayPalHost($host);
}
return $this->payPalHost;
} | [
"public",
"function",
"getPayPalHost",
"(",
")",
"{",
"$",
"host",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'sPayPalHost'",
")",
";",
"if",
"(",
"$",
"host",
")",
... | Returns PayPal host.
@return string | [
"Returns",
"PayPal",
"host",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L153-L161 |
44,025 | OXID-eSales/paypal | Core/Config.php | Config.getHost | public function getHost()
{
if ($this->isSandboxEnabled()) {
$url = $this->getPayPalSandboxHost();
} else {
$url = $this->getPayPalHost();
}
return $url;
} | php | public function getHost()
{
if ($this->isSandboxEnabled()) {
$url = $this->getPayPalSandboxHost();
} else {
$url = $this->getPayPalHost();
}
return $url;
} | [
"public",
"function",
"getHost",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSandboxEnabled",
"(",
")",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getPayPalSandboxHost",
"(",
")",
";",
"}",
"else",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
... | Returns PayPal OR PayPal sandbox host.
@return string | [
"Returns",
"PayPal",
"OR",
"PayPal",
"sandbox",
"host",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L193-L202 |
44,026 | OXID-eSales/paypal | Core/Config.php | Config.getPayPalApiUrl | public function getPayPalApiUrl()
{
$url = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sPayPalApiUrl');
if ($url) {
$this->setPayPalApiUrl($url);
}
return $this->payPalApiUrl;
} | php | public function getPayPalApiUrl()
{
$url = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sPayPalApiUrl');
if ($url) {
$this->setPayPalApiUrl($url);
}
return $this->payPalApiUrl;
} | [
"public",
"function",
"getPayPalApiUrl",
"(",
")",
"{",
"$",
"url",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'sPayPalApiUrl'",
")",
";",
"if",
"(",
"$",
"url",
")",... | Api Url getter
@return string | [
"Api",
"Url",
"getter"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L219-L227 |
44,027 | OXID-eSales/paypal | Core/Config.php | Config.getPayPalSandboxApiUrl | public function getPayPalSandboxApiUrl()
{
$url = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sPayPalSandboxApiUrl');
if ($url) {
$this->setPayPalSandboxApiUrl($url);
}
return $this->payPalSandboxApiUrl;
} | php | public function getPayPalSandboxApiUrl()
{
$url = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sPayPalSandboxApiUrl');
if ($url) {
$this->setPayPalSandboxApiUrl($url);
}
return $this->payPalSandboxApiUrl;
} | [
"public",
"function",
"getPayPalSandboxApiUrl",
"(",
")",
"{",
"$",
"url",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'sPayPalSandboxApiUrl'",
")",
";",
"if",
"(",
"$",
... | PayPal sandbox api url getter
@return string | [
"PayPal",
"sandbox",
"api",
"url",
"getter"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L244-L252 |
44,028 | OXID-eSales/paypal | Core/Config.php | Config.getUrl | public function getUrl()
{
if ($this->isSandboxEnabled()) {
$url = $this->getPayPalSandboxUrl();
} else {
$url = $this->getPayPalUrl();
}
return $url;
} | php | public function getUrl()
{
if ($this->isSandboxEnabled()) {
$url = $this->getPayPalSandboxUrl();
} else {
$url = $this->getPayPalUrl();
}
return $url;
} | [
"public",
"function",
"getUrl",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSandboxEnabled",
"(",
")",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getPayPalSandboxUrl",
"(",
")",
";",
"}",
"else",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"... | Get PayPal url.
@return string | [
"Get",
"PayPal",
"url",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L325-L334 |
44,029 | OXID-eSales/paypal | Core/Config.php | Config.getPayPalCommunicationUrl | public function getPayPalCommunicationUrl($token = null, $userAction = 'continue')
{
return $this->getUrl() . '&cmd=_express-checkout&token=' . (string) $token . '&useraction=' . (string) $userAction;
} | php | public function getPayPalCommunicationUrl($token = null, $userAction = 'continue')
{
return $this->getUrl() . '&cmd=_express-checkout&token=' . (string) $token . '&useraction=' . (string) $userAction;
} | [
"public",
"function",
"getPayPalCommunicationUrl",
"(",
"$",
"token",
"=",
"null",
",",
"$",
"userAction",
"=",
"'continue'",
")",
"{",
"return",
"$",
"this",
"->",
"getUrl",
"(",
")",
".",
"'&cmd=_express-checkout&token='",
".",
"(",
"string",
")",
"$",
"to... | Returns redirect url.
@param string $token token to append to redirect url.
@param string $userAction checkout button action - continue (standard checkout) or commit (express checkout)
@return string | [
"Returns",
"redirect",
"url",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L570-L573 |
44,030 | OXID-eSales/paypal | Core/Config.php | Config.getLogoUrl | public function getLogoUrl()
{
$logoUrl = false;
$logoName = $this->getLogoImageName();
if (!empty($logoName)) {
$logo = oxNew(\OxidEsales\PayPalModule\Core\ShopLogo::class);
$logo->setImageDir(\OxidEsales\Eshop\Core\Registry::getConfig()->getImageDir());
$logo->setImageDirUrl(\OxidEsales\Eshop\Core\Registry::getConfig()->getImageUrl());
$logo->setImageName($logoName);
$logo->setImageHandler(\OxidEsales\Eshop\Core\Registry::getUtilsPic());
$logoUrl = $logo->getShopLogoUrl();
}
return $logoUrl;
} | php | public function getLogoUrl()
{
$logoUrl = false;
$logoName = $this->getLogoImageName();
if (!empty($logoName)) {
$logo = oxNew(\OxidEsales\PayPalModule\Core\ShopLogo::class);
$logo->setImageDir(\OxidEsales\Eshop\Core\Registry::getConfig()->getImageDir());
$logo->setImageDirUrl(\OxidEsales\Eshop\Core\Registry::getConfig()->getImageUrl());
$logo->setImageName($logoName);
$logo->setImageHandler(\OxidEsales\Eshop\Core\Registry::getUtilsPic());
$logoUrl = $logo->getShopLogoUrl();
}
return $logoUrl;
} | [
"public",
"function",
"getLogoUrl",
"(",
")",
"{",
"$",
"logoUrl",
"=",
"false",
";",
"$",
"logoName",
"=",
"$",
"this",
"->",
"getLogoImageName",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"logoName",
")",
")",
"{",
"$",
"logo",
"=",
"oxNew... | Get logo Url based on selected settings
Returns shop url, or false
@return string|bool | [
"Get",
"logo",
"Url",
"based",
"on",
"selected",
"settings",
"Returns",
"shop",
"url",
"or",
"false"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L582-L599 |
44,031 | OXID-eSales/paypal | Core/Config.php | Config.getMaxPayPalDeliveryAmount | public function getMaxPayPalDeliveryAmount()
{
$maxDeliveryAmount = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('dMaxPayPalDeliveryAmount');
if (!$maxDeliveryAmount) {
$maxDeliveryAmount = $this->maxDeliveryAmount;
}
return $maxDeliveryAmount;
} | php | public function getMaxPayPalDeliveryAmount()
{
$maxDeliveryAmount = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('dMaxPayPalDeliveryAmount');
if (!$maxDeliveryAmount) {
$maxDeliveryAmount = $this->maxDeliveryAmount;
}
return $maxDeliveryAmount;
} | [
"public",
"function",
"getMaxPayPalDeliveryAmount",
"(",
")",
"{",
"$",
"maxDeliveryAmount",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'dMaxPayPalDeliveryAmount'",
")",
";",
... | Returns max delivery amount.
@return integer | [
"Returns",
"max",
"delivery",
"amount",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L704-L712 |
44,032 | OXID-eSales/paypal | Core/Config.php | Config.getPartnerCode | public function getPartnerCode()
{
$facts = new \OxidEsales\Facts\Facts();
$key = $this->isShortcutPayment() ? self::PARTNERCODE_SHORTCUT_KEY : $facts->getEdition();
return $this->partnerCodes[$key];
} | php | public function getPartnerCode()
{
$facts = new \OxidEsales\Facts\Facts();
$key = $this->isShortcutPayment() ? self::PARTNERCODE_SHORTCUT_KEY : $facts->getEdition();
return $this->partnerCodes[$key];
} | [
"public",
"function",
"getPartnerCode",
"(",
")",
"{",
"$",
"facts",
"=",
"new",
"\\",
"OxidEsales",
"\\",
"Facts",
"\\",
"Facts",
"(",
")",
";",
"$",
"key",
"=",
"$",
"this",
"->",
"isShortcutPayment",
"(",
")",
"?",
"self",
"::",
"PARTNERCODE_SHORTCUT_... | 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!
@return string partner code. | [
"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!"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L721-L727 |
44,033 | OXID-eSales/paypal | Core/Config.php | Config.getLogoImageName | protected function getLogoImageName()
{
$option = $this->getParameter('sOEPayPalLogoImageOption');
switch ($option) {
case 'shopLogo':
$logo = $this->getParameter('sShopLogo');
break;
case 'customLogo':
$logo = $this->getParameter('sOEPayPalCustomShopLogoImage');
break;
case 'noLogo':
default:
$logo = '';
return $logo;
}
return $logo;
} | php | protected function getLogoImageName()
{
$option = $this->getParameter('sOEPayPalLogoImageOption');
switch ($option) {
case 'shopLogo':
$logo = $this->getParameter('sShopLogo');
break;
case 'customLogo':
$logo = $this->getParameter('sOEPayPalCustomShopLogoImage');
break;
case 'noLogo':
default:
$logo = '';
return $logo;
}
return $logo;
} | [
"protected",
"function",
"getLogoImageName",
"(",
")",
"{",
"$",
"option",
"=",
"$",
"this",
"->",
"getParameter",
"(",
"'sOEPayPalLogoImageOption'",
")",
";",
"switch",
"(",
"$",
"option",
")",
"{",
"case",
"'shopLogo'",
":",
"$",
"logo",
"=",
"$",
"this"... | Returns logo image name according to parameter
@return mixed|string | [
"Returns",
"logo",
"image",
"name",
"according",
"to",
"parameter"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L756-L774 |
44,034 | OXID-eSales/paypal | Core/Config.php | Config.isShortcutPayment | protected function isShortcutPayment()
{
$trigger = (int) \OxidEsales\Eshop\Core\Registry::getSession()->getVariable(self::OEPAYPAL_TRIGGER_NAME);
return (bool) ($trigger == self::OEPAYPAL_SHORTCUT);
} | php | protected function isShortcutPayment()
{
$trigger = (int) \OxidEsales\Eshop\Core\Registry::getSession()->getVariable(self::OEPAYPAL_TRIGGER_NAME);
return (bool) ($trigger == self::OEPAYPAL_SHORTCUT);
} | [
"protected",
"function",
"isShortcutPayment",
"(",
")",
"{",
"$",
"trigger",
"=",
"(",
"int",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getSession",
"(",
")",
"->",
"getVariable",
"(",
"self",
"::",
"OEPAYPAL_TRIGGER_NAME... | Was the payment triggered by shortcut button or not?
@return bool | [
"Was",
"the",
"payment",
"triggered",
"by",
"shortcut",
"button",
"or",
"not?"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Config.php#L801-L805 |
44,035 | OXID-eSales/paypal | Model/Address.php | Address.createPayPalAddress | public function createPayPalAddress($details, $userId)
{
$addressData = $this->prepareDataPayPalAddress($details);
if ($addressId = $this->existPayPalAddress($addressData)) {
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("deladrid", $addressId);
} else {
$this->oxaddress__oxuserid = new \OxidEsales\Eshop\Core\Field($userId);
$this->oxaddress__oxfname = new \OxidEsales\Eshop\Core\Field($addressData['oxfname']);
$this->oxaddress__oxlname = new \OxidEsales\Eshop\Core\Field($addressData['oxlname']);
$this->oxaddress__oxstreet = new \OxidEsales\Eshop\Core\Field($addressData['oxstreet']);
$this->oxaddress__oxstreetnr = new \OxidEsales\Eshop\Core\Field($addressData['oxstreetnr']);
$this->oxaddress__oxaddinfo = new \OxidEsales\Eshop\Core\Field($addressData['oxaddinfo']);
$this->oxaddress__oxcity = new \OxidEsales\Eshop\Core\Field($addressData['oxcity']);
$this->oxaddress__oxcountryid = new \OxidEsales\Eshop\Core\Field($addressData['oxcountryid']);
$this->oxaddress__oxstateid = new \OxidEsales\Eshop\Core\Field($addressData['oxstateid']);
$this->oxaddress__oxzip = new \OxidEsales\Eshop\Core\Field($addressData['oxzip']);
$this->oxaddress__oxfon = new \OxidEsales\Eshop\Core\Field($addressData['oxfon']);
$this->save();
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("deladrid", $this->getId());
}
} | php | public function createPayPalAddress($details, $userId)
{
$addressData = $this->prepareDataPayPalAddress($details);
if ($addressId = $this->existPayPalAddress($addressData)) {
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("deladrid", $addressId);
} else {
$this->oxaddress__oxuserid = new \OxidEsales\Eshop\Core\Field($userId);
$this->oxaddress__oxfname = new \OxidEsales\Eshop\Core\Field($addressData['oxfname']);
$this->oxaddress__oxlname = new \OxidEsales\Eshop\Core\Field($addressData['oxlname']);
$this->oxaddress__oxstreet = new \OxidEsales\Eshop\Core\Field($addressData['oxstreet']);
$this->oxaddress__oxstreetnr = new \OxidEsales\Eshop\Core\Field($addressData['oxstreetnr']);
$this->oxaddress__oxaddinfo = new \OxidEsales\Eshop\Core\Field($addressData['oxaddinfo']);
$this->oxaddress__oxcity = new \OxidEsales\Eshop\Core\Field($addressData['oxcity']);
$this->oxaddress__oxcountryid = new \OxidEsales\Eshop\Core\Field($addressData['oxcountryid']);
$this->oxaddress__oxstateid = new \OxidEsales\Eshop\Core\Field($addressData['oxstateid']);
$this->oxaddress__oxzip = new \OxidEsales\Eshop\Core\Field($addressData['oxzip']);
$this->oxaddress__oxfon = new \OxidEsales\Eshop\Core\Field($addressData['oxfon']);
$this->save();
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("deladrid", $this->getId());
}
} | [
"public",
"function",
"createPayPalAddress",
"(",
"$",
"details",
",",
"$",
"userId",
")",
"{",
"$",
"addressData",
"=",
"$",
"this",
"->",
"prepareDataPayPalAddress",
"(",
"$",
"details",
")",
";",
"if",
"(",
"$",
"addressId",
"=",
"$",
"this",
"->",
"e... | Creates user shipping address from PayPal data and set to session.
@param \OxidEsales\PayPalModule\Model\Response\ResponseGetExpressCheckoutDetails $details PayPal data.
@param string $userId user id. | [
"Creates",
"user",
"shipping",
"address",
"from",
"PayPal",
"data",
"and",
"set",
"to",
"session",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Address.php#L37-L59 |
44,036 | OXID-eSales/paypal | Model/Address.php | Address.checkRequiredFieldsPayPalAddress | protected function checkRequiredFieldsPayPalAddress($addressData)
{
$reqFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aMustFillFields');
$result = true;
foreach ($reqFields as $field) {
if (strpos($field, 'oxaddress__') === 0 && empty($addressData[str_replace('oxaddress__', '', $field)])) {
return false;
}
}
return $result;
} | php | protected function checkRequiredFieldsPayPalAddress($addressData)
{
$reqFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aMustFillFields');
$result = true;
foreach ($reqFields as $field) {
if (strpos($field, 'oxaddress__') === 0 && empty($addressData[str_replace('oxaddress__', '', $field)])) {
return false;
}
}
return $result;
} | [
"protected",
"function",
"checkRequiredFieldsPayPalAddress",
"(",
"$",
"addressData",
")",
"{",
"$",
"reqFields",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'aMustFillFields'",... | Check required fields.
@param array $addressData - PayPal data.
@return bool | [
"Check",
"required",
"fields",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Address.php#L107-L120 |
44,037 | OXID-eSales/paypal | Model/Address.php | Address.existPayPalAddress | protected function existPayPalAddress($addressData)
{
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$query = "SELECT `oxid` FROM `oxaddress` WHERE 1 ";
$query .= " AND `oxfname` = " . $db->quote($addressData['oxfname']);
$query .= " AND `oxlname` = " . $db->quote($addressData['oxlname']);
$query .= " AND `oxstreet` = " . $db->quote($addressData['oxstreet']);
$query .= " AND `oxstreetnr` = " . $db->quote($addressData['oxstreetnr']);
$query .= " AND `oxcity` = " . $db->quote($addressData['oxcity']);
$query .= " AND `oxcountryid` = " . $db->quote($addressData['oxcountryid']);
$query .= " AND `oxstateid` = " . $db->quote($addressData['oxstateid']);
$query .= " AND `oxzip` = " . $db->quote($addressData['oxzip']);
$query .= " AND `oxfon` = " . $db->quote($addressData['oxfon']);
if ($addressId = $db->getOne($query)) {
return $addressId;
}
return false;
} | php | protected function existPayPalAddress($addressData)
{
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$query = "SELECT `oxid` FROM `oxaddress` WHERE 1 ";
$query .= " AND `oxfname` = " . $db->quote($addressData['oxfname']);
$query .= " AND `oxlname` = " . $db->quote($addressData['oxlname']);
$query .= " AND `oxstreet` = " . $db->quote($addressData['oxstreet']);
$query .= " AND `oxstreetnr` = " . $db->quote($addressData['oxstreetnr']);
$query .= " AND `oxcity` = " . $db->quote($addressData['oxcity']);
$query .= " AND `oxcountryid` = " . $db->quote($addressData['oxcountryid']);
$query .= " AND `oxstateid` = " . $db->quote($addressData['oxstateid']);
$query .= " AND `oxzip` = " . $db->quote($addressData['oxzip']);
$query .= " AND `oxfon` = " . $db->quote($addressData['oxfon']);
if ($addressId = $db->getOne($query)) {
return $addressId;
}
return false;
} | [
"protected",
"function",
"existPayPalAddress",
"(",
"$",
"addressData",
")",
"{",
"$",
"db",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"query",
"=",
"\"SELECT `oxid` FROM `oxaddress` WHERE ... | Checks if exists PayPal address.
@param array $addressData
@return bool|string | [
"Checks",
"if",
"exists",
"PayPal",
"address",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Address.php#L129-L149 |
44,038 | OXID-eSales/paypal | Model/Address.php | Address.splitShipToStreetPayPalAddress | public function splitShipToStreetPayPalAddress($shipToStreet)
{
$address = array();
$shipToStreet = trim($shipToStreet);
// checking if street number is at the end of the address
preg_match("/(.*\S)\s+(\d+\s*\S*)$/", $shipToStreet, $address);
// checking if street name and number was found
if (!empty($address[1]) && $address[2]) {
$address['street'] = $address[1];
$address['streetnr'] = $address[2];
return $address;
}
// checking if street number is at the begining of the address
preg_match("/(\d+\S*)\s+(.*)$/", $shipToStreet, $address);
// checking if street name and number was found
if (!empty($address[1]) && $address[2]) {
$address['street'] = $address[2];
$address['streetnr'] = $address[1];
return $address;
}
// it is not possible to resolve address, so assign it without any parsing
$address['street'] = $shipToStreet;
$address['streetnr'] = "";
return $address;
} | php | public function splitShipToStreetPayPalAddress($shipToStreet)
{
$address = array();
$shipToStreet = trim($shipToStreet);
// checking if street number is at the end of the address
preg_match("/(.*\S)\s+(\d+\s*\S*)$/", $shipToStreet, $address);
// checking if street name and number was found
if (!empty($address[1]) && $address[2]) {
$address['street'] = $address[1];
$address['streetnr'] = $address[2];
return $address;
}
// checking if street number is at the begining of the address
preg_match("/(\d+\S*)\s+(.*)$/", $shipToStreet, $address);
// checking if street name and number was found
if (!empty($address[1]) && $address[2]) {
$address['street'] = $address[2];
$address['streetnr'] = $address[1];
return $address;
}
// it is not possible to resolve address, so assign it without any parsing
$address['street'] = $shipToStreet;
$address['streetnr'] = "";
return $address;
} | [
"public",
"function",
"splitShipToStreetPayPalAddress",
"(",
"$",
"shipToStreet",
")",
"{",
"$",
"address",
"=",
"array",
"(",
")",
";",
"$",
"shipToStreet",
"=",
"trim",
"(",
"$",
"shipToStreet",
")",
";",
"// checking if street number is at the end of the address",
... | Split street nr from address
@param string $shipToStreet address string
@return array | [
"Split",
"street",
"nr",
"from",
"address"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Address.php#L158-L190 |
44,039 | OXID-eSales/paypal | Model/OutOfStockValidator.php | OutOfStockValidator.hasOutOfStockArticles | public function hasOutOfStockArticles()
{
$result = false;
$basketContents = $this->getBasket()->getContents();
foreach ($basketContents as $basketItem) {
$article = $basketItem->getArticle();
if (($article->getStockAmount() - $basketItem->getAmount()) < $this->getEmptyStockLevel()) {
$result = true;
break;
}
}
return $result;
} | php | public function hasOutOfStockArticles()
{
$result = false;
$basketContents = $this->getBasket()->getContents();
foreach ($basketContents as $basketItem) {
$article = $basketItem->getArticle();
if (($article->getStockAmount() - $basketItem->getAmount()) < $this->getEmptyStockLevel()) {
$result = true;
break;
}
}
return $result;
} | [
"public",
"function",
"hasOutOfStockArticles",
"(",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"basketContents",
"=",
"$",
"this",
"->",
"getBasket",
"(",
")",
"->",
"getContents",
"(",
")",
";",
"foreach",
"(",
"$",
"basketContents",
"as",
"$",
"b... | Checks if basket has Articles that are out of stock.
@return bool | [
"Checks",
"if",
"basket",
"has",
"Articles",
"that",
"are",
"out",
"of",
"stock",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OutOfStockValidator.php#L88-L103 |
44,040 | OXID-eSales/paypal | Model/IPNRequestVerifier.php | IPNRequestVerifier.getCommunicationService | public function getCommunicationService()
{
if ($this->communicationService === null) {
$this->communicationService = oxNew(\OxidEsales\PayPalModule\Core\PayPalService::class);
}
return $this->communicationService;
} | php | public function getCommunicationService()
{
if ($this->communicationService === null) {
$this->communicationService = oxNew(\OxidEsales\PayPalModule\Core\PayPalService::class);
}
return $this->communicationService;
} | [
"public",
"function",
"getCommunicationService",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"communicationService",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"communicationService",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Core",... | Getter for the PayPal service
@return \OxidEsales\PayPalModule\Core\PayPalService | [
"Getter",
"for",
"the",
"PayPal",
"service"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNRequestVerifier.php#L120-L127 |
44,041 | OXID-eSales/paypal | Model/IPNRequestVerifier.php | IPNRequestVerifier.getIPNRequestValidator | public function getIPNRequestValidator()
{
if ($this->ipnRequestValidator === null) {
$this->ipnRequestValidator = oxNew(\OxidEsales\PayPalModule\Model\IPNRequestValidator::class);
}
return $this->ipnRequestValidator;
} | php | public function getIPNRequestValidator()
{
if ($this->ipnRequestValidator === null) {
$this->ipnRequestValidator = oxNew(\OxidEsales\PayPalModule\Model\IPNRequestValidator::class);
}
return $this->ipnRequestValidator;
} | [
"public",
"function",
"getIPNRequestValidator",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ipnRequestValidator",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"ipnRequestValidator",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
... | Returns IPN request validator object.
@return \OxidEsales\PayPalModule\Model\IPNRequestValidator | [
"Returns",
"IPN",
"request",
"validator",
"object",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNRequestVerifier.php#L144-L151 |
44,042 | OXID-eSales/paypal | Model/IPNRequestVerifier.php | IPNRequestVerifier.getPayPalRequest | public function getPayPalRequest()
{
if (is_null($this->payPalRequest)) {
$this->payPalRequest = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest::class);
}
return $this->payPalRequest;
} | php | public function getPayPalRequest()
{
if (is_null($this->payPalRequest)) {
$this->payPalRequest = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest::class);
}
return $this->payPalRequest;
} | [
"public",
"function",
"getPayPalRequest",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"payPalRequest",
")",
")",
"{",
"$",
"this",
"->",
"payPalRequest",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"... | Return, create object to call PayPal with.
@return \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest | [
"Return",
"create",
"object",
"to",
"call",
"PayPal",
"with",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNRequestVerifier.php#L168-L175 |
44,043 | OXID-eSales/paypal | Model/IPNRequestVerifier.php | IPNRequestVerifier.requestCorrect | public function requestCorrect()
{
$request = $this->getRequest();
$rawRequestData = $request->getPost();
$responseDoVerifyWithPayPal = $this->doVerifyWithPayPal($rawRequestData);
$ipnRequestValidator = $this->getIPNRequestValidator();
$ipnRequestValidator->setPayPalRequest($rawRequestData);
$ipnRequestValidator->setPayPalResponse($responseDoVerifyWithPayPal);
$ipnRequestValidator->setShopOwnerUserName($this->getShopOwner());
$requestCorrect = $ipnRequestValidator->isValid();
if (!$requestCorrect) {
$failureMessage = $ipnRequestValidator->getValidationFailureMessage();
$this->setFailureMessage($failureMessage);
}
return $requestCorrect;
} | php | public function requestCorrect()
{
$request = $this->getRequest();
$rawRequestData = $request->getPost();
$responseDoVerifyWithPayPal = $this->doVerifyWithPayPal($rawRequestData);
$ipnRequestValidator = $this->getIPNRequestValidator();
$ipnRequestValidator->setPayPalRequest($rawRequestData);
$ipnRequestValidator->setPayPalResponse($responseDoVerifyWithPayPal);
$ipnRequestValidator->setShopOwnerUserName($this->getShopOwner());
$requestCorrect = $ipnRequestValidator->isValid();
if (!$requestCorrect) {
$failureMessage = $ipnRequestValidator->getValidationFailureMessage();
$this->setFailureMessage($failureMessage);
}
return $requestCorrect;
} | [
"public",
"function",
"requestCorrect",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"rawRequestData",
"=",
"$",
"request",
"->",
"getPost",
"(",
")",
";",
"$",
"responseDoVerifyWithPayPal",
"=",
"$",
"this",
"... | IPN handling function.
- verify with PayPal.
@return bool | [
"IPN",
"handling",
"function",
".",
"-",
"verify",
"with",
"PayPal",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNRequestVerifier.php#L203-L222 |
44,044 | OXID-eSales/paypal | Model/IPNRequestVerifier.php | IPNRequestVerifier.doVerifyWithPayPal | protected function doVerifyWithPayPal($requestData)
{
$callerService = $this->getCommunicationService();
$payPalPayPalRequest = $this->getPayPalRequest();
foreach ($requestData as $requestParameterName => $requestParameterValue) {
$payPalPayPalRequest->setParameter($requestParameterName, $requestParameterValue);
}
$responseDoVerifyWithPayPal = $callerService->doVerifyWithPayPal($payPalPayPalRequest, $requestData['charset']);
return $responseDoVerifyWithPayPal;
} | php | protected function doVerifyWithPayPal($requestData)
{
$callerService = $this->getCommunicationService();
$payPalPayPalRequest = $this->getPayPalRequest();
foreach ($requestData as $requestParameterName => $requestParameterValue) {
$payPalPayPalRequest->setParameter($requestParameterName, $requestParameterValue);
}
$responseDoVerifyWithPayPal = $callerService->doVerifyWithPayPal($payPalPayPalRequest, $requestData['charset']);
return $responseDoVerifyWithPayPal;
} | [
"protected",
"function",
"doVerifyWithPayPal",
"(",
"$",
"requestData",
")",
"{",
"$",
"callerService",
"=",
"$",
"this",
"->",
"getCommunicationService",
"(",
")",
";",
"$",
"payPalPayPalRequest",
"=",
"$",
"this",
"->",
"getPayPalRequest",
"(",
")",
";",
"fo... | Call PayPal to check if IPN request originally from PayPal.
@param array $requestData data of request.
@return \OxidEsales\PayPalModule\Model\Response\Response | [
"Call",
"PayPal",
"to",
"check",
"if",
"IPN",
"request",
"originally",
"from",
"PayPal",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/IPNRequestVerifier.php#L231-L241 |
44,045 | OXID-eSales/paypal | Model/OrderPaymentListCalculator.php | OrderPaymentListCalculator.calculate | public function calculate()
{
$this->init();
foreach ($this->getPaymentList() as $payment) {
$status = $payment->getStatus();
$action = $payment->getAction();
$amount = $payment->getAmount();
$this->aggregateAmounts($action, $status, $amount);
}
} | php | public function calculate()
{
$this->init();
foreach ($this->getPaymentList() as $payment) {
$status = $payment->getStatus();
$action = $payment->getAction();
$amount = $payment->getAmount();
$this->aggregateAmounts($action, $status, $amount);
}
} | [
"public",
"function",
"calculate",
"(",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getPaymentList",
"(",
")",
"as",
"$",
"payment",
")",
"{",
"$",
"status",
"=",
"$",
"payment",
"->",
"getStatus",
"(",
"... | Sum up payment amounts for capture, void, refund.
Take into account successful transactions only. | [
"Sum",
"up",
"payment",
"amounts",
"for",
"capture",
"void",
"refund",
".",
"Take",
"into",
"account",
"successful",
"transactions",
"only",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderPaymentListCalculator.php#L88-L99 |
44,046 | OXID-eSales/paypal | Model/OrderPaymentListCalculator.php | OrderPaymentListCalculator.getVoidedAmount | public function getVoidedAmount()
{
$return = 0.0;
if (0 < $this->voidedAmount) {
//void action is only logged when executed via shop admin
$return = $this->voidedAmount;
} elseif (0 < $this->voidedAuthAmount) {
//no data from void actions means we might have a voided Authorization
$return = $this->voidedAuthAmount - $this->capturedAmount;
}
return $return;
} | php | public function getVoidedAmount()
{
$return = 0.0;
if (0 < $this->voidedAmount) {
//void action is only logged when executed via shop admin
$return = $this->voidedAmount;
} elseif (0 < $this->voidedAuthAmount) {
//no data from void actions means we might have a voided Authorization
$return = $this->voidedAuthAmount - $this->capturedAmount;
}
return $return;
} | [
"public",
"function",
"getVoidedAmount",
"(",
")",
"{",
"$",
"return",
"=",
"0.0",
";",
"if",
"(",
"0",
"<",
"$",
"this",
"->",
"voidedAmount",
")",
"{",
"//void action is only logged when executed via shop admin",
"$",
"return",
"=",
"$",
"this",
"->",
"voide... | Getter for voided amount.
@return float | [
"Getter",
"for",
"voided",
"amount",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/OrderPaymentListCalculator.php#L126-L139 |
44,047 | OXID-eSales/paypal | Controller/Admin/OrderList.php | OrderList._prepareWhereQuery | protected function _prepareWhereQuery($where, $fullQuery)
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$query = parent::_prepareWhereQuery($where, $fullQuery);
$paymentStatus = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("paypalpaymentstatus");
$paymentStatusList = new \OxidEsales\PayPalModule\Model\OrderPaymentStatusList();
if ($paymentStatus && $paymentStatus != '-1' && in_array($paymentStatus, $paymentStatusList->getArray())) {
$query .= " AND ( `oepaypal_order`.`oepaypal_paymentstatus` = " . $database->quote($paymentStatus) . " )";
$query .= " AND ( `oepaypal_order`.`oepaypal_orderid` IS NOT NULL ) ";
}
$payment = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("paypalpayment");
if ($payment && $payment != '-1') {
$query .= " and ( oxorder.oxpaymenttype = " . $database->quote($payment) . " )";
}
return $query;
} | php | protected function _prepareWhereQuery($where, $fullQuery)
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$query = parent::_prepareWhereQuery($where, $fullQuery);
$paymentStatus = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("paypalpaymentstatus");
$paymentStatusList = new \OxidEsales\PayPalModule\Model\OrderPaymentStatusList();
if ($paymentStatus && $paymentStatus != '-1' && in_array($paymentStatus, $paymentStatusList->getArray())) {
$query .= " AND ( `oepaypal_order`.`oepaypal_paymentstatus` = " . $database->quote($paymentStatus) . " )";
$query .= " AND ( `oepaypal_order`.`oepaypal_orderid` IS NOT NULL ) ";
}
$payment = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("paypalpayment");
if ($payment && $payment != '-1') {
$query .= " and ( oxorder.oxpaymenttype = " . $database->quote($payment) . " )";
}
return $query;
} | [
"protected",
"function",
"_prepareWhereQuery",
"(",
"$",
"where",
",",
"$",
"fullQuery",
")",
"{",
"$",
"database",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"query",
"=",
"parent",
... | Adding folder check.
@param array $where SQL condition array.
@param string $sqlFull SQL query string.
@return string | [
"Adding",
"folder",
"check",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Admin/OrderList.php#L89-L108 |
44,048 | OXID-eSales/paypal | Model/DbGateways/PayPalOrderDbGateway.php | PayPalOrderDbGateway.save | public function save($data)
{
$db = $this->getDb();
$fields = [];
foreach ($data as $field => $value) {
$fields[] = '`' . $field . '` = ' . $db->quote($value);
}
$query = 'INSERT INTO `oepaypal_order` SET ';
$query .= implode(', ', $fields);
$query .= ' ON DUPLICATE KEY UPDATE ';
$query .= ' `oepaypal_orderid`=LAST_INSERT_ID(`oepaypal_orderid`), ';
$query .= implode(', ', $fields);
$db->execute($query);
$id = $data['oepaypal_orderid'];
if (empty($id)) {
$id = $db->getOne('SELECT LAST_INSERT_ID()');
}
return $id;
} | php | public function save($data)
{
$db = $this->getDb();
$fields = [];
foreach ($data as $field => $value) {
$fields[] = '`' . $field . '` = ' . $db->quote($value);
}
$query = 'INSERT INTO `oepaypal_order` SET ';
$query .= implode(', ', $fields);
$query .= ' ON DUPLICATE KEY UPDATE ';
$query .= ' `oepaypal_orderid`=LAST_INSERT_ID(`oepaypal_orderid`), ';
$query .= implode(', ', $fields);
$db->execute($query);
$id = $data['oepaypal_orderid'];
if (empty($id)) {
$id = $db->getOne('SELECT LAST_INSERT_ID()');
}
return $id;
} | [
"public",
"function",
"save",
"(",
"$",
"data",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
";",
"$",
"fields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"field",
"=>",
"$",
"value",
")",
"{",
"$",
"field... | Save PayPal order data to database.
@param array $data
@return bool | [
"Save",
"PayPal",
"order",
"data",
"to",
"database",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/DbGateways/PayPalOrderDbGateway.php#L36-L59 |
44,049 | OXID-eSales/paypal | Model/DbGateways/PayPalOrderDbGateway.php | PayPalOrderDbGateway.load | public function load($orderId)
{
$db = $this->getDb();
$data = $db->getRow('SELECT * FROM `oepaypal_order` WHERE `oepaypal_orderid` = ' . $db->quote($orderId));
return $data;
} | php | public function load($orderId)
{
$db = $this->getDb();
$data = $db->getRow('SELECT * FROM `oepaypal_order` WHERE `oepaypal_orderid` = ' . $db->quote($orderId));
return $data;
} | [
"public",
"function",
"load",
"(",
"$",
"orderId",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
";",
"$",
"data",
"=",
"$",
"db",
"->",
"getRow",
"(",
"'SELECT * FROM `oepaypal_order` WHERE `oepaypal_orderid` = '",
".",
"$",
"db",
"->",
... | Load PayPal order data from Db.
@param string $orderId Order id.
@return array | [
"Load",
"PayPal",
"order",
"data",
"from",
"Db",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/DbGateways/PayPalOrderDbGateway.php#L68-L74 |
44,050 | OXID-eSales/paypal | Model/DbGateways/PayPalOrderDbGateway.php | PayPalOrderDbGateway.delete | public function delete($orderId)
{
$db = $this->getDb();
$db->startTransaction();
$deleteCommentsResult = $db->execute(
'DELETE
`oepaypal_orderpaymentcomments`
FROM `oepaypal_orderpaymentcomments`
INNER JOIN `oepaypal_orderpayments` ON `oepaypal_orderpayments`.`oepaypal_paymentid` = `oepaypal_orderpaymentcomments`.`oepaypal_paymentid`
WHERE `oepaypal_orderpayments`.`oepaypal_orderid` = ' . $db->quote($orderId)
);
$deleteOrderPaymentResult = $db->execute('DELETE FROM `oepaypal_orderpayments` WHERE `oepaypal_orderid` = ' . $db->quote($orderId));
$deleteOrderResult = $db->execute('DELETE FROM `oepaypal_order` WHERE `oepaypal_orderid` = ' . $db->quote($orderId));
$result = ($deleteOrderResult !== false) || ($deleteOrderPaymentResult !== false) || ($deleteCommentsResult !== false);
if ($result) {
$db->commitTransaction();
} else {
$db->rollbackTransaction();
}
return $result;
} | php | public function delete($orderId)
{
$db = $this->getDb();
$db->startTransaction();
$deleteCommentsResult = $db->execute(
'DELETE
`oepaypal_orderpaymentcomments`
FROM `oepaypal_orderpaymentcomments`
INNER JOIN `oepaypal_orderpayments` ON `oepaypal_orderpayments`.`oepaypal_paymentid` = `oepaypal_orderpaymentcomments`.`oepaypal_paymentid`
WHERE `oepaypal_orderpayments`.`oepaypal_orderid` = ' . $db->quote($orderId)
);
$deleteOrderPaymentResult = $db->execute('DELETE FROM `oepaypal_orderpayments` WHERE `oepaypal_orderid` = ' . $db->quote($orderId));
$deleteOrderResult = $db->execute('DELETE FROM `oepaypal_order` WHERE `oepaypal_orderid` = ' . $db->quote($orderId));
$result = ($deleteOrderResult !== false) || ($deleteOrderPaymentResult !== false) || ($deleteCommentsResult !== false);
if ($result) {
$db->commitTransaction();
} else {
$db->rollbackTransaction();
}
return $result;
} | [
"public",
"function",
"delete",
"(",
"$",
"orderId",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
";",
"$",
"db",
"->",
"startTransaction",
"(",
")",
";",
"$",
"deleteCommentsResult",
"=",
"$",
"db",
"->",
"execute",
"(",
"'DELETE\... | Delete PayPal order data from database.
@param string $orderId Order id.
@return bool | [
"Delete",
"PayPal",
"order",
"data",
"from",
"database",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/DbGateways/PayPalOrderDbGateway.php#L83-L107 |
44,051 | OXID-eSales/paypal | Model/Action/OrderCaptureAction.php | OrderCaptureAction.process | public function process()
{
$this->reauthorize();
$handler = $this->getHandler();
$response = $handler->getPayPalResponse();
$data = $handler->getData();
$this->updateOrder($response, $data);
$payment = $this->createPayment($response);
$paymentList = $this->getOrder()->getPaymentList();
$payment = $paymentList->addPayment($payment);
$this->addComment($payment, $data->getComment());
} | php | public function process()
{
$this->reauthorize();
$handler = $this->getHandler();
$response = $handler->getPayPalResponse();
$data = $handler->getData();
$this->updateOrder($response, $data);
$payment = $this->createPayment($response);
$paymentList = $this->getOrder()->getPaymentList();
$payment = $paymentList->addPayment($payment);
$this->addComment($payment, $data->getComment());
} | [
"public",
"function",
"process",
"(",
")",
"{",
"$",
"this",
"->",
"reauthorize",
"(",
")",
";",
"$",
"handler",
"=",
"$",
"this",
"->",
"getHandler",
"(",
")",
";",
"$",
"response",
"=",
"$",
"handler",
"->",
"getPayPalResponse",
"(",
")",
";",
"$",... | Processes PayPal response. | [
"Processes",
"PayPal",
"response",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/OrderCaptureAction.php#L61-L77 |
44,052 | OXID-eSales/paypal | Model/Action/OrderCaptureAction.php | OrderCaptureAction.reauthorize | protected function reauthorize()
{
$order = $this->getOrder();
if ($order->getCapturedAmount() > 0) {
$handler = $this->getReauthorizeHandler();
try {
$response = $handler->getPayPalResponse();
$payment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$payment->setDate($this->getDate());
$payment->setTransactionId($response->getAuthorizationId());
$payment->setCorrelationId($response->getCorrelationId());
$payment->setAction('re-authorization');
$payment->setStatus($response->getPaymentStatus());
$order->getPaymentList()->addPayment($payment);
} catch (\OxidEsales\PayPalModule\Core\Exception\PayPalResponseException $e) {
// Ignore PayPal response exceptions
}
}
} | php | protected function reauthorize()
{
$order = $this->getOrder();
if ($order->getCapturedAmount() > 0) {
$handler = $this->getReauthorizeHandler();
try {
$response = $handler->getPayPalResponse();
$payment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$payment->setDate($this->getDate());
$payment->setTransactionId($response->getAuthorizationId());
$payment->setCorrelationId($response->getCorrelationId());
$payment->setAction('re-authorization');
$payment->setStatus($response->getPaymentStatus());
$order->getPaymentList()->addPayment($payment);
} catch (\OxidEsales\PayPalModule\Core\Exception\PayPalResponseException $e) {
// Ignore PayPal response exceptions
}
}
} | [
"protected",
"function",
"reauthorize",
"(",
")",
"{",
"$",
"order",
"=",
"$",
"this",
"->",
"getOrder",
"(",
")",
";",
"if",
"(",
"$",
"order",
"->",
"getCapturedAmount",
"(",
")",
">",
"0",
")",
"{",
"$",
"handler",
"=",
"$",
"this",
"->",
"getRe... | Reauthorizes payment if order was captured at least once. | [
"Reauthorizes",
"payment",
"if",
"order",
"was",
"captured",
"at",
"least",
"once",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/OrderCaptureAction.php#L82-L103 |
44,053 | OXID-eSales/paypal | Model/Action/OrderCaptureAction.php | OrderCaptureAction.updateOrder | protected function updateOrder($response, $data)
{
$order = $this->getOrder();
$order->addCapturedAmount($response->getCapturedAmount());
$order->setPaymentStatus($data->getOrderStatus());
$order->save();
} | php | protected function updateOrder($response, $data)
{
$order = $this->getOrder();
$order->addCapturedAmount($response->getCapturedAmount());
$order->setPaymentStatus($data->getOrderStatus());
$order->save();
} | [
"protected",
"function",
"updateOrder",
"(",
"$",
"response",
",",
"$",
"data",
")",
"{",
"$",
"order",
"=",
"$",
"this",
"->",
"getOrder",
"(",
")",
";",
"$",
"order",
"->",
"addCapturedAmount",
"(",
"$",
"response",
"->",
"getCapturedAmount",
"(",
")",... | Updates order with PayPal response info.
@param object $response
@param object $data | [
"Updates",
"order",
"with",
"PayPal",
"response",
"info",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/OrderCaptureAction.php#L111-L117 |
44,054 | OXID-eSales/paypal | Model/Action/OrderCaptureAction.php | OrderCaptureAction.createPayment | protected function createPayment($response)
{
$payment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$payment->setDate($this->getDate());
$payment->setTransactionId($response->getTransactionId());
$payment->setCorrelationId($response->getCorrelationId());
$payment->setAction('capture');
$payment->setStatus($response->getPaymentStatus());
$payment->setAmount($response->getCapturedAmount());
$payment->setCurrency($response->getCurrency());
return $payment;
} | php | protected function createPayment($response)
{
$payment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
$payment->setDate($this->getDate());
$payment->setTransactionId($response->getTransactionId());
$payment->setCorrelationId($response->getCorrelationId());
$payment->setAction('capture');
$payment->setStatus($response->getPaymentStatus());
$payment->setAmount($response->getCapturedAmount());
$payment->setCurrency($response->getCurrency());
return $payment;
} | [
"protected",
"function",
"createPayment",
"(",
"$",
"response",
")",
"{",
"$",
"payment",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"OrderPayment",
"::",
"class",
")",
";",
"$",
"payment",
"->",
"setDate",
"(",
"$",
... | Creates Payment object with PayPal response data.
@param object $response
@return \OxidEsales\PayPalModule\Model\OrderPayment::class | [
"Creates",
"Payment",
"object",
"with",
"PayPal",
"response",
"data",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/OrderCaptureAction.php#L126-L138 |
44,055 | OXID-eSales/paypal | Model/Action/OrderCaptureAction.php | OrderCaptureAction.addComment | protected function addComment($payment, $commentContent)
{
if ($commentContent) {
$comment = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentComment::class);
$comment->setComment($commentContent);
$payment->addComment($comment);
}
} | php | protected function addComment($payment, $commentContent)
{
if ($commentContent) {
$comment = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentComment::class);
$comment->setComment($commentContent);
$payment->addComment($comment);
}
} | [
"protected",
"function",
"addComment",
"(",
"$",
"payment",
",",
"$",
"commentContent",
")",
"{",
"if",
"(",
"$",
"commentContent",
")",
"{",
"$",
"comment",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"OrderPaymentComme... | Adds comment to given Payment object.
@param object $payment
@param string $comment | [
"Adds",
"comment",
"to",
"given",
"Payment",
"object",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/OrderCaptureAction.php#L146-L154 |
44,056 | OXID-eSales/paypal | Model/DbGateways/OrderPaymentCommentDbGateway.php | OrderPaymentCommentDbGateway.delete | public function delete($commentId)
{
$db = $this->getDb();
$db->startTransaction();
$deleteResult = $db->execute('DELETE FROM `oepaypal_orderpaymentcomments` WHERE `oepaypal_commentid` = ' . $db->quote($commentId));
$result = ($deleteResult !== false);
if ($result) {
$db->commitTransaction();
} else {
$db->rollbackTransaction();
}
return $result;
} | php | public function delete($commentId)
{
$db = $this->getDb();
$db->startTransaction();
$deleteResult = $db->execute('DELETE FROM `oepaypal_orderpaymentcomments` WHERE `oepaypal_commentid` = ' . $db->quote($commentId));
$result = ($deleteResult !== false);
if ($result) {
$db->commitTransaction();
} else {
$db->rollbackTransaction();
}
return $result;
} | [
"public",
"function",
"delete",
"(",
"$",
"commentId",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
";",
"$",
"db",
"->",
"startTransaction",
"(",
")",
";",
"$",
"deleteResult",
"=",
"$",
"db",
"->",
"execute",
"(",
"'DELETE FROM `... | Delete PayPal order payment comment data from database.
@param string $commentId Order id.
@return bool | [
"Delete",
"PayPal",
"order",
"payment",
"comment",
"data",
"from",
"database",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/DbGateways/OrderPaymentCommentDbGateway.php#L96-L112 |
44,057 | OXID-eSales/paypal | Model/Basket.php | Basket.isVirtualPayPalBasket | public function isVirtualPayPalBasket()
{
$isVirtual = true;
$products = $this->getBasketArticles();
foreach ($products as $product) {
if (!$product->isVirtualPayPalArticle()) {
$isVirtual = false;
break;
}
}
return $isVirtual;
} | php | public function isVirtualPayPalBasket()
{
$isVirtual = true;
$products = $this->getBasketArticles();
foreach ($products as $product) {
if (!$product->isVirtualPayPalArticle()) {
$isVirtual = false;
break;
}
}
return $isVirtual;
} | [
"public",
"function",
"isVirtualPayPalBasket",
"(",
")",
"{",
"$",
"isVirtual",
"=",
"true",
";",
"$",
"products",
"=",
"$",
"this",
"->",
"getBasketArticles",
"(",
")",
";",
"foreach",
"(",
"$",
"products",
"as",
"$",
"product",
")",
"{",
"if",
"(",
"... | Checks if products in basket ar virtual and does not require real delivery.
Returns TRUE if virtual
@return bool | [
"Checks",
"if",
"products",
"in",
"basket",
"ar",
"virtual",
"and",
"does",
"not",
"require",
"real",
"delivery",
".",
"Returns",
"TRUE",
"if",
"virtual"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Basket.php#L37-L50 |
44,058 | OXID-eSales/paypal | Model/Basket.php | Basket.getPayPalWrappingCosts | public function getPayPalWrappingCosts()
{
$amount = 0.0;
$wrappingCost = $this->getCosts('oxwrapping');
if ($wrappingCost) {
$amount = $this->isCalculationModeNetto() ? $wrappingCost->getNettoPrice() : $wrappingCost->getBruttoPrice();
}
return $amount;
} | php | public function getPayPalWrappingCosts()
{
$amount = 0.0;
$wrappingCost = $this->getCosts('oxwrapping');
if ($wrappingCost) {
$amount = $this->isCalculationModeNetto() ? $wrappingCost->getNettoPrice() : $wrappingCost->getBruttoPrice();
}
return $amount;
} | [
"public",
"function",
"getPayPalWrappingCosts",
"(",
")",
"{",
"$",
"amount",
"=",
"0.0",
";",
"$",
"wrappingCost",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxwrapping'",
")",
";",
"if",
"(",
"$",
"wrappingCost",
")",
"{",
"$",
"amount",
"=",
"$",
"t... | Returns wrapping cost value
@return double | [
"Returns",
"wrapping",
"cost",
"value"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Basket.php#L77-L87 |
44,059 | OXID-eSales/paypal | Model/Basket.php | Basket.getPayPalGiftCardCosts | public function getPayPalGiftCardCosts()
{
$amount = 0.0;
$giftCardCost = $this->getCosts('oxgiftcard');
if ($giftCardCost) {
$amount = $this->isCalculationModeNetto() ? $giftCardCost->getNettoPrice() : $giftCardCost->getBruttoPrice();
}
return $amount;
} | php | public function getPayPalGiftCardCosts()
{
$amount = 0.0;
$giftCardCost = $this->getCosts('oxgiftcard');
if ($giftCardCost) {
$amount = $this->isCalculationModeNetto() ? $giftCardCost->getNettoPrice() : $giftCardCost->getBruttoPrice();
}
return $amount;
} | [
"public",
"function",
"getPayPalGiftCardCosts",
"(",
")",
"{",
"$",
"amount",
"=",
"0.0",
";",
"$",
"giftCardCost",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxgiftcard'",
")",
";",
"if",
"(",
"$",
"giftCardCost",
")",
"{",
"$",
"amount",
"=",
"$",
"t... | Returns greeting card cost value
@return double | [
"Returns",
"greeting",
"card",
"cost",
"value"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Basket.php#L94-L104 |
44,060 | OXID-eSales/paypal | Model/Basket.php | Basket.getPayPalPaymentCosts | public function getPayPalPaymentCosts()
{
$amount = 0.0;
$paymentCost = $this->getCosts('oxpayment');
if ($paymentCost) {
$amount = $this->isCalculationModeNetto() ? $paymentCost->getNettoPrice() : $paymentCost->getBruttoPrice();
}
return $amount;
} | php | public function getPayPalPaymentCosts()
{
$amount = 0.0;
$paymentCost = $this->getCosts('oxpayment');
if ($paymentCost) {
$amount = $this->isCalculationModeNetto() ? $paymentCost->getNettoPrice() : $paymentCost->getBruttoPrice();
}
return $amount;
} | [
"public",
"function",
"getPayPalPaymentCosts",
"(",
")",
"{",
"$",
"amount",
"=",
"0.0",
";",
"$",
"paymentCost",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxpayment'",
")",
";",
"if",
"(",
"$",
"paymentCost",
")",
"{",
"$",
"amount",
"=",
"$",
"this"... | Returns payment costs netto or brutto value.
@return double | [
"Returns",
"payment",
"costs",
"netto",
"or",
"brutto",
"value",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Basket.php#L111-L121 |
44,061 | OXID-eSales/paypal | Model/Basket.php | Basket.getPayPalBasketVatValue | public function getPayPalBasketVatValue()
{
$basketVatValue = 0;
$basketVatValue += $this->getPayPalProductVat();
$basketVatValue += $this->getPayPalWrappingVat();
$basketVatValue += $this->getPayPalGiftCardVat();
$basketVatValue += $this->getPayPalPayCostVat();
if ($this->getDeliveryCosts() < round($this->getDeliveryCosts(), 2)) {
return floor($basketVatValue * 100) / 100;
}
return $basketVatValue;
} | php | public function getPayPalBasketVatValue()
{
$basketVatValue = 0;
$basketVatValue += $this->getPayPalProductVat();
$basketVatValue += $this->getPayPalWrappingVat();
$basketVatValue += $this->getPayPalGiftCardVat();
$basketVatValue += $this->getPayPalPayCostVat();
if ($this->getDeliveryCosts() < round($this->getDeliveryCosts(), 2)) {
return floor($basketVatValue * 100) / 100;
}
return $basketVatValue;
} | [
"public",
"function",
"getPayPalBasketVatValue",
"(",
")",
"{",
"$",
"basketVatValue",
"=",
"0",
";",
"$",
"basketVatValue",
"+=",
"$",
"this",
"->",
"getPayPalProductVat",
"(",
")",
";",
"$",
"basketVatValue",
"+=",
"$",
"this",
"->",
"getPayPalWrappingVat",
... | Returns absolute VAT value.
@return float | [
"Returns",
"absolute",
"VAT",
"value",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Basket.php#L184-L197 |
44,062 | OXID-eSales/paypal | Model/Basket.php | Basket.getPayPalWrappingVat | public function getPayPalWrappingVat()
{
$wrappingVat = 0.0;
$wrapping = $this->getCosts('oxwrapping');
if ($wrapping && $wrapping->getVatValue()) {
$wrappingVat = $wrapping->getVatValue();
}
return $wrappingVat;
} | php | public function getPayPalWrappingVat()
{
$wrappingVat = 0.0;
$wrapping = $this->getCosts('oxwrapping');
if ($wrapping && $wrapping->getVatValue()) {
$wrappingVat = $wrapping->getVatValue();
}
return $wrappingVat;
} | [
"public",
"function",
"getPayPalWrappingVat",
"(",
")",
"{",
"$",
"wrappingVat",
"=",
"0.0",
";",
"$",
"wrapping",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxwrapping'",
")",
";",
"if",
"(",
"$",
"wrapping",
"&&",
"$",
"wrapping",
"->",
"getVatValue",
... | Return wrapping VAT.
@return double | [
"Return",
"wrapping",
"VAT",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Basket.php#L217-L227 |
44,063 | OXID-eSales/paypal | Model/Basket.php | Basket.getPayPalGiftCardVat | public function getPayPalGiftCardVat()
{
$giftCardVat = 0.0;
$giftCard = $this->getCosts('oxgiftcard');
if ($giftCard && $giftCard->getVatValue()) {
$giftCardVat = $giftCard->getVatValue();
}
return $giftCardVat;
} | php | public function getPayPalGiftCardVat()
{
$giftCardVat = 0.0;
$giftCard = $this->getCosts('oxgiftcard');
if ($giftCard && $giftCard->getVatValue()) {
$giftCardVat = $giftCard->getVatValue();
}
return $giftCardVat;
} | [
"public",
"function",
"getPayPalGiftCardVat",
"(",
")",
"{",
"$",
"giftCardVat",
"=",
"0.0",
";",
"$",
"giftCard",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxgiftcard'",
")",
";",
"if",
"(",
"$",
"giftCard",
"&&",
"$",
"giftCard",
"->",
"getVatValue",
... | Return gift card VAT.
@return double | [
"Return",
"gift",
"card",
"VAT",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Basket.php#L234-L244 |
44,064 | OXID-eSales/paypal | Model/Basket.php | Basket.getPayPalPayCostVat | public function getPayPalPayCostVat()
{
$paymentVAT = 0.0;
$paymentCost = $this->getCosts('oxpayment');
if ($paymentCost && $paymentCost->getVatValue()) {
$paymentVAT = $paymentCost->getVatValue();
}
return $paymentVAT;
} | php | public function getPayPalPayCostVat()
{
$paymentVAT = 0.0;
$paymentCost = $this->getCosts('oxpayment');
if ($paymentCost && $paymentCost->getVatValue()) {
$paymentVAT = $paymentCost->getVatValue();
}
return $paymentVAT;
} | [
"public",
"function",
"getPayPalPayCostVat",
"(",
")",
"{",
"$",
"paymentVAT",
"=",
"0.0",
";",
"$",
"paymentCost",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxpayment'",
")",
";",
"if",
"(",
"$",
"paymentCost",
"&&",
"$",
"paymentCost",
"->",
"getVatValu... | Return payment VAT.
@return double | [
"Return",
"payment",
"VAT",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Basket.php#L251-L261 |
44,065 | OXID-eSales/paypal | Core/Request.php | Request.getRequestParameter | public function getRequestParameter($name, $raw = false)
{
$value = null;
$value = $this->getPostParameter($name, $raw);
if (!isset($value)) {
$value = $this->getGetParameter($name, $raw);
}
return $value;
} | php | public function getRequestParameter($name, $raw = false)
{
$value = null;
$value = $this->getPostParameter($name, $raw);
if (!isset($value)) {
$value = $this->getGetParameter($name, $raw);
}
return $value;
} | [
"public",
"function",
"getRequestParameter",
"(",
"$",
"name",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"$",
"value",
"=",
"null",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"getPostParameter",
"(",
"$",
"name",
",",
"$",
"raw",
")",
";",
"if",
"("... | Returns value of parameter stored in POST,GET.
@param string $name Name of parameter
@param bool $raw mark to return not escaped parameter
@return mixed | [
"Returns",
"value",
"of",
"parameter",
"stored",
"in",
"POST",
"GET",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Request.php#L69-L79 |
44,066 | OXID-eSales/paypal | Core/Request.php | Request.getPostParameter | public function getPostParameter($name, $raw = false)
{
$value = null;
$post = $this->getPost();
if (isset($post[$name])) {
$value = $post[$name];
}
if ($value !== null && !$raw) {
$value = $this->escapeSpecialChars($value);
}
return $value;
} | php | public function getPostParameter($name, $raw = false)
{
$value = null;
$post = $this->getPost();
if (isset($post[$name])) {
$value = $post[$name];
}
if ($value !== null && !$raw) {
$value = $this->escapeSpecialChars($value);
}
return $value;
} | [
"public",
"function",
"getPostParameter",
"(",
"$",
"name",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"$",
"value",
"=",
"null",
";",
"$",
"post",
"=",
"$",
"this",
"->",
"getPost",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"post",
"[",
"$",
... | Returns value of parameter stored in POST.
@param string $name Name of parameter
@param bool $raw mark to return not escaped parameter
@return mixed | [
"Returns",
"value",
"of",
"parameter",
"stored",
"in",
"POST",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Request.php#L89-L103 |
44,067 | OXID-eSales/paypal | Core/Request.php | Request.getGetParameter | public function getGetParameter($name, $raw = false)
{
$value = null;
$get = $this->getGet();
if (isset($get[$name])) {
$value = $get[$name];
}
if ($value !== null && !$raw) {
$value = $this->escapeSpecialChars($value);
}
return $value;
} | php | public function getGetParameter($name, $raw = false)
{
$value = null;
$get = $this->getGet();
if (isset($get[$name])) {
$value = $get[$name];
}
if ($value !== null && !$raw) {
$value = $this->escapeSpecialChars($value);
}
return $value;
} | [
"public",
"function",
"getGetParameter",
"(",
"$",
"name",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"$",
"value",
"=",
"null",
";",
"$",
"get",
"=",
"$",
"this",
"->",
"getGet",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"get",
"[",
"$",
"nam... | Returns value of parameter stored in GET.
@param string $name Name of parameter
@param bool $raw mark to return not escaped parameter
@return mixed | [
"Returns",
"value",
"of",
"parameter",
"stored",
"in",
"GET",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Request.php#L113-L127 |
44,068 | OXID-eSales/paypal | Core/Request.php | Request.escapeSpecialChars | public function escapeSpecialChars($value)
{
$payPalEscape = oxNew(\OxidEsales\PayPalModule\Core\Escape::class);
return $payPalEscape->escapeSpecialChars($value);
} | php | public function escapeSpecialChars($value)
{
$payPalEscape = oxNew(\OxidEsales\PayPalModule\Core\Escape::class);
return $payPalEscape->escapeSpecialChars($value);
} | [
"public",
"function",
"escapeSpecialChars",
"(",
"$",
"value",
")",
"{",
"$",
"payPalEscape",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Core",
"\\",
"Escape",
"::",
"class",
")",
";",
"return",
"$",
"payPalEscape",
"->",
"escapeSpec... | Wrapper for PayPal escape class.
@param mixed $value value to escape
@return mixed | [
"Wrapper",
"for",
"PayPal",
"escape",
"class",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/Request.php#L136-L141 |
44,069 | OXID-eSales/paypal | Model/Action/Handler/OrderReauthorizeActionHandler.php | OrderReauthorizeActionHandler.getPayPalRequest | public function getPayPalRequest()
{
if (is_null($this->payPalRequest)) {
$requestBuilder = $this->getPayPalRequestBuilder();
$data = $this->getData();
$requestBuilder->setAuthorizationId($data->getAuthorizationId());
$requestBuilder->setAmount($data->getAmount(), $data->getCurrency());
$this->payPalRequest = $requestBuilder->getRequest();
}
return $this->payPalRequest;
} | php | public function getPayPalRequest()
{
if (is_null($this->payPalRequest)) {
$requestBuilder = $this->getPayPalRequestBuilder();
$data = $this->getData();
$requestBuilder->setAuthorizationId($data->getAuthorizationId());
$requestBuilder->setAmount($data->getAmount(), $data->getCurrency());
$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/OrderReauthorizeActionHandler.php#L54-L68 |
44,070 | OXID-eSales/paypal | Controller/Admin/OrderController.php | OrderController.processAction | public function processAction()
{
try {
/** @var \OxidEsales\PayPalModule\Core\Request $request */
$request = oxNew(\OxidEsales\PayPalModule\Core\Request::class);
$action = $request->getRequestParameter('action');
$order = $this->getEditObject();
/** @var \OxidEsales\PayPalModule\Model\Action\OrderActionFactory $actionFactory */
$actionFactory = oxNew(\OxidEsales\PayPalModule\Model\Action\OrderActionFactory::class, $request, $order);
$action = $actionFactory->createAction($action);
$action->process();
} catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) {
$this->_aViewData["error"] = $exception->getMessage();
}
} | php | public function processAction()
{
try {
/** @var \OxidEsales\PayPalModule\Core\Request $request */
$request = oxNew(\OxidEsales\PayPalModule\Core\Request::class);
$action = $request->getRequestParameter('action');
$order = $this->getEditObject();
/** @var \OxidEsales\PayPalModule\Model\Action\OrderActionFactory $actionFactory */
$actionFactory = oxNew(\OxidEsales\PayPalModule\Model\Action\OrderActionFactory::class, $request, $order);
$action = $actionFactory->createAction($action);
$action->process();
} catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) {
$this->_aViewData["error"] = $exception->getMessage();
}
} | [
"public",
"function",
"processAction",
"(",
")",
"{",
"try",
"{",
"/** @var \\OxidEsales\\PayPalModule\\Core\\Request $request */",
"$",
"request",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Core",
"\\",
"Request",
"::",
"class",
")",
";",
... | Processes PayPal actions. | [
"Processes",
"PayPal",
"actions",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Admin/OrderController.php#L53-L70 |
44,071 | OXID-eSales/paypal | Controller/Admin/OrderController.php | OrderController.getOrderActionManager | public function getOrderActionManager()
{
/** @var \OxidEsales\PayPalModule\Model\OrderActionManager $manager */
$manager = oxNew(\OxidEsales\PayPalModule\Model\OrderActionManager::class);
$manager->setOrder($this->getEditObject()->getPayPalOrder());
return $manager;
} | php | public function getOrderActionManager()
{
/** @var \OxidEsales\PayPalModule\Model\OrderActionManager $manager */
$manager = oxNew(\OxidEsales\PayPalModule\Model\OrderActionManager::class);
$manager->setOrder($this->getEditObject()->getPayPalOrder());
return $manager;
} | [
"public",
"function",
"getOrderActionManager",
"(",
")",
"{",
"/** @var \\OxidEsales\\PayPalModule\\Model\\OrderActionManager $manager */",
"$",
"manager",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"OrderActionManager",
"::",
"class",... | Returns PayPal order action manager.
@return \OxidEsales\PayPalModule\Model\OrderActionManager | [
"Returns",
"PayPal",
"order",
"action",
"manager",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Admin/OrderController.php#L77-L84 |
44,072 | OXID-eSales/paypal | Controller/Admin/OrderController.php | OrderController.getOrderPaymentStatusCalculator | public function getOrderPaymentStatusCalculator()
{
/** @var \OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator $statusCalculator */
$statusCalculator = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator::class);
$statusCalculator->setOrder($this->getEditObject()->getPayPalOrder());
return $statusCalculator;
} | php | public function getOrderPaymentStatusCalculator()
{
/** @var \OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator $statusCalculator */
$statusCalculator = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator::class);
$statusCalculator->setOrder($this->getEditObject()->getPayPalOrder());
return $statusCalculator;
} | [
"public",
"function",
"getOrderPaymentStatusCalculator",
"(",
")",
"{",
"/** @var \\OxidEsales\\PayPalModule\\Model\\OrderPaymentStatusCalculator $statusCalculator */",
"$",
"statusCalculator",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"O... | Returns PayPal order action manager
@return \OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator | [
"Returns",
"PayPal",
"order",
"action",
"manager"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Admin/OrderController.php#L103-L110 |
44,073 | OXID-eSales/paypal | Controller/Admin/OrderController.php | OrderController.isNewPayPalOrder | public function isNewPayPalOrder()
{
$active = false;
$order = $this->getEditObject();
$orderPayPal = $order->getPayPalOrder();
if ($this->isPayPalOrder() && $orderPayPal->isLoaded()) {
$active = true;
}
return $active;
} | php | public function isNewPayPalOrder()
{
$active = false;
$order = $this->getEditObject();
$orderPayPal = $order->getPayPalOrder();
if ($this->isPayPalOrder() && $orderPayPal->isLoaded()) {
$active = true;
}
return $active;
} | [
"public",
"function",
"isNewPayPalOrder",
"(",
")",
"{",
"$",
"active",
"=",
"false",
";",
"$",
"order",
"=",
"$",
"this",
"->",
"getEditObject",
"(",
")",
";",
"$",
"orderPayPal",
"=",
"$",
"order",
"->",
"getPayPalOrder",
"(",
")",
";",
"if",
"(",
... | Method checks if order was made with current PayPal module, but not eFire PayPal module
@return bool | [
"Method",
"checks",
"if",
"order",
"was",
"made",
"with",
"current",
"PayPal",
"module",
"but",
"not",
"eFire",
"PayPal",
"module"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Admin/OrderController.php#L145-L156 |
44,074 | OXID-eSales/paypal | Controller/Admin/OrderController.php | OrderController.isPayPalOrder | public function isPayPalOrder()
{
$active = false;
$order = $this->getEditObject();
if ($order && $order->getFieldData('oxpaymenttype') == 'oxidpaypal') {
$active = true;
}
return $active;
} | php | public function isPayPalOrder()
{
$active = false;
$order = $this->getEditObject();
if ($order && $order->getFieldData('oxpaymenttype') == 'oxidpaypal') {
$active = true;
}
return $active;
} | [
"public",
"function",
"isPayPalOrder",
"(",
")",
"{",
"$",
"active",
"=",
"false",
";",
"$",
"order",
"=",
"$",
"this",
"->",
"getEditObject",
"(",
")",
";",
"if",
"(",
"$",
"order",
"&&",
"$",
"order",
"->",
"getFieldData",
"(",
"'oxpaymenttype'",
")"... | Method checks is order was made with any PayPal module
@return bool | [
"Method",
"checks",
"is",
"order",
"was",
"made",
"with",
"any",
"PayPal",
"module"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/Admin/OrderController.php#L163-L173 |
44,075 | OXID-eSales/paypal | Model/DbGateways/OrderPaymentDbGateway.php | OrderPaymentDbGateway.delete | public function delete($paymentId)
{
$db = $this->getDb();
$db->startTransaction();
$deleteResult = $db->execute('DELETE FROM `oepaypal_orderpayments` WHERE `oepaypal_paymentid` = ' . $db->quote($paymentId));
$deleteCommentResult = $db->execute('DELETE FROM `oepaypal_orderpaymentcomments` WHERE `oepaypal_paymentid` = ' . $db->quote($paymentId));
$result = ($deleteResult !== false) || ($deleteCommentResult !== false);
if ($result) {
$db->commitTransaction();
} else {
$db->rollbackTransaction();
}
return $result;
} | php | public function delete($paymentId)
{
$db = $this->getDb();
$db->startTransaction();
$deleteResult = $db->execute('DELETE FROM `oepaypal_orderpayments` WHERE `oepaypal_paymentid` = ' . $db->quote($paymentId));
$deleteCommentResult = $db->execute('DELETE FROM `oepaypal_orderpaymentcomments` WHERE `oepaypal_paymentid` = ' . $db->quote($paymentId));
$result = ($deleteResult !== false) || ($deleteCommentResult !== false);
if ($result) {
$db->commitTransaction();
} else {
$db->rollbackTransaction();
}
return $result;
} | [
"public",
"function",
"delete",
"(",
"$",
"paymentId",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
";",
"$",
"db",
"->",
"startTransaction",
"(",
")",
";",
"$",
"deleteResult",
"=",
"$",
"db",
"->",
"execute",
"(",
"'DELETE FROM `... | Delete PayPal order payment data from database.
@param string $paymentId Order id.
@return bool | [
"Delete",
"PayPal",
"order",
"payment",
"data",
"from",
"database",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/DbGateways/OrderPaymentDbGateway.php#L96-L113 |
44,076 | OXID-eSales/paypal | Model/Action/Handler/OrderActionHandler.php | OrderActionHandler.getPayPalRequestBuilder | public function getPayPalRequestBuilder()
{
if ($this->payPalRequestBuilder === null) {
$this->payPalRequestBuilder = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequestBuilder::class);
}
return $this->payPalRequestBuilder;
} | php | public function getPayPalRequestBuilder()
{
if ($this->payPalRequestBuilder === null) {
$this->payPalRequestBuilder = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequestBuilder::class);
}
return $this->payPalRequestBuilder;
} | [
"public",
"function",
"getPayPalRequestBuilder",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"payPalRequestBuilder",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"payPalRequestBuilder",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model"... | Returns PayPal request builder
@return \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequestBuilder | [
"Returns",
"PayPal",
"request",
"builder"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/Action/Handler/OrderActionHandler.php#L81-L88 |
44,077 | OXID-eSales/paypal | Model/User.php | User.loadUserPayPalUser | public function loadUserPayPalUser()
{
$result = false;
if (($userId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("oepaypal-userId"))) {
$result = $this->load($userId);
}
return $result;
} | php | public function loadUserPayPalUser()
{
$result = false;
if (($userId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("oepaypal-userId"))) {
$result = $this->load($userId);
}
return $result;
} | [
"public",
"function",
"loadUserPayPalUser",
"(",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"(",
"$",
"userId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getSession",
"(",
")",
"->",
"getVariable",
"(",
... | Returns user from session associated with current PayPal order.
@return bool | [
"Returns",
"user",
"from",
"session",
"associated",
"with",
"current",
"PayPal",
"order",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/User.php#L125-L133 |
44,078 | OXID-eSales/paypal | Model/User.php | User.createPayPalUser | public function createPayPalUser($payPalData)
{
$userData = $this->prepareDataPayPalUser($payPalData);
$userId = $this->getIdByUserName($payPalData->getEmail());
if ($userId) {
$this->load($userId);
}
$this->oxuser__oxactive = new \OxidEsales\Eshop\Core\Field(1);
$this->oxuser__oxusername = new \OxidEsales\Eshop\Core\Field($payPalData->getEmail());
$this->oxuser__oxfname = new \OxidEsales\Eshop\Core\Field($userData['oxfname']);
$this->oxuser__oxlname = new \OxidEsales\Eshop\Core\Field($userData['oxlname']);
$this->oxuser__oxfon = new \OxidEsales\Eshop\Core\Field($userData['oxfon']);
$this->oxuser__oxsal = new \OxidEsales\Eshop\Core\Field($userData['oxsal']);
$this->oxuser__oxcompany = new \OxidEsales\Eshop\Core\Field($userData['oxcompany']);
$this->oxuser__oxstreet = new \OxidEsales\Eshop\Core\Field($userData['oxstreet']);
$this->oxuser__oxstreetnr = new \OxidEsales\Eshop\Core\Field($userData['oxstreetnr']);
$this->oxuser__oxcity = new \OxidEsales\Eshop\Core\Field($userData['oxcity']);
$this->oxuser__oxzip = new \OxidEsales\Eshop\Core\Field($userData['oxzip']);
$this->oxuser__oxcountryid = new \OxidEsales\Eshop\Core\Field($userData['oxcountryid']);
$this->oxuser__oxstateid = new \OxidEsales\Eshop\Core\Field($userData['oxstateid']);
$this->oxuser__oxaddinfo = new \OxidEsales\Eshop\Core\Field($userData['oxaddinfo']);
$this->oxuser__oxpassword = new \OxidEsales\Eshop\Core\Field('');
$this->oxuser__oxbirthdate = new \OxidEsales\Eshop\Core\Field('');
if ($this->save()) {
$this->_setAutoGroups($this->oxuser__oxcountryid->value);
// and adding to group "oxidnotyetordered"
$this->addToGroup("oxidnotyetordered");
}
} | php | public function createPayPalUser($payPalData)
{
$userData = $this->prepareDataPayPalUser($payPalData);
$userId = $this->getIdByUserName($payPalData->getEmail());
if ($userId) {
$this->load($userId);
}
$this->oxuser__oxactive = new \OxidEsales\Eshop\Core\Field(1);
$this->oxuser__oxusername = new \OxidEsales\Eshop\Core\Field($payPalData->getEmail());
$this->oxuser__oxfname = new \OxidEsales\Eshop\Core\Field($userData['oxfname']);
$this->oxuser__oxlname = new \OxidEsales\Eshop\Core\Field($userData['oxlname']);
$this->oxuser__oxfon = new \OxidEsales\Eshop\Core\Field($userData['oxfon']);
$this->oxuser__oxsal = new \OxidEsales\Eshop\Core\Field($userData['oxsal']);
$this->oxuser__oxcompany = new \OxidEsales\Eshop\Core\Field($userData['oxcompany']);
$this->oxuser__oxstreet = new \OxidEsales\Eshop\Core\Field($userData['oxstreet']);
$this->oxuser__oxstreetnr = new \OxidEsales\Eshop\Core\Field($userData['oxstreetnr']);
$this->oxuser__oxcity = new \OxidEsales\Eshop\Core\Field($userData['oxcity']);
$this->oxuser__oxzip = new \OxidEsales\Eshop\Core\Field($userData['oxzip']);
$this->oxuser__oxcountryid = new \OxidEsales\Eshop\Core\Field($userData['oxcountryid']);
$this->oxuser__oxstateid = new \OxidEsales\Eshop\Core\Field($userData['oxstateid']);
$this->oxuser__oxaddinfo = new \OxidEsales\Eshop\Core\Field($userData['oxaddinfo']);
$this->oxuser__oxpassword = new \OxidEsales\Eshop\Core\Field('');
$this->oxuser__oxbirthdate = new \OxidEsales\Eshop\Core\Field('');
if ($this->save()) {
$this->_setAutoGroups($this->oxuser__oxcountryid->value);
// and adding to group "oxidnotyetordered"
$this->addToGroup("oxidnotyetordered");
}
} | [
"public",
"function",
"createPayPalUser",
"(",
"$",
"payPalData",
")",
"{",
"$",
"userData",
"=",
"$",
"this",
"->",
"prepareDataPayPalUser",
"(",
"$",
"payPalData",
")",
";",
"$",
"userId",
"=",
"$",
"this",
"->",
"getIdByUserName",
"(",
"$",
"payPalData",
... | Creates user from PayPal data.
@param \OxidEsales\PayPalModule\Model\Response\ResponseGetExpressCheckoutDetails $payPalData Data returned from PayPal. | [
"Creates",
"user",
"from",
"PayPal",
"data",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/User.php#L140-L172 |
44,079 | OXID-eSales/paypal | Model/User.php | User.splitShipToStreetPayPalUser | protected function splitShipToStreetPayPalUser($shipToStreet)
{
$address = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
return $address->splitShipToStreetPayPalAddress($shipToStreet);
} | php | protected function splitShipToStreetPayPalUser($shipToStreet)
{
$address = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
return $address->splitShipToStreetPayPalAddress($shipToStreet);
} | [
"protected",
"function",
"splitShipToStreetPayPalUser",
"(",
"$",
"shipToStreet",
")",
"{",
"$",
"address",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Address",
"::",
"class",
")",
";",
"return",
"$",
"ad... | Split street nr from address.
@param string $shipToStreet Address string.
@return array | [
"Split",
"street",
"nr",
"from",
"address",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/User.php#L244-L249 |
44,080 | OXID-eSales/paypal | Model/User.php | User.getUserGroups | public function getUserGroups($oxId = null)
{
if (!$this->isCallBackUserPayPalUser()) {
return parent::getUserGroups();
}
if (!$this->_oGroups) {
/** @var \OxidEsales\Eshop\Core\TableViewNameGenerator $viewNameGenerator */
$viewNameGenerator = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Core\TableViewNameGenerator::class);
$viewName = $viewNameGenerator->getViewName("oxgroups");
$select = "select {$viewName}.* from {$viewName} where ({$viewName}.oxid = 'oxidnotyetordered' OR {$viewName}.oxid = 'oxidnewcustomer')";
$this->_oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class, \OxidEsales\Eshop\Application\Model\Groups::class);
$this->_oGroups->selectString($select);
}
return $this->_oGroups;
} | php | public function getUserGroups($oxId = null)
{
if (!$this->isCallBackUserPayPalUser()) {
return parent::getUserGroups();
}
if (!$this->_oGroups) {
/** @var \OxidEsales\Eshop\Core\TableViewNameGenerator $viewNameGenerator */
$viewNameGenerator = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Core\TableViewNameGenerator::class);
$viewName = $viewNameGenerator->getViewName("oxgroups");
$select = "select {$viewName}.* from {$viewName} where ({$viewName}.oxid = 'oxidnotyetordered' OR {$viewName}.oxid = 'oxidnewcustomer')";
$this->_oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class, \OxidEsales\Eshop\Application\Model\Groups::class);
$this->_oGroups->selectString($select);
}
return $this->_oGroups;
} | [
"public",
"function",
"getUserGroups",
"(",
"$",
"oxId",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isCallBackUserPayPalUser",
"(",
")",
")",
"{",
"return",
"parent",
"::",
"getUserGroups",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"th... | Returns user group list.
@param string $oxId oxId identifier.
@return \OxidEsales\Eshop\Core\Model\ListModel | [
"Returns",
"user",
"group",
"list",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/User.php#L268-L284 |
44,081 | OXID-eSales/paypal | Model/User.php | User.initializeUserForCallBackPayPalUser | public function initializeUserForCallBackPayPalUser($payPalData)
{
// setting mode..
$this->callBackUser = true;
// setting data..
$street = $this->splitShipToStreetPayPalUser($payPalData['SHIPTOSTREET']);
// setting object id as it is requested later while processing user object
$this->setId(\OxidEsales\Eshop\Core\UtilsObject::getInstance()->generateUID());
$this->oxuser__oxstreet = new \OxidEsales\Eshop\Core\Field($street['street']);
$this->oxuser__oxstreetnr = new \OxidEsales\Eshop\Core\Field($street['streetnr']);
$this->oxuser__oxcity = new \OxidEsales\Eshop\Core\Field($payPalData['SHIPTOCITY']);
$this->oxuser__oxzip = new \OxidEsales\Eshop\Core\Field($payPalData['SHIPTOZIP']);
$country = oxNew(\OxidEsales\Eshop\Application\Model\Country::class);
$countryId = $country->getIdByCode($payPalData["SHIPTOCOUNTRY"]);
$this->oxuser__oxcountryid = new \OxidEsales\Eshop\Core\Field($countryId);
$stateId = '';
if (isset($payPalData["SHIPTOSTATE"])) {
$state = oxNew(\OxidEsales\Eshop\Application\Model\State::class);
$stateId = $state->getIdByCode($payPalData["SHIPTOSTATE"], $countryId);
}
$this->oxuser__oxstateid = new \OxidEsales\Eshop\Core\Field($stateId);
} | php | public function initializeUserForCallBackPayPalUser($payPalData)
{
// setting mode..
$this->callBackUser = true;
// setting data..
$street = $this->splitShipToStreetPayPalUser($payPalData['SHIPTOSTREET']);
// setting object id as it is requested later while processing user object
$this->setId(\OxidEsales\Eshop\Core\UtilsObject::getInstance()->generateUID());
$this->oxuser__oxstreet = new \OxidEsales\Eshop\Core\Field($street['street']);
$this->oxuser__oxstreetnr = new \OxidEsales\Eshop\Core\Field($street['streetnr']);
$this->oxuser__oxcity = new \OxidEsales\Eshop\Core\Field($payPalData['SHIPTOCITY']);
$this->oxuser__oxzip = new \OxidEsales\Eshop\Core\Field($payPalData['SHIPTOZIP']);
$country = oxNew(\OxidEsales\Eshop\Application\Model\Country::class);
$countryId = $country->getIdByCode($payPalData["SHIPTOCOUNTRY"]);
$this->oxuser__oxcountryid = new \OxidEsales\Eshop\Core\Field($countryId);
$stateId = '';
if (isset($payPalData["SHIPTOSTATE"])) {
$state = oxNew(\OxidEsales\Eshop\Application\Model\State::class);
$stateId = $state->getIdByCode($payPalData["SHIPTOSTATE"], $countryId);
}
$this->oxuser__oxstateid = new \OxidEsales\Eshop\Core\Field($stateId);
} | [
"public",
"function",
"initializeUserForCallBackPayPalUser",
"(",
"$",
"payPalData",
")",
"{",
"// setting mode..",
"$",
"this",
"->",
"callBackUser",
"=",
"true",
";",
"// setting data..",
"$",
"street",
"=",
"$",
"this",
"->",
"splitShipToStreetPayPalUser",
"(",
"... | Initializes call back user.
@param array $payPalData Callback user data. | [
"Initializes",
"call",
"back",
"user",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/User.php#L291-L317 |
44,082 | OXID-eSales/paypal | Model/User.php | User.getShopIdQueryPart | protected function getShopIdQueryPart()
{
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
return " AND `oxshopid` = " . $db->quote(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId());
} | php | protected function getShopIdQueryPart()
{
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
return " AND `oxshopid` = " . $db->quote(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId());
} | [
"protected",
"function",
"getShopIdQueryPart",
"(",
")",
"{",
"$",
"db",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"return",
"\" AND `oxshopid` = \"",
".",
"$",
"db",
"->",
"quote",
"(",
"... | Create query part for selecting by shopid.
@return string | [
"Create",
"query",
"part",
"for",
"selecting",
"by",
"shopid",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Model/User.php#L324-L328 |
44,083 | OXID-eSales/paypal | Core/ViewConfig.php | ViewConfig.getPaymentValidator | public function getPaymentValidator()
{
if (is_null($this->paymentValidator)) {
$this->setPaymentValidator(oxNew(\OxidEsales\PayPalModule\Model\PaymentValidator::class));
}
return $this->paymentValidator;
} | php | public function getPaymentValidator()
{
if (is_null($this->paymentValidator)) {
$this->setPaymentValidator(oxNew(\OxidEsales\PayPalModule\Model\PaymentValidator::class));
}
return $this->paymentValidator;
} | [
"public",
"function",
"getPaymentValidator",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"paymentValidator",
")",
")",
"{",
"$",
"this",
"->",
"setPaymentValidator",
"(",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",... | Get \OxidEsales\PayPalModule\Model\PaymentValidator. Create new if does not exist.
@return \OxidEsales\PayPalModule\Model\PaymentValidator | [
"Get",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"PaymentValidator",
".",
"Create",
"new",
"if",
"does",
"not",
"exist",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ViewConfig.php#L84-L91 |
44,084 | OXID-eSales/paypal | Core/ViewConfig.php | ViewConfig.isExpressCheckoutEnabledInMiniBasket | public function isExpressCheckoutEnabledInMiniBasket()
{
$expressCheckoutEnabledInMiniBasket = false;
if ($this->isExpressCheckoutEnabled() && $this->getPayPalConfig()->isExpressCheckoutInMiniBasketEnabled()) {
$expressCheckoutEnabledInMiniBasket = true;
}
return $expressCheckoutEnabledInMiniBasket;
} | php | public function isExpressCheckoutEnabledInMiniBasket()
{
$expressCheckoutEnabledInMiniBasket = false;
if ($this->isExpressCheckoutEnabled() && $this->getPayPalConfig()->isExpressCheckoutInMiniBasketEnabled()) {
$expressCheckoutEnabledInMiniBasket = true;
}
return $expressCheckoutEnabledInMiniBasket;
} | [
"public",
"function",
"isExpressCheckoutEnabledInMiniBasket",
"(",
")",
"{",
"$",
"expressCheckoutEnabledInMiniBasket",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"isExpressCheckoutEnabled",
"(",
")",
"&&",
"$",
"this",
"->",
"getPayPalConfig",
"(",
")",
"->... | Returns TRUE if express checkout and displaying it in mini basket is enabled.
@return bool | [
"Returns",
"TRUE",
"if",
"express",
"checkout",
"and",
"displaying",
"it",
"in",
"mini",
"basket",
"is",
"enabled",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ViewConfig.php#L122-L130 |
44,085 | OXID-eSales/paypal | Core/ViewConfig.php | ViewConfig.getPayPalPaymentDescription | public function getPayPalPaymentDescription()
{
$desc = "";
if (($payPalPayment = $this->getPayPalPayment())) {
$desc = $payPalPayment->oxpayments__oxlongdesc->getRawValue();
}
return $desc;
} | php | public function getPayPalPaymentDescription()
{
$desc = "";
if (($payPalPayment = $this->getPayPalPayment())) {
$desc = $payPalPayment->oxpayments__oxlongdesc->getRawValue();
}
return $desc;
} | [
"public",
"function",
"getPayPalPaymentDescription",
"(",
")",
"{",
"$",
"desc",
"=",
"\"\"",
";",
"if",
"(",
"(",
"$",
"payPalPayment",
"=",
"$",
"this",
"->",
"getPayPalPayment",
"(",
")",
")",
")",
"{",
"$",
"desc",
"=",
"$",
"payPalPayment",
"->",
... | Returns PayPal payment description text.
@return string | [
"Returns",
"PayPal",
"payment",
"description",
"text",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ViewConfig.php#L187-L195 |
44,086 | OXID-eSales/paypal | Core/ViewConfig.php | ViewConfig.getPayPalPayment | public function getPayPalPayment()
{
if ($this->payPalPayment === null) {
$this->payPalPayment = false;
$payPalPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
// payment is not available/active?
if ($payPalPayment->load("oxidpaypal") && $payPalPayment->oxpayments__oxactive->value) {
$this->payPalPayment = $payPalPayment;
}
}
return $this->payPalPayment;
} | php | public function getPayPalPayment()
{
if ($this->payPalPayment === null) {
$this->payPalPayment = false;
$payPalPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
// payment is not available/active?
if ($payPalPayment->load("oxidpaypal") && $payPalPayment->oxpayments__oxactive->value) {
$this->payPalPayment = $payPalPayment;
}
}
return $this->payPalPayment;
} | [
"public",
"function",
"getPayPalPayment",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"payPalPayment",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"payPalPayment",
"=",
"false",
";",
"$",
"payPalPayment",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Es... | Returns PayPal payment object.
@return \OxidEsales\Eshop\Application\Model\Payment | [
"Returns",
"PayPal",
"payment",
"object",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ViewConfig.php#L202-L215 |
44,087 | OXID-eSales/paypal | Core/ViewConfig.php | ViewConfig.sendOrderInfoToPayPal | public function sendOrderInfoToPayPal()
{
$sendInfoToPayPalEnabled = $this->getPayPalConfig()->sendOrderInfoToPayPal();
if ($sendInfoToPayPalEnabled) {
/** @var \OxidEsales\PayPalModule\Model\Basket $basket */
$basket = $this->getSession()->getBasket();
$sendInfoToPayPalEnabled = !$basket->isFractionQuantityItemsPresent();
}
return $sendInfoToPayPalEnabled;
} | php | public function sendOrderInfoToPayPal()
{
$sendInfoToPayPalEnabled = $this->getPayPalConfig()->sendOrderInfoToPayPal();
if ($sendInfoToPayPalEnabled) {
/** @var \OxidEsales\PayPalModule\Model\Basket $basket */
$basket = $this->getSession()->getBasket();
$sendInfoToPayPalEnabled = !$basket->isFractionQuantityItemsPresent();
}
return $sendInfoToPayPalEnabled;
} | [
"public",
"function",
"sendOrderInfoToPayPal",
"(",
")",
"{",
"$",
"sendInfoToPayPalEnabled",
"=",
"$",
"this",
"->",
"getPayPalConfig",
"(",
")",
"->",
"sendOrderInfoToPayPal",
"(",
")",
";",
"if",
"(",
"$",
"sendInfoToPayPalEnabled",
")",
"{",
"/** @var \\OxidEs... | Returns state if order info should be send to PayPal.
@return bool | [
"Returns",
"state",
"if",
"order",
"info",
"should",
"be",
"send",
"to",
"PayPal",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/ViewConfig.php#L222-L232 |
44,088 | OXID-eSales/paypal | Core/PayPalList.php | PayPalList.next | public function next()
{
if ($this->removedActive === true && current($this->array)) {
$var = $this->prev();
} else {
$var = next($this->array);
}
$this->valid = (false !== $var);
} | php | public function next()
{
if ($this->removedActive === true && current($this->array)) {
$var = $this->prev();
} else {
$var = next($this->array);
}
$this->valid = (false !== $var);
} | [
"public",
"function",
"next",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"removedActive",
"===",
"true",
"&&",
"current",
"(",
"$",
"this",
"->",
"array",
")",
")",
"{",
"$",
"var",
"=",
"$",
"this",
"->",
"prev",
"(",
")",
";",
"}",
"else",
... | Next for SPL. | [
"Next",
"for",
"SPL",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalList.php#L121-L130 |
44,089 | OXID-eSales/paypal | Component/BasketComponent.php | BasketComponent.actionExpressCheckoutFromDetailsPage | public function actionExpressCheckoutFromDetailsPage()
{
$validator = $this->getValidator();
$currentArticle = $this->getCurrentArticle();
$validator->setItemToValidate($currentArticle);
$validator->setBasket($this->getSession()->getBasket());
if ($validator->isArticleValid()) {
//Make express checkout
$res = $this->actionAddToBasketAndGoToCheckout();
} else {
$res = $this->_getRedirectUrl();
//if amount is more than 0, do not redirect, show ESC popup instead
if ($currentArticle->getArticleAmount() > 0) {
$this->shopPopUp = true;
$res = null;
}
}
return $res;
} | php | public function actionExpressCheckoutFromDetailsPage()
{
$validator = $this->getValidator();
$currentArticle = $this->getCurrentArticle();
$validator->setItemToValidate($currentArticle);
$validator->setBasket($this->getSession()->getBasket());
if ($validator->isArticleValid()) {
//Make express checkout
$res = $this->actionAddToBasketAndGoToCheckout();
} else {
$res = $this->_getRedirectUrl();
//if amount is more than 0, do not redirect, show ESC popup instead
if ($currentArticle->getArticleAmount() > 0) {
$this->shopPopUp = true;
$res = null;
}
}
return $res;
} | [
"public",
"function",
"actionExpressCheckoutFromDetailsPage",
"(",
")",
"{",
"$",
"validator",
"=",
"$",
"this",
"->",
"getValidator",
"(",
")",
";",
"$",
"currentArticle",
"=",
"$",
"this",
"->",
"getCurrentArticle",
"(",
")",
";",
"$",
"validator",
"->",
"... | Method returns URL to checkout products OR to show popup.
@return string | [
"Method",
"returns",
"URL",
"to",
"checkout",
"products",
"OR",
"to",
"show",
"popup",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Component/BasketComponent.php#L43-L62 |
44,090 | OXID-eSales/paypal | Component/BasketComponent.php | BasketComponent.getCurrentArticleInfo | public function getCurrentArticleInfo()
{
$products = $this->_getItems();
$currentArticleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid');
$params = null;
if (!is_null($products[$currentArticleId])) {
$params = $products[$currentArticleId];
}
return $params;
} | php | public function getCurrentArticleInfo()
{
$products = $this->_getItems();
$currentArticleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid');
$params = null;
if (!is_null($products[$currentArticleId])) {
$params = $products[$currentArticleId];
}
return $params;
} | [
"public",
"function",
"getCurrentArticleInfo",
"(",
")",
"{",
"$",
"products",
"=",
"$",
"this",
"->",
"_getItems",
"(",
")",
";",
"$",
"currentArticleId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",... | Method returns serialized current article params.
@return string | [
"Method",
"returns",
"serialized",
"current",
"article",
"params",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Component/BasketComponent.php#L111-L121 |
44,091 | OXID-eSales/paypal | Component/BasketComponent.php | BasketComponent.getCurrentArticle | protected function getCurrentArticle()
{
$currentItem = oxNew(\OxidEsales\PayPalModule\Model\ArticleToExpressCheckoutCurrentItem::class);
$currentArticleId = $this->getRequest()->getPostParameter('aid');
$products = $this->_getItems();
$productInfo = $products[$currentArticleId];
$currentItem->setArticleId($currentArticleId);
$currentItem->setSelectList($productInfo['sel']);
$currentItem->setPersistParam($productInfo['persparam']);
$currentItem->setArticleAmount($productInfo['am']);
return $currentItem;
} | php | protected function getCurrentArticle()
{
$currentItem = oxNew(\OxidEsales\PayPalModule\Model\ArticleToExpressCheckoutCurrentItem::class);
$currentArticleId = $this->getRequest()->getPostParameter('aid');
$products = $this->_getItems();
$productInfo = $products[$currentArticleId];
$currentItem->setArticleId($currentArticleId);
$currentItem->setSelectList($productInfo['sel']);
$currentItem->setPersistParam($productInfo['persparam']);
$currentItem->setArticleAmount($productInfo['am']);
return $currentItem;
} | [
"protected",
"function",
"getCurrentArticle",
"(",
")",
"{",
"$",
"currentItem",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"ArticleToExpressCheckoutCurrentItem",
"::",
"class",
")",
";",
"$",
"currentArticleId",
"=",
"$",
... | Method sets params for article and returns it's object.
@return \OxidEsales\PayPalModule\Model\ArticleToExpressCheckoutCurrentItem | [
"Method",
"sets",
"params",
"for",
"article",
"and",
"returns",
"it",
"s",
"object",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Component/BasketComponent.php#L128-L140 |
44,092 | OXID-eSales/paypal | Component/BasketComponent.php | BasketComponent.getPayPalCancelURL | public function getPayPalCancelURL()
{
$url = $this->formatUrl($this->_getRedirectUrl());
$replacedURL = str_replace('showECSPopup=1', 'showECSPopup=0', $url);
return urlencode($replacedURL);
} | php | public function getPayPalCancelURL()
{
$url = $this->formatUrl($this->_getRedirectUrl());
$replacedURL = str_replace('showECSPopup=1', 'showECSPopup=0', $url);
return urlencode($replacedURL);
} | [
"public",
"function",
"getPayPalCancelURL",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"formatUrl",
"(",
"$",
"this",
"->",
"_getRedirectUrl",
"(",
")",
")",
";",
"$",
"replacedURL",
"=",
"str_replace",
"(",
"'showECSPopup=1'",
",",
"'showECSPopup=0'... | Changes oePayPalCancelURL by changing popup showing parameter.
@return string | [
"Changes",
"oePayPalCancelURL",
"by",
"changing",
"popup",
"showing",
"parameter",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Component/BasketComponent.php#L169-L175 |
44,093 | OXID-eSales/paypal | Component/BasketComponent.php | BasketComponent.formatUrl | protected function formatUrl($unformedUrl)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$params = explode('?', $unformedUrl);
$pageParams = isset($params[1]) ? $params[1] : null;
$params = explode('/', $params[0]);
$className = $params[0];
$header = ($className) ? "cl=$className&" : ''; // adding view name
$header .= ($pageParams) ? "$pageParams&" : ''; // adding page params
$header .= $this->getSession()->sid(); // adding session Id
$url = $myConfig->getCurrentShopUrl($this->isAdmin());
$url = "{$url}index.php?{$header}";
$url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($url);
$seoIsActive = \OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive();
if ($seoIsActive && $seoUrl = \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->getStaticUrl($url)) {
$url = $seoUrl;
}
return $url;
} | php | protected function formatUrl($unformedUrl)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$params = explode('?', $unformedUrl);
$pageParams = isset($params[1]) ? $params[1] : null;
$params = explode('/', $params[0]);
$className = $params[0];
$header = ($className) ? "cl=$className&" : ''; // adding view name
$header .= ($pageParams) ? "$pageParams&" : ''; // adding page params
$header .= $this->getSession()->sid(); // adding session Id
$url = $myConfig->getCurrentShopUrl($this->isAdmin());
$url = "{$url}index.php?{$header}";
$url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($url);
$seoIsActive = \OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive();
if ($seoIsActive && $seoUrl = \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->getStaticUrl($url)) {
$url = $seoUrl;
}
return $url;
} | [
"protected",
"function",
"formatUrl",
"(",
"$",
"unformedUrl",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"params",
"=",
"explode",
"(",
"'?'",
",",
"$",
"un... | Formats Redirect URL to normal url
@param string $unformedUrl
@return string | [
"Formats",
"Redirect",
"URL",
"to",
"normal",
"url"
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Component/BasketComponent.php#L184-L208 |
44,094 | OXID-eSales/paypal | Controller/IPNHandler.php | IPNHandler.getPayPalRequest | public function getPayPalRequest()
{
if ($this->payPalRequest === null) {
$this->payPalRequest = oxNew(\OxidEsales\PayPalModule\Core\Request::class);
}
return $this->payPalRequest;
} | php | public function getPayPalRequest()
{
if ($this->payPalRequest === null) {
$this->payPalRequest = oxNew(\OxidEsales\PayPalModule\Core\Request::class);
}
return $this->payPalRequest;
} | [
"public",
"function",
"getPayPalRequest",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"payPalRequest",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"payPalRequest",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Core",
"\\",
"Request",... | Create object \OxidEsales\PayPalModule\Core\Request to get PayPal request information.
@return \OxidEsales\PayPalModule\Core\Request | [
"Create",
"object",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Core",
"\\",
"Request",
"to",
"get",
"PayPal",
"request",
"information",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/IPNHandler.php#L72-L79 |
44,095 | OXID-eSales/paypal | Controller/IPNHandler.php | IPNHandler.getIPNRequestVerifier | public function getIPNRequestVerifier()
{
if (is_null($this->ipnRequestVerifier)) {
$ipnRequestVerifier = oxNew(\OxidEsales\PayPalModule\Model\IPNRequestVerifier::class);
$this->setIPNRequestVerifier($ipnRequestVerifier);
}
return $this->ipnRequestVerifier;
} | php | public function getIPNRequestVerifier()
{
if (is_null($this->ipnRequestVerifier)) {
$ipnRequestVerifier = oxNew(\OxidEsales\PayPalModule\Model\IPNRequestVerifier::class);
$this->setIPNRequestVerifier($ipnRequestVerifier);
}
return $this->ipnRequestVerifier;
} | [
"public",
"function",
"getIPNRequestVerifier",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"ipnRequestVerifier",
")",
")",
"{",
"$",
"ipnRequestVerifier",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"IPN... | Returns IPN request verifier.
@return \OxidEsales\PayPalModule\Model\IPNRequestVerifier | [
"Returns",
"IPN",
"request",
"verifier",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/IPNHandler.php#L96-L104 |
44,096 | OXID-eSales/paypal | Controller/IPNHandler.php | IPNHandler.getProcessor | public function getProcessor()
{
if (is_null($this->processor)) {
$processor = oxNew(\OxidEsales\PayPalModule\Model\IPNProcessor::class);
$this->setProcessor($processor);
}
return $this->processor;
} | php | public function getProcessor()
{
if (is_null($this->processor)) {
$processor = oxNew(\OxidEsales\PayPalModule\Model\IPNProcessor::class);
$this->setProcessor($processor);
}
return $this->processor;
} | [
"public",
"function",
"getProcessor",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"processor",
")",
")",
"{",
"$",
"processor",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"IPNProcessor",
"::",
"clas... | Returns \OxidEsales\PayPalModule\Model\IPNProcessor object. If object is not set, than it creates it and sets.
@return \OxidEsales\PayPalModule\Model\IPNProcessor | [
"Returns",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Model",
"\\",
"IPNProcessor",
"object",
".",
"If",
"object",
"is",
"not",
"set",
"than",
"it",
"creates",
"it",
"and",
"sets",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Controller/IPNHandler.php#L121-L129 |
44,097 | OXID-eSales/paypal | Core/PayPalService.php | PayPalService.getPayPalIpnConfig | public function getPayPalIpnConfig()
{
if (is_null($this->payPalIpnConfig)) {
$this->setPayPalIPnConfig(oxNew(\OxidEsales\PayPalModule\Core\IpnConfig::class));
}
return $this->payPalIpnConfig;
} | php | public function getPayPalIpnConfig()
{
if (is_null($this->payPalIpnConfig)) {
$this->setPayPalIPnConfig(oxNew(\OxidEsales\PayPalModule\Core\IpnConfig::class));
}
return $this->payPalIpnConfig;
} | [
"public",
"function",
"getPayPalIpnConfig",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"payPalIpnConfig",
")",
")",
"{",
"$",
"this",
"->",
"setPayPalIPnConfig",
"(",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"PayPalModule",
"\\",
"Core",
"... | PayPal config getter.
@return \OxidEsales\PayPalModule\Core\IpnConfig | [
"PayPal",
"config",
"getter",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L89-L96 |
44,098 | OXID-eSales/paypal | Core/PayPalService.php | PayPalService.getCaller | public function getCaller()
{
if (is_null($this->caller)) {
/**
* @var \OxidEsales\PayPalModule\Core\Caller $caller
*/
$caller = oxNew(\OxidEsales\PayPalModule\Core\Caller::class);
$config = $this->getPayPalConfig();
$caller->setParameter('VERSION', '84.0');
$caller->setParameter('PWD', $config->getPassword());
$caller->setParameter('USER', $config->getUserName());
$caller->setParameter('SIGNATURE', $config->getSignature());
$curl = oxNew(\OxidEsales\PayPalModule\Core\Curl::class);
$curl->setDataCharset($config->getCharset());
$curl->setHost($config->getHost());
$curl->setUrlToCall($config->getApiUrl());
$caller->setCurl($curl);
if ($config->isLoggingEnabled()) {
$logger = oxNew(\OxidEsales\PayPalModule\Core\Logger::class);
$logger->setLoggerSessionId(\OxidEsales\Eshop\Core\Registry::getSession()->getId());
$caller->setLogger($logger);
}
$this->setCaller($caller);
}
return $this->caller;
} | php | public function getCaller()
{
if (is_null($this->caller)) {
/**
* @var \OxidEsales\PayPalModule\Core\Caller $caller
*/
$caller = oxNew(\OxidEsales\PayPalModule\Core\Caller::class);
$config = $this->getPayPalConfig();
$caller->setParameter('VERSION', '84.0');
$caller->setParameter('PWD', $config->getPassword());
$caller->setParameter('USER', $config->getUserName());
$caller->setParameter('SIGNATURE', $config->getSignature());
$curl = oxNew(\OxidEsales\PayPalModule\Core\Curl::class);
$curl->setDataCharset($config->getCharset());
$curl->setHost($config->getHost());
$curl->setUrlToCall($config->getApiUrl());
$caller->setCurl($curl);
if ($config->isLoggingEnabled()) {
$logger = oxNew(\OxidEsales\PayPalModule\Core\Logger::class);
$logger->setLoggerSessionId(\OxidEsales\Eshop\Core\Registry::getSession()->getId());
$caller->setLogger($logger);
}
$this->setCaller($caller);
}
return $this->caller;
} | [
"public",
"function",
"getCaller",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"caller",
")",
")",
"{",
"/**\n * @var \\OxidEsales\\PayPalModule\\Core\\Caller $caller\n */",
"$",
"caller",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",... | PayPal caller getter.
@return \OxidEsales\PayPalModule\Core\Caller | [
"PayPal",
"caller",
"getter",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L113-L146 |
44,099 | OXID-eSales/paypal | Core/PayPalService.php | PayPalService.setExpressCheckout | public function setExpressCheckout($request)
{
$caller = $this->getCaller();
$caller->setRequest($request);
$response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseSetExpressCheckout::class);
$response->setData($caller->call('SetExpressCheckout'));
return $response;
} | php | public function setExpressCheckout($request)
{
$caller = $this->getCaller();
$caller->setRequest($request);
$response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseSetExpressCheckout::class);
$response->setData($caller->call('SetExpressCheckout'));
return $response;
} | [
"public",
"function",
"setExpressCheckout",
"(",
"$",
"request",
")",
"{",
"$",
"caller",
"=",
"$",
"this",
"->",
"getCaller",
"(",
")",
";",
"$",
"caller",
"->",
"setRequest",
"(",
"$",
"request",
")",
";",
"$",
"response",
"=",
"oxNew",
"(",
"\\",
... | Executes "SetExpressCheckout". Returns response object from PayPal.
@param \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request
@return \OxidEsales\PayPalModule\Model\Response\ResponseSetExpressCheckout | [
"Executes",
"SetExpressCheckout",
".",
"Returns",
"response",
"object",
"from",
"PayPal",
"."
] | ca9adba6e8312062449b53e7bda4a513c6b8c250 | https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L155-L164 |
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.