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
partition
stringclasses
1 value
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
OXID-eSales/paypal
Core/PayPalService.php
PayPalService.getExpressCheckoutDetails
public function getExpressCheckoutDetails($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseGetExpressCheckoutDetails::class); $response->setData($caller->call('GetExpressCheckoutDetails')); return $response; }
php
public function getExpressCheckoutDetails($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseGetExpressCheckoutDetails::class); $response->setData($caller->call('GetExpressCheckoutDetails')); return $response; }
[ "public", "function", "getExpressCheckoutDetails", "(", "$", "request", ")", "{", "$", "caller", "=", "$", "this", "->", "getCaller", "(", ")", ";", "$", "caller", "->", "setRequest", "(", "$", "request", ")", ";", "$", "response", "=", "oxNew", "(", "...
Executes "GetExpressCheckoutDetails". Returns response object from PayPal. @param \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request @return \OxidEsales\PayPalModule\Model\Response\ResponseGetExpressCheckoutDetails
[ "Executes", "GetExpressCheckoutDetails", ".", "Returns", "response", "object", "from", "PayPal", "." ]
ca9adba6e8312062449b53e7bda4a513c6b8c250
https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L173-L182
train
OXID-eSales/paypal
Core/PayPalService.php
PayPalService.doExpressCheckoutPayment
public function doExpressCheckoutPayment($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoExpressCheckoutPayment::class); $response->setData($caller->call('DoExpressCheckoutPayment')); return $response; }
php
public function doExpressCheckoutPayment($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoExpressCheckoutPayment::class); $response->setData($caller->call('DoExpressCheckoutPayment')); return $response; }
[ "public", "function", "doExpressCheckoutPayment", "(", "$", "request", ")", "{", "$", "caller", "=", "$", "this", "->", "getCaller", "(", ")", ";", "$", "caller", "->", "setRequest", "(", "$", "request", ")", ";", "$", "response", "=", "oxNew", "(", "\...
Executes "DoExpressCheckoutPayment". Returns response object from PayPal. @param \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request @return \OxidEsales\PayPalModule\Model\Response\ResponseDoExpressCheckoutPayment
[ "Executes", "DoExpressCheckoutPayment", ".", "Returns", "response", "object", "from", "PayPal", "." ]
ca9adba6e8312062449b53e7bda4a513c6b8c250
https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L191-L200
train
OXID-eSales/paypal
Core/PayPalService.php
PayPalService.callbackResponse
public function callbackResponse() { // cleanup $this->getCaller()->setParameter("VERSION", null); $this->getCaller()->setParameter("PWD", null); $this->getCaller()->setParameter("USER", null); $this->getCaller()->setParameter("SIGNATURE", null); return $this->getCaller()->getCallBackResponse("CallbackResponse"); }
php
public function callbackResponse() { // cleanup $this->getCaller()->setParameter("VERSION", null); $this->getCaller()->setParameter("PWD", null); $this->getCaller()->setParameter("USER", null); $this->getCaller()->setParameter("SIGNATURE", null); return $this->getCaller()->getCallBackResponse("CallbackResponse"); }
[ "public", "function", "callbackResponse", "(", ")", "{", "// cleanup", "$", "this", "->", "getCaller", "(", ")", "->", "setParameter", "(", "\"VERSION\"", ",", "null", ")", ";", "$", "this", "->", "getCaller", "(", ")", "->", "setParameter", "(", "\"PWD\""...
Executes PayPal callback request @return string
[ "Executes", "PayPal", "callback", "request" ]
ca9adba6e8312062449b53e7bda4a513c6b8c250
https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L207-L216
train
OXID-eSales/paypal
Core/PayPalService.php
PayPalService.doVoid
public function doVoid($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoVoid::class); $response->setData($caller->call('DoVoid')); return $response; }
php
public function doVoid($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoVoid::class); $response->setData($caller->call('DoVoid')); return $response; }
[ "public", "function", "doVoid", "(", "$", "request", ")", "{", "$", "caller", "=", "$", "this", "->", "getCaller", "(", ")", ";", "$", "caller", "->", "setRequest", "(", "$", "request", ")", ";", "$", "response", "=", "oxNew", "(", "\\", "OxidEsales"...
Executes "DoVoid". Returns response array from PayPal @param \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request @return \OxidEsales\PayPalModule\Model\Response\Response
[ "Executes", "DoVoid", ".", "Returns", "response", "array", "from", "PayPal" ]
ca9adba6e8312062449b53e7bda4a513c6b8c250
https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L225-L234
train
OXID-eSales/paypal
Core/PayPalService.php
PayPalService.refundTransaction
public function refundTransaction($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoRefund::class); $response->setData($caller->call('RefundTransaction')); return $response; }
php
public function refundTransaction($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoRefund::class); $response->setData($caller->call('RefundTransaction')); return $response; }
[ "public", "function", "refundTransaction", "(", "$", "request", ")", "{", "$", "caller", "=", "$", "this", "->", "getCaller", "(", ")", ";", "$", "caller", "->", "setRequest", "(", "$", "request", ")", ";", "$", "response", "=", "oxNew", "(", "\\", "...
Executes "RefundTransaction". Returns response array from PayPal @param \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request @return \OxidEsales\PayPalModule\Model\Response\Response
[ "Executes", "RefundTransaction", ".", "Returns", "response", "array", "from", "PayPal" ]
ca9adba6e8312062449b53e7bda4a513c6b8c250
https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L243-L252
train
OXID-eSales/paypal
Core/PayPalService.php
PayPalService.doCapture
public function doCapture($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoCapture::class); $response->setData($caller->call('DoCapture')); return $response; }
php
public function doCapture($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoCapture::class); $response->setData($caller->call('DoCapture')); return $response; }
[ "public", "function", "doCapture", "(", "$", "request", ")", "{", "$", "caller", "=", "$", "this", "->", "getCaller", "(", ")", ";", "$", "caller", "->", "setRequest", "(", "$", "request", ")", ";", "$", "response", "=", "oxNew", "(", "\\", "OxidEsal...
Executes "DoCapture". Returns response array from PayPal @param \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request request @return \OxidEsales\PayPalModule\Model\Response\Response
[ "Executes", "DoCapture", ".", "Returns", "response", "array", "from", "PayPal" ]
ca9adba6e8312062449b53e7bda4a513c6b8c250
https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L261-L270
train
OXID-eSales/paypal
Core/PayPalService.php
PayPalService.doReAuthorization
public function doReAuthorization($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoReAuthorize::class); $response->setData($caller->call('DoReauthorization')); return $response; }
php
public function doReAuthorization($request) { $caller = $this->getCaller(); $caller->setRequest($request); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoReAuthorize::class); $response->setData($caller->call('DoReauthorization')); return $response; }
[ "public", "function", "doReAuthorization", "(", "$", "request", ")", "{", "$", "caller", "=", "$", "this", "->", "getCaller", "(", ")", ";", "$", "caller", "->", "setRequest", "(", "$", "request", ")", ";", "$", "response", "=", "oxNew", "(", "\\", "...
Executes "DoReauthorization". Returns response array from PayPal. @param \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request @return \OxidEsales\PayPalModule\Model\Response\Response
[ "Executes", "DoReauthorization", ".", "Returns", "response", "array", "from", "PayPal", "." ]
ca9adba6e8312062449b53e7bda4a513c6b8c250
https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L279-L288
train
OXID-eSales/paypal
Core/PayPalService.php
PayPalService.doVerifyWithPayPal
public function doVerifyWithPayPal($request, $charset) { $caller = $this->getCaller(); $caller->setRequest($request); $caller = $this->getCaller(); $curl = $caller->getCurl(); $curl->setConnectionCharset($charset); $curl->setDataCharset($charset); $curl->setHost($this->getPayPalIpnConfig()->getIpnHost()); $curl->setUrlToCall($this->getPayPalIpnConfig()->getIPNResponseUrl()); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoVerifyWithPayPal::class); $response->setData($caller->call()); return $response; }
php
public function doVerifyWithPayPal($request, $charset) { $caller = $this->getCaller(); $caller->setRequest($request); $caller = $this->getCaller(); $curl = $caller->getCurl(); $curl->setConnectionCharset($charset); $curl->setDataCharset($charset); $curl->setHost($this->getPayPalIpnConfig()->getIpnHost()); $curl->setUrlToCall($this->getPayPalIpnConfig()->getIPNResponseUrl()); $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoVerifyWithPayPal::class); $response->setData($caller->call()); return $response; }
[ "public", "function", "doVerifyWithPayPal", "(", "$", "request", ",", "$", "charset", ")", "{", "$", "caller", "=", "$", "this", "->", "getCaller", "(", ")", ";", "$", "caller", "->", "setRequest", "(", "$", "request", ")", ";", "$", "caller", "=", "...
Executes call to PayPal IPN. @param \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request @param string $charset @return \OxidEsales\PayPalModule\Model\Response\Response
[ "Executes", "call", "to", "PayPal", "IPN", "." ]
ca9adba6e8312062449b53e7bda4a513c6b8c250
https://github.com/OXID-eSales/paypal/blob/ca9adba6e8312062449b53e7bda4a513c6b8c250/Core/PayPalService.php#L298-L314
train
pdffiller/pdffiller-php-api-client
src/FillableForm.php
FillableForm.forms
public function forms() { $response = static::query($this->client, [$this->fillable_form_id, self::FORMS_URI]); $forms = new ModelsList(); if (isset($response['items'])) { foreach ($response['items'] as $item) { $forms[] = new FilledForm($this->client, $this->fillable_form_id, $item); } } return $forms; }
php
public function forms() { $response = static::query($this->client, [$this->fillable_form_id, self::FORMS_URI]); $forms = new ModelsList(); if (isset($response['items'])) { foreach ($response['items'] as $item) { $forms[] = new FilledForm($this->client, $this->fillable_form_id, $item); } } return $forms; }
[ "public", "function", "forms", "(", ")", "{", "$", "response", "=", "static", "::", "query", "(", "$", "this", "->", "client", ",", "[", "$", "this", "->", "fillable_form_id", ",", "self", "::", "FORMS_URI", "]", ")", ";", "$", "forms", "=", "new", ...
Returns filled forms @return array|ModelsList @throws Exceptions\InvalidQueryException @throws Exceptions\InvalidRequestException @throws \ReflectionException
[ "Returns", "filled", "forms" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/FillableForm.php#L65-L77
train
pdffiller/pdffiller-php-api-client
src/FillableForm.php
FillableForm.download
public function download(string $callback = "") { $parameters = []; if (!empty($callback) && is_string($callback)) { $parameters['callback_url'] = $callback; } return static::query($this->client, [$this->fillable_form_id, self::DOWNLOAD_URI], $parameters); }
php
public function download(string $callback = "") { $parameters = []; if (!empty($callback) && is_string($callback)) { $parameters['callback_url'] = $callback; } return static::query($this->client, [$this->fillable_form_id, self::DOWNLOAD_URI], $parameters); }
[ "public", "function", "download", "(", "string", "$", "callback", "=", "\"\"", ")", "{", "$", "parameters", "=", "[", "]", ";", "if", "(", "!", "empty", "(", "$", "callback", ")", "&&", "is_string", "(", "$", "callback", ")", ")", "{", "$", "parame...
Downloads filled forms as a ZIP archive @param string $callback @return mixed @throws Exceptions\InvalidQueryException @throws Exceptions\InvalidRequestException
[ "Downloads", "filled", "forms", "as", "a", "ZIP", "archive" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/FillableForm.php#L97-L106
train
pdffiller/pdffiller-php-api-client
src/DTO/FillableFieldsList.php
FillableFieldsList.getFields
private function getFields() { $fields = []; foreach ($this->items as $name => $field) { if (is_array($field) && isset($field['name'])) { $fields[] = $field['name']; } else if ($field instanceof FillableField){ $fields[] = $field->name; } else if (is_string($name)){ $fields[] = $name; } else { $fields[] = ''; } } return $fields; }
php
private function getFields() { $fields = []; foreach ($this->items as $name => $field) { if (is_array($field) && isset($field['name'])) { $fields[] = $field['name']; } else if ($field instanceof FillableField){ $fields[] = $field->name; } else if (is_string($name)){ $fields[] = $name; } else { $fields[] = ''; } } return $fields; }
[ "private", "function", "getFields", "(", ")", "{", "$", "fields", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "items", "as", "$", "name", "=>", "$", "field", ")", "{", "if", "(", "is_array", "(", "$", "field", ")", "&&", "isset", "(", ...
Returns the fields names in simple array @return array
[ "Returns", "the", "fields", "names", "in", "simple", "array" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/DTO/FillableFieldsList.php#L42-L59
train
pdffiller/pdffiller-php-api-client
src/DTO/FillableFieldsList.php
FillableFieldsList.eachFillable
public function eachFillable(Closure $closure) { /** @var FillableField $item */ foreach ($this->items as $item) { if ($item->fillable) { $closure($item); } } }
php
public function eachFillable(Closure $closure) { /** @var FillableField $item */ foreach ($this->items as $item) { if ($item->fillable) { $closure($item); } } }
[ "public", "function", "eachFillable", "(", "Closure", "$", "closure", ")", "{", "/** @var FillableField $item */", "foreach", "(", "$", "this", "->", "items", "as", "$", "item", ")", "{", "if", "(", "$", "item", "->", "fillable", ")", "{", "$", "closure", ...
Walks through the list and calls the closure on each field that can be filled. @param Closure $closure
[ "Walks", "through", "the", "list", "and", "calls", "the", "closure", "on", "each", "field", "that", "can", "be", "filled", "." ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/DTO/FillableFieldsList.php#L138-L146
train
pdffiller/pdffiller-php-api-client
src/DTO/FillableFieldsList.php
FillableFieldsList.getOnlyFillable
public function getOnlyFillable() { $list = []; foreach ($this->items as $item) { if ($item->fillable) { $list[] = $item; } } return new static($list); }
php
public function getOnlyFillable() { $list = []; foreach ($this->items as $item) { if ($item->fillable) { $list[] = $item; } } return new static($list); }
[ "public", "function", "getOnlyFillable", "(", ")", "{", "$", "list", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "items", "as", "$", "item", ")", "{", "if", "(", "$", "item", "->", "fillable", ")", "{", "$", "list", "[", "]", "=", "$...
Returns a new list containing only fields that can be filled @return FillableFieldsList
[ "Returns", "a", "new", "list", "containing", "only", "fields", "that", "can", "be", "filled" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/DTO/FillableFieldsList.php#L153-L164
train
pdffiller/pdffiller-php-api-client
examples/ExampleFabric.php
ExampleFabric.getProvider
public function getProvider($accessTokenParams = [], $useCache = true) { if (!$useCache) { $this->provider->getAccessToken($this->type, $accessTokenParams); return $this->provider; } return $this->provider->setAccessToken($this->getToken($accessTokenParams)); }
php
public function getProvider($accessTokenParams = [], $useCache = true) { if (!$useCache) { $this->provider->getAccessToken($this->type, $accessTokenParams); return $this->provider; } return $this->provider->setAccessToken($this->getToken($accessTokenParams)); }
[ "public", "function", "getProvider", "(", "$", "accessTokenParams", "=", "[", "]", ",", "$", "useCache", "=", "true", ")", "{", "if", "(", "!", "$", "useCache", ")", "{", "$", "this", "->", "provider", "->", "getAccessToken", "(", "$", "this", "->", ...
Returns the provider ready to use @param array $accessTokenParams @param bool $useCache @return PDFfiller
[ "Returns", "the", "provider", "ready", "to", "use" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/examples/ExampleFabric.php#L44-L52
train
pdffiller/pdffiller-php-api-client
examples/ExampleFabric.php
ExampleFabric.cacheToken
private function cacheToken(AccessToken $accessToken) { $tz = self::TIME_ZONE; $kvs = $this->getKeyValueStorage(); $liveTimeInSec = Carbon::createFromTimestamp($accessToken->getExpires(), $tz)->diffInSeconds(Carbon::now($tz)); $kvs->set(self::ACCESS_TOKEN_KEY, $accessToken->getToken()); $kvs->expire(self::ACCESS_TOKEN_KEY, $liveTimeInSec); $kvs->set(self::REFRESH_TOKEN_KEY, $accessToken->getRefreshToken()); }
php
private function cacheToken(AccessToken $accessToken) { $tz = self::TIME_ZONE; $kvs = $this->getKeyValueStorage(); $liveTimeInSec = Carbon::createFromTimestamp($accessToken->getExpires(), $tz)->diffInSeconds(Carbon::now($tz)); $kvs->set(self::ACCESS_TOKEN_KEY, $accessToken->getToken()); $kvs->expire(self::ACCESS_TOKEN_KEY, $liveTimeInSec); $kvs->set(self::REFRESH_TOKEN_KEY, $accessToken->getRefreshToken()); }
[ "private", "function", "cacheToken", "(", "AccessToken", "$", "accessToken", ")", "{", "$", "tz", "=", "self", "::", "TIME_ZONE", ";", "$", "kvs", "=", "$", "this", "->", "getKeyValueStorage", "(", ")", ";", "$", "liveTimeInSec", "=", "Carbon", "::", "cr...
Puts the given access token to the local cache @param AccessToken $accessToken
[ "Puts", "the", "given", "access", "token", "to", "the", "local", "cache" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/examples/ExampleFabric.php#L59-L69
train
pdffiller/pdffiller-php-api-client
examples/ExampleFabric.php
ExampleFabric.getToken
private function getToken($accessTokenParams) { $kvs = $this->getKeyValueStorage(); if ($kvs->has(self::ACCESS_TOKEN_KEY) && $kvs->has(self::REFRESH_TOKEN_KEY)) { return new AccessToken([ 'access_token' => $kvs->get(self::ACCESS_TOKEN_KEY), 'expires_in' => $kvs->getTtl(self::ACCESS_TOKEN_KEY), 'refresh_token' => $kvs->get(self::REFRESH_TOKEN_KEY), ]); } $accessToken = $this->provider->getAccessToken($this->type, $accessTokenParams); $this->cacheToken($accessToken); return $accessToken; }
php
private function getToken($accessTokenParams) { $kvs = $this->getKeyValueStorage(); if ($kvs->has(self::ACCESS_TOKEN_KEY) && $kvs->has(self::REFRESH_TOKEN_KEY)) { return new AccessToken([ 'access_token' => $kvs->get(self::ACCESS_TOKEN_KEY), 'expires_in' => $kvs->getTtl(self::ACCESS_TOKEN_KEY), 'refresh_token' => $kvs->get(self::REFRESH_TOKEN_KEY), ]); } $accessToken = $this->provider->getAccessToken($this->type, $accessTokenParams); $this->cacheToken($accessToken); return $accessToken; }
[ "private", "function", "getToken", "(", "$", "accessTokenParams", ")", "{", "$", "kvs", "=", "$", "this", "->", "getKeyValueStorage", "(", ")", ";", "if", "(", "$", "kvs", "->", "has", "(", "self", "::", "ACCESS_TOKEN_KEY", ")", "&&", "$", "kvs", "->",...
Gets the access token from the cache if it exists there or requests the new one with given credentials. @param $accessTokenParams @return AccessToken
[ "Gets", "the", "access", "token", "from", "the", "cache", "if", "it", "exists", "there", "or", "requests", "the", "new", "one", "with", "given", "credentials", "." ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/examples/ExampleFabric.php#L78-L94
train
pdffiller/pdffiller-php-api-client
src/Template.php
Template.createConstructor
public function createConstructor(array $params) { $url = self::resolveFullUrl([$this->id, 'constructor']); $options = [ 'json' => $params, ]; return static::post($this->client, $url, $options); }
php
public function createConstructor(array $params) { $url = self::resolveFullUrl([$this->id, 'constructor']); $options = [ 'json' => $params, ]; return static::post($this->client, $url, $options); }
[ "public", "function", "createConstructor", "(", "array", "$", "params", ")", "{", "$", "url", "=", "self", "::", "resolveFullUrl", "(", "[", "$", "this", "->", "id", ",", "'constructor'", "]", ")", ";", "$", "options", "=", "[", "'json'", "=>", "$", ...
Create link to edit a specific template @param array $params @return mixed @throws Exceptions\InvalidQueryException @throws Exceptions\InvalidRequestException
[ "Create", "link", "to", "edit", "a", "specific", "template" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Template.php#L83-L92
train
pdffiller/pdffiller-php-api-client
src/Template.php
Template.fill
public function fill($fields = []) { $url = self::resolveFullUrl([$this->id]); if(isset($this->properties['fillable_fields'])) { $fields = $this->properties['fillable_fields']; } foreach ($fields as $index => $field) { if (!is_array($field)) { continue; } unset($fields[$index]); if (!isset($field['name']) || !isset($field['value'])) { continue; } $name = $field['name']; $value = $field['value']; $type = isset($field['type']) ? $field['type'] : ''; if ($type === self::TYPE_CHECKBOX) { $value = intval(boolval($value)); } $fields[$name] = $value; } return static::post($this->client, $url, [ 'json' => [ 'fillable_fields' => $fields ] ]); }
php
public function fill($fields = []) { $url = self::resolveFullUrl([$this->id]); if(isset($this->properties['fillable_fields'])) { $fields = $this->properties['fillable_fields']; } foreach ($fields as $index => $field) { if (!is_array($field)) { continue; } unset($fields[$index]); if (!isset($field['name']) || !isset($field['value'])) { continue; } $name = $field['name']; $value = $field['value']; $type = isset($field['type']) ? $field['type'] : ''; if ($type === self::TYPE_CHECKBOX) { $value = intval(boolval($value)); } $fields[$name] = $value; } return static::post($this->client, $url, [ 'json' => [ 'fillable_fields' => $fields ] ]); }
[ "public", "function", "fill", "(", "$", "fields", "=", "[", "]", ")", "{", "$", "url", "=", "self", "::", "resolveFullUrl", "(", "[", "$", "this", "->", "id", "]", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "properties", "[", "'fillabl...
Fill template with named fields @param array $fields @return mixed @throws Exceptions\InvalidQueryException @throws Exceptions\InvalidRequestException
[ "Fill", "template", "with", "named", "fields" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Template.php#L130-L165
train
pdffiller/pdffiller-php-api-client
src/Template.php
Template.watermark
public function watermark($watermarkText) { $url = self::resolveFullUrl([$this->id, self::WATERMARK], ['text' => $watermarkText]); return static::post($this->client, $url); }
php
public function watermark($watermarkText) { $url = self::resolveFullUrl([$this->id, self::WATERMARK], ['text' => $watermarkText]); return static::post($this->client, $url); }
[ "public", "function", "watermark", "(", "$", "watermarkText", ")", "{", "$", "url", "=", "self", "::", "resolveFullUrl", "(", "[", "$", "this", "->", "id", ",", "self", "::", "WATERMARK", "]", ",", "[", "'text'", "=>", "$", "watermarkText", "]", ")", ...
Get template meta @param $watermarkText @return mixed @throws Exceptions\InvalidQueryException @throws Exceptions\InvalidRequestException
[ "Get", "template", "meta" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Template.php#L231-L236
train
pdffiller/pdffiller-php-api-client
src/Core/Enum.php
Enum.getConstants
public function getConstants(bool $includeDefault = false): array { $constants = (new \ReflectionClass($this))->getConstants(); if (!$includeDefault) { unset($constants['__default']); } return $constants; }
php
public function getConstants(bool $includeDefault = false): array { $constants = (new \ReflectionClass($this))->getConstants(); if (!$includeDefault) { unset($constants['__default']); } return $constants; }
[ "public", "function", "getConstants", "(", "bool", "$", "includeDefault", "=", "false", ")", ":", "array", "{", "$", "constants", "=", "(", "new", "\\", "ReflectionClass", "(", "$", "this", ")", ")", "->", "getConstants", "(", ")", ";", "if", "(", "!",...
Returns an array of possible class values. @param bool $includeDefault @return array
[ "Returns", "an", "array", "of", "possible", "class", "values", "." ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Enum.php#L39-L48
train
pdffiller/pdffiller-php-api-client
src/Traits/CastsTrait.php
CastsTrait.castField
private function castField($option, $value) { $casts = $this->casts; if (!isset($casts[$option])) { return $value; } $cast = $casts[$option]; if (is_null($value) || is_null($cast)) { return $value; } if (is_array($cast)) { return $this->complexListCast($value, $cast); } switch ($cast) { case 'int': case 'integer': return (int) $value; case 'real': case 'float': case 'double': return (float) $value; case 'string': return (string) $value; case 'bool': case 'boolean': return (bool) $value; case 'list': return $this->castToList($value); default: return $this->castToObject($value, $cast); } }
php
private function castField($option, $value) { $casts = $this->casts; if (!isset($casts[$option])) { return $value; } $cast = $casts[$option]; if (is_null($value) || is_null($cast)) { return $value; } if (is_array($cast)) { return $this->complexListCast($value, $cast); } switch ($cast) { case 'int': case 'integer': return (int) $value; case 'real': case 'float': case 'double': return (float) $value; case 'string': return (string) $value; case 'bool': case 'boolean': return (bool) $value; case 'list': return $this->castToList($value); default: return $this->castToObject($value, $cast); } }
[ "private", "function", "castField", "(", "$", "option", ",", "$", "value", ")", "{", "$", "casts", "=", "$", "this", "->", "casts", ";", "if", "(", "!", "isset", "(", "$", "casts", "[", "$", "option", "]", ")", ")", "{", "return", "$", "value", ...
Casts the field @param $option @param $value @return bool|float|mixed|ListObject|string
[ "Casts", "the", "field" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Traits/CastsTrait.php#L22-L58
train
pdffiller/pdffiller-php-api-client
src/Traits/CastsTrait.php
CastsTrait.castToObject
private function castToObject($value, $class) { if (!class_exists($class) || $value instanceof $class) { return $value; } $parentClasses = class_parents($class); if (in_array(Enum::class, $parentClasses) || in_array(AbstractObject::class, $parentClasses)) { return new $class($value); } if (in_array(Model::class, $parentClasses)) { return new $class($this->getClient(), $value); } if (in_array(ListObject::class, $parentClasses)) { return new $class($value); } return $value; }
php
private function castToObject($value, $class) { if (!class_exists($class) || $value instanceof $class) { return $value; } $parentClasses = class_parents($class); if (in_array(Enum::class, $parentClasses) || in_array(AbstractObject::class, $parentClasses)) { return new $class($value); } if (in_array(Model::class, $parentClasses)) { return new $class($this->getClient(), $value); } if (in_array(ListObject::class, $parentClasses)) { return new $class($value); } return $value; }
[ "private", "function", "castToObject", "(", "$", "value", ",", "$", "class", ")", "{", "if", "(", "!", "class_exists", "(", "$", "class", ")", "||", "$", "value", "instanceof", "$", "class", ")", "{", "return", "$", "value", ";", "}", "$", "parentCla...
Casts value to the given class @param $value @param $class @return mixed
[ "Casts", "value", "to", "the", "given", "class" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Traits/CastsTrait.php#L87-L108
train
pdffiller/pdffiller-php-api-client
src/Core/ExceptionsMessages.php
ExceptionsMessages.getMessages
protected function getMessages(string $locale = "en"):array { $path = __DIR__ . "/../Messages/" . $locale . "/messages.json"; if (file_exists($path)) { $jsonMessages = file_get_contents($path); return json_decode($jsonMessages, true); } return []; }
php
protected function getMessages(string $locale = "en"):array { $path = __DIR__ . "/../Messages/" . $locale . "/messages.json"; if (file_exists($path)) { $jsonMessages = file_get_contents($path); return json_decode($jsonMessages, true); } return []; }
[ "protected", "function", "getMessages", "(", "string", "$", "locale", "=", "\"en\"", ")", ":", "array", "{", "$", "path", "=", "__DIR__", ".", "\"/../Messages/\"", ".", "$", "locale", ".", "\"/messages.json\"", ";", "if", "(", "file_exists", "(", "$", "pat...
Returns an array of possible exceptions messages @param string $locale @return array
[ "Returns", "an", "array", "of", "possible", "exceptions", "messages" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/ExceptionsMessages.php#L57-L68
train
pdffiller/pdffiller-php-api-client
src/SignatureRequest.php
SignatureRequest.getInbox
public static function getInbox(PDFfiller $provider, $parameters = []) { $paramsArray = self::query($provider, [self::INBOX], $parameters); $paramsArray['items'] = array_map(function ($entry) { $entry['recipients'] = [$entry['recipients']]; $entry['except'] = ['callbacks']; return $entry; }, $paramsArray['items']); $paramsArray['items'] = static::formItems($provider, $paramsArray); return new ModelsList($paramsArray); }
php
public static function getInbox(PDFfiller $provider, $parameters = []) { $paramsArray = self::query($provider, [self::INBOX], $parameters); $paramsArray['items'] = array_map(function ($entry) { $entry['recipients'] = [$entry['recipients']]; $entry['except'] = ['callbacks']; return $entry; }, $paramsArray['items']); $paramsArray['items'] = static::formItems($provider, $paramsArray); return new ModelsList($paramsArray); }
[ "public", "static", "function", "getInbox", "(", "PDFfiller", "$", "provider", ",", "$", "parameters", "=", "[", "]", ")", "{", "$", "paramsArray", "=", "self", "::", "query", "(", "$", "provider", ",", "[", "self", "::", "INBOX", "]", ",", "$", "par...
Return signatures request list in inbox @param PDFfiller $provider @param array $parameters @return ModelsList
[ "Return", "signatures", "request", "list", "in", "inbox" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/SignatureRequest.php#L75-L87
train
pdffiller/pdffiller-php-api-client
src/SignatureRequest.php
SignatureRequest.inboxDownload
public static function inboxDownload($provider, $params = []) { if (isset($params['status']) && $params['status'] instanceof SignatureRequestStatus) { $params['status'] = mb_strtolower($params['status']->getValue()); } return self::query($provider, [self::INBOX, self::DOWNLOAD], $params); }
php
public static function inboxDownload($provider, $params = []) { if (isset($params['status']) && $params['status'] instanceof SignatureRequestStatus) { $params['status'] = mb_strtolower($params['status']->getValue()); } return self::query($provider, [self::INBOX, self::DOWNLOAD], $params); }
[ "public", "static", "function", "inboxDownload", "(", "$", "provider", ",", "$", "params", "=", "[", "]", ")", "{", "if", "(", "isset", "(", "$", "params", "[", "'status'", "]", ")", "&&", "$", "params", "[", "'status'", "]", "instanceof", "SignatureRe...
Returns zip-archive of SendToSign inbox documents. Supports a filter parameters such as 'status', 'perpage', 'datefrom', 'dateto', 'order', 'orderby'. Status can be only 'signed', 'in_progress' and 'sent' @param $provider @param array $params @return string
[ "Returns", "zip", "-", "archive", "of", "SendToSign", "inbox", "documents", ".", "Supports", "a", "filter", "parameters", "such", "as", "status", "perpage", "datefrom", "dateto", "order", "orderby", ".", "Status", "can", "be", "only", "signed", "in_progress", ...
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/SignatureRequest.php#L98-L105
train
pdffiller/pdffiller-php-api-client
src/SignatureRequest.php
SignatureRequest.formRecipients
protected static function formRecipients($inputRecipients, PDFfiller $provider, $signatureRequestId) { $recipients = []; foreach ($inputRecipients as $recipient) { $recipients[$recipient['id']] = new SignatureRequestRecipient($provider, $recipient, $signatureRequestId); } return $recipients; }
php
protected static function formRecipients($inputRecipients, PDFfiller $provider, $signatureRequestId) { $recipients = []; foreach ($inputRecipients as $recipient) { $recipients[$recipient['id']] = new SignatureRequestRecipient($provider, $recipient, $signatureRequestId); } return $recipients; }
[ "protected", "static", "function", "formRecipients", "(", "$", "inputRecipients", ",", "PDFfiller", "$", "provider", ",", "$", "signatureRequestId", ")", "{", "$", "recipients", "=", "[", "]", ";", "foreach", "(", "$", "inputRecipients", "as", "$", "recipient"...
Prepares recipients array @param $inputRecipients @param PDFfiller $provider @param $signatureRequestId @return array
[ "Prepares", "recipients", "array" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/SignatureRequest.php#L120-L129
train
pdffiller/pdffiller-php-api-client
src/SignatureRequest.php
SignatureRequest.recipients
public static function recipients(PDFfiller $provider, $signatureRequestId) { $recipients = self::query($provider, [$signatureRequestId, SignatureRequestRecipient::RECIPIENT]); return new ListObject(self::formRecipients($recipients['items'], $provider, $signatureRequestId)); }
php
public static function recipients(PDFfiller $provider, $signatureRequestId) { $recipients = self::query($provider, [$signatureRequestId, SignatureRequestRecipient::RECIPIENT]); return new ListObject(self::formRecipients($recipients['items'], $provider, $signatureRequestId)); }
[ "public", "static", "function", "recipients", "(", "PDFfiller", "$", "provider", ",", "$", "signatureRequestId", ")", "{", "$", "recipients", "=", "self", "::", "query", "(", "$", "provider", ",", "[", "$", "signatureRequestId", ",", "SignatureRequestRecipient",...
Returns signature request recipients list. @param PDFfiller $provider @param integer $signatureRequestId @return ListObject
[ "Returns", "signature", "request", "recipients", "list", "." ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/SignatureRequest.php#L204-L209
train
pdffiller/pdffiller-php-api-client
src/SignatureRequest.php
SignatureRequest.recipient
public static function recipient(PDFfiller $provider, $signatureRequestId, $recipientId) { $recipient = self::query($provider, [$signatureRequestId, SignatureRequestRecipient::RECIPIENT, $recipientId]); return new SignatureRequestRecipient($provider, $recipient, $signatureRequestId); }
php
public static function recipient(PDFfiller $provider, $signatureRequestId, $recipientId) { $recipient = self::query($provider, [$signatureRequestId, SignatureRequestRecipient::RECIPIENT, $recipientId]); return new SignatureRequestRecipient($provider, $recipient, $signatureRequestId); }
[ "public", "static", "function", "recipient", "(", "PDFfiller", "$", "provider", ",", "$", "signatureRequestId", ",", "$", "recipientId", ")", "{", "$", "recipient", "=", "self", "::", "query", "(", "$", "provider", ",", "[", "$", "signatureRequestId", ",", ...
Returns current signature request recipient by id. @param PDFfiller $provider @param $signatureRequestId @param $recipientId @return SignatureRequestRecipient
[ "Returns", "current", "signature", "request", "recipient", "by", "id", "." ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/SignatureRequest.php#L219-L224
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.initArrayFields
protected function initArrayFields(array $except = []) { $reflection = new ReflectionClass(static::class); $docs = ($reflection->getDocComment()); $docs = preg_replace("~[*/]+~", ' ', $docs); preg_match_all("~@property\s+(array|mixed|ListObject|FillableFieldsList)\s+\\$(.*)\r?\n+~", $docs, $result); if ($result) { $fields = array_diff($result[2], $except); foreach ($fields as $field) { $this->properties[$field] = new ListObject(); } } }
php
protected function initArrayFields(array $except = []) { $reflection = new ReflectionClass(static::class); $docs = ($reflection->getDocComment()); $docs = preg_replace("~[*/]+~", ' ', $docs); preg_match_all("~@property\s+(array|mixed|ListObject|FillableFieldsList)\s+\\$(.*)\r?\n+~", $docs, $result); if ($result) { $fields = array_diff($result[2], $except); foreach ($fields as $field) { $this->properties[$field] = new ListObject(); } } }
[ "protected", "function", "initArrayFields", "(", "array", "$", "except", "=", "[", "]", ")", "{", "$", "reflection", "=", "new", "ReflectionClass", "(", "static", "::", "class", ")", ";", "$", "docs", "=", "(", "$", "reflection", "->", "getDocComment", "...
Initializes the object's arrays and lists @param array $except @throws \ReflectionException
[ "Initializes", "the", "object", "s", "arrays", "and", "lists" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L74-L88
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.save
public function save($options = []) { if (!isset($options['except'])) { $options['except'] = []; } $options['except'] = array_merge($options['except'], $this->readOnly); if (!$this->exists) { return $this->create($options); } return $this->update($options); }
php
public function save($options = []) { if (!isset($options['except'])) { $options['except'] = []; } $options['except'] = array_merge($options['except'], $this->readOnly); if (!$this->exists) { return $this->create($options); } return $this->update($options); }
[ "public", "function", "save", "(", "$", "options", "=", "[", "]", ")", "{", "if", "(", "!", "isset", "(", "$", "options", "[", "'except'", "]", ")", ")", "{", "$", "options", "[", "'except'", "]", "=", "[", "]", ";", "}", "$", "options", "[", ...
Creates or updates model @param array $options @return mixed @throws InvalidRequestException @throws ResponseException
[ "Creates", "or", "updates", "model" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L107-L120
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.parseArray
public function parseArray($array, $options = []) { // default options $options['except'] = $options['except'] ?? []; foreach ($options['except'] as $value) { unset($array[$value]); } foreach ($array as $key => $value) { $this->properties[$key] = $this->castField($key, $value); } return $this; }
php
public function parseArray($array, $options = []) { // default options $options['except'] = $options['except'] ?? []; foreach ($options['except'] as $value) { unset($array[$value]); } foreach ($array as $key => $value) { $this->properties[$key] = $this->castField($key, $value); } return $this; }
[ "public", "function", "parseArray", "(", "$", "array", ",", "$", "options", "=", "[", "]", ")", "{", "// default options", "$", "options", "[", "'except'", "]", "=", "$", "options", "[", "'except'", "]", "??", "[", "]", ";", "foreach", "(", "$", "opt...
Extracts properties from array @param $array @param array $options @return $this
[ "Extracts", "properties", "from", "array" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L147-L161
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.apiCall
protected static function apiCall($provider, $method, $uri, $params = []) { $methodName = $method . 'ApiCall'; if (method_exists($provider, $methodName)) { return $provider->{$methodName}($uri, $params); } throw new InvalidRequestException(); }
php
protected static function apiCall($provider, $method, $uri, $params = []) { $methodName = $method . 'ApiCall'; if (method_exists($provider, $methodName)) { return $provider->{$methodName}($uri, $params); } throw new InvalidRequestException(); }
[ "protected", "static", "function", "apiCall", "(", "$", "provider", ",", "$", "method", ",", "$", "uri", ",", "$", "params", "=", "[", "]", ")", "{", "$", "methodName", "=", "$", "method", ".", "'ApiCall'", ";", "if", "(", "method_exists", "(", "$", ...
Sends request by given type, uri and options @param PDFfiller $provider @param $method @param $uri @param array $params @return mixed @throws InvalidRequestException
[ "Sends", "request", "by", "given", "type", "uri", "and", "options" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L181-L188
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.resolveFullUrl
protected static function resolveFullUrl($entities = [], $params = []) { $uri = static::getUri(); if (!empty($entities)) { if (is_array($entities)) { $entities = implode('/', $entities) . '/'; } if (!is_scalar($entities)) { throw new InvalidQueryException(); } $uri .= $entities; } if (!empty($params)) { $uri .= '?' . http_build_query($params); } return $uri; }
php
protected static function resolveFullUrl($entities = [], $params = []) { $uri = static::getUri(); if (!empty($entities)) { if (is_array($entities)) { $entities = implode('/', $entities) . '/'; } if (!is_scalar($entities)) { throw new InvalidQueryException(); } $uri .= $entities; } if (!empty($params)) { $uri .= '?' . http_build_query($params); } return $uri; }
[ "protected", "static", "function", "resolveFullUrl", "(", "$", "entities", "=", "[", "]", ",", "$", "params", "=", "[", "]", ")", "{", "$", "uri", "=", "static", "::", "getUri", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "entities", ")", "...
Builds the full url @param array $entities @param array $params @return string @throws InvalidQueryException
[ "Builds", "the", "full", "url" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L198-L219
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.query
public static function query($provider, $entities = [], $params = []) { $url = self::resolveFullUrl($entities, $params); return static::apiCall($provider, 'query', $url); }
php
public static function query($provider, $entities = [], $params = []) { $url = self::resolveFullUrl($entities, $params); return static::apiCall($provider, 'query', $url); }
[ "public", "static", "function", "query", "(", "$", "provider", ",", "$", "entities", "=", "[", "]", ",", "$", "params", "=", "[", "]", ")", "{", "$", "url", "=", "self", "::", "resolveFullUrl", "(", "$", "entities", ",", "$", "params", ")", ";", ...
Returns entity properties as a result of get request. @param $provider @param array $entities @param array $params @return mixed @throws InvalidQueryException @throws InvalidRequestException
[ "Returns", "entity", "properties", "as", "a", "result", "of", "get", "request", "." ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L230-L235
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.remove
public function remove() { if (isset($this->properties[$this->primaryKey])) { $this->exists = false; return static::deleteOne($this->client, $this->{$this->primaryKey}); } throw new IdMissingException(); }
php
public function remove() { if (isset($this->properties[$this->primaryKey])) { $this->exists = false; return static::deleteOne($this->client, $this->{$this->primaryKey}); } throw new IdMissingException(); }
[ "public", "function", "remove", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "properties", "[", "$", "this", "->", "primaryKey", "]", ")", ")", "{", "$", "this", "->", "exists", "=", "false", ";", "return", "static", "::", "deleteOne", ...
Removes current instance entity if it has an id property @return mixed @throws IdMissingException @throws InvalidRequestException
[ "Removes", "current", "instance", "entity", "if", "it", "has", "an", "id", "property" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L340-L348
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.one
public static function one(PDFfiller $provider, $id) { $params = static::query($provider, $id); $instance = new static($provider, array_merge($params, ['exists' => true])); $instance->cacheFields($params); return $instance; }
php
public static function one(PDFfiller $provider, $id) { $params = static::query($provider, $id); $instance = new static($provider, array_merge($params, ['exists' => true])); $instance->cacheFields($params); return $instance; }
[ "public", "static", "function", "one", "(", "PDFfiller", "$", "provider", ",", "$", "id", ")", "{", "$", "params", "=", "static", "::", "query", "(", "$", "provider", ",", "$", "id", ")", ";", "$", "instance", "=", "new", "static", "(", "$", "provi...
Returns model instance @param PDFfiller $provider @param $id @return static @throws InvalidQueryException @throws InvalidRequestException @throws \ReflectionException
[ "Returns", "model", "instance" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L373-L380
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.all
public static function all(PDFfiller $provider, array $queryParams = []) { $paramsArray = static::query($provider, null, $queryParams); $paramsArray['items'] = static::formItems($provider, $paramsArray); return new ModelsList($paramsArray); }
php
public static function all(PDFfiller $provider, array $queryParams = []) { $paramsArray = static::query($provider, null, $queryParams); $paramsArray['items'] = static::formItems($provider, $paramsArray); return new ModelsList($paramsArray); }
[ "public", "static", "function", "all", "(", "PDFfiller", "$", "provider", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "paramsArray", "=", "static", "::", "query", "(", "$", "provider", ",", "null", ",", "$", "queryParams", ")", ";",...
Returns a list of entities @param PDFfiller $provider @param array $queryParams @return ModelsList @throws InvalidQueryException @throws InvalidRequestException @throws \ReflectionException
[ "Returns", "a", "list", "of", "entities" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L391-L397
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.formItems
protected static function formItems($provider, $array) { $set = []; foreach ($array['items'] as $params) { $instance = new static($provider, array_merge($params, ['exists' => true])); $instance->cacheFields($params); if (isset($instance->id)) { $set[$instance->id] = $instance; } else { $set[] = $instance; } } return $set; }
php
protected static function formItems($provider, $array) { $set = []; foreach ($array['items'] as $params) { $instance = new static($provider, array_merge($params, ['exists' => true])); $instance->cacheFields($params); if (isset($instance->id)) { $set[$instance->id] = $instance; } else { $set[] = $instance; } } return $set; }
[ "protected", "static", "function", "formItems", "(", "$", "provider", ",", "$", "array", ")", "{", "$", "set", "=", "[", "]", ";", "foreach", "(", "$", "array", "[", "'items'", "]", "as", "$", "params", ")", "{", "$", "instance", "=", "new", "stati...
Unwrap the instances from response @param $provider @param $array @return array @throws \ReflectionException
[ "Unwrap", "the", "instances", "from", "response" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L406-L421
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.findDiff
private function findDiff($new) { $old = $this->oldValues; $diff = []; foreach ($new as $key => $value) { if (!isset($old[$key]) || $old[$key] !== $new[$key]) { $diff[$key] = $value; } } return $diff; }
php
private function findDiff($new) { $old = $this->oldValues; $diff = []; foreach ($new as $key => $value) { if (!isset($old[$key]) || $old[$key] !== $new[$key]) { $diff[$key] = $value; } } return $diff; }
[ "private", "function", "findDiff", "(", "$", "new", ")", "{", "$", "old", "=", "$", "this", "->", "oldValues", ";", "$", "diff", "=", "[", "]", ";", "foreach", "(", "$", "new", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "!", "...
Find changed properties @param array $new new values @return array all new or changed values
[ "Find", "changed", "properties" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L472-L484
train
pdffiller/pdffiller-php-api-client
src/Core/Model.php
Model.snakeToCamelCase
protected function snakeToCamelCase($string, $smallFirst = false) { $parts = explode('_', $string); array_walk($parts, function(&$element) { $element = ucfirst($element); }); $result = implode('', $parts); return $smallFirst ? lcfirst($result) : $result; }
php
protected function snakeToCamelCase($string, $smallFirst = false) { $parts = explode('_', $string); array_walk($parts, function(&$element) { $element = ucfirst($element); }); $result = implode('', $parts); return $smallFirst ? lcfirst($result) : $result; }
[ "protected", "function", "snakeToCamelCase", "(", "$", "string", ",", "$", "smallFirst", "=", "false", ")", "{", "$", "parts", "=", "explode", "(", "'_'", ",", "$", "string", ")", ";", "array_walk", "(", "$", "parts", ",", "function", "(", "&", "$", ...
Converts snake_cased string to camelCase @param string $string @param bool $smallFirst @return string
[ "Converts", "snake_cased", "string", "to", "camelCase" ]
162729d6084a8a508a2283831ddc53a29a978199
https://github.com/pdffiller/pdffiller-php-api-client/blob/162729d6084a8a508a2283831ddc53a29a978199/src/Core/Model.php#L526-L537
train