idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
225,700 | public function instruct ( ) { foreach ( $ this -> files as $ file ) { Logger :: getInstance ( ) -> info ( 'Parse: ' . $ file ) ; try { $ root = \ ast \ parse_file ( $ file , Config :: AST_VERSION ) ; $ this -> annotations = Annotation :: create ( $ file , file_get_contents ( $ file ) ) ; if ( $ root instanceof Node ) ... | Tell you about PHP hints . |
225,701 | private function traverse ( string $ file , Node $ node ) { Logger :: getInstance ( ) -> debug ( 'Traverse: ' . \ ast \ get_kind_name ( $ node -> kind ) ) ; foreach ( $ this -> tools as $ tool ) { Logger :: getInstance ( ) -> debug ( 'Entrypoint check: ' . get_class ( $ tool ) ) ; if ( $ tool :: ENTRY_POINT !== $ node ... | Traverse AST nodes with DFS and check the entrypoint of tools . |
225,702 | public function run ( string $ file , Node $ node ) : array { $ hints = [ ] ; $ keys = [ ] ; foreach ( $ node -> children as $ elem ) { if ( is_null ( $ elem ) ) { continue ; } $ key = $ elem -> children [ 'key' ] ; if ( ! is_null ( $ key ) ) { foreach ( $ keys as $ other_key ) { if ( $ this -> isEqualsWithoutLineno ( ... | Detect duplicate numbers strings node key |
225,703 | public function print ( ) { if ( count ( $ this -> hints ) === 0 ) { $ this -> output -> writeln ( '<fg=black;bg=green>Awesome! There is nothing from me to teach you!</>' ) ; $ this -> output -> write ( "\n" ) ; } else { foreach ( $ this -> hints as $ hint ) { $ this -> output -> writeln ( '<info>' . $ hint -> filename... | Print hints to the console throught output interface of symfony console . |
225,704 | private function shouldCheckOption ( $ node ) : Bool { if ( ! $ node instanceof Node ) { return true ; } if ( $ node -> kind === \ ast \ AST_CONST ) { return true ; } if ( $ node -> kind === \ ast \ AST_BINARY_OP && $ node -> flags === \ ast \ flags \ BINARY_BITWISE_OR ) { return true ; } return false ; } | Check whether the passed options node should be checked . |
225,705 | private function isIncludeJSONThrowOnErrorOption ( $ node ) : Bool { if ( ! $ node instanceof Node ) { return false ; } if ( $ node -> kind === \ ast \ AST_CONST ) { $ name = $ node -> children [ "name" ] ; if ( $ name -> kind === \ ast \ AST_NAME && $ name -> children [ "name" ] === "JSON_THROW_ON_ERROR" ) { return tr... | Check whether the passed node has JSON_THROW_ON_ERROR |
225,706 | public function run ( string $ file , Node $ node ) : array { if ( $ this -> inspectedFile === $ file ) { return [ ] ; } $ found = false ; foreach ( $ node -> children as $ child ) { if ( ! $ child instanceof Node ) { continue ; } if ( $ child -> kind !== \ ast \ AST_DECLARE ) { continue ; } $ declares = $ child -> chi... | Check whether the passed node has strict_types declaration . |
225,707 | public function run ( string $ file , Node $ node ) : array { if ( $ node -> flags !== \ ast \ flags \ ARRAY_SYNTAX_LONG ) { Logger :: getInstance ( ) -> debug ( 'Ignore flags: ' . $ node -> flags ) ; return [ ] ; } return [ new Hint ( self :: HINT_TYPE , self :: HINT_MESSAGE , $ file , $ node -> lineno , self :: HINT_... | Detect ARRAY_SYNTAX_LONG node . |
225,708 | public function registerConfirm ( \ Swift_Mailer $ mailer , EventDispatcherInterface $ dispatcher , TranslatorInterface $ translator , $ token ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ user = $ em -> getRepository ( $ this -> getParameter ( 'pd_user.user_class' ) ) -> findOneBy ( [ 'confirmationToken' ... | Registration Confirm Token . |
225,709 | public function resetting ( Request $ request , EventDispatcherInterface $ dispatcher , \ Swift_Mailer $ mailer , TranslatorInterface $ translator ) { if ( $ this -> checkAuth ( ) ) { return $ this -> redirectToRoute ( $ this -> getParameter ( 'pd_user.login_redirect' ) ) ; } $ form = $ this -> createForm ( $ this -> g... | Resetting Request . |
225,710 | public function resettingPassword ( Request $ request , UserPasswordEncoderInterface $ encoder , EventDispatcherInterface $ dispatcher , \ Swift_Mailer $ mailer , TranslatorInterface $ translator , $ token ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ user = $ em -> getRepository ( $ this -> getParameter (... | Reset Password Form . |
225,711 | private function sendEmail ( UserInterface $ user , \ Swift_Mailer $ mailer , $ subject , $ body , $ templateId ) { if ( \ is_array ( $ body ) ) { $ body [ 'email' ] = $ user -> getEmail ( ) ; $ body [ 'fullname' ] = $ user -> getProfile ( ) -> getFullName ( ) ; } else { $ body = [ 'email' => $ user -> getEmail ( ) , '... | Send Mail . |
225,712 | public function isActive ( ) { if ( $ this -> _isActive === null ) { $ this -> _isActive = ( ( bool ) $ this -> getConfig ( ) -> getConfigParam ( 'blAmazonLoginActive' ) === true && ( string ) $ this -> getConfig ( ) -> getConfigParam ( 'sAmazonLoginClientId' ) !== '' && ( string ) $ this -> getConfig ( ) -> getConfigP... | Method checks if Amazon Login is active and can be used |
225,713 | public function createOxidUser ( $ oUserData ) { $ aFullName = explode ( ' ' , trim ( $ oUserData -> name ) ) ; $ sLastName = array_pop ( $ aFullName ) ; $ sFirstName = implode ( ' ' , $ aFullName ) ; $ oUser = $ this -> getObjectFactory ( ) -> createOxidObject ( 'oxUser' ) ; $ oUser -> assign ( array ( 'oxregister' =>... | Create new oxid user with details from Amazon |
225,714 | public function getAmazonLanguage ( ) { $ aLanguages = $ this -> getConfig ( ) -> getConfigParam ( 'aAmazonLanguages' ) ; $ sLanguageAbbr = $ this -> getLanguage ( ) -> getLanguageAbbr ( ) ; return isset ( $ aLanguages [ $ sLanguageAbbr ] ) ? $ aLanguages [ $ sLanguageAbbr ] : $ sLanguageAbbr ; } | Method returns language for Amazon GUI elements |
225,715 | public function getLangIdByAmazonLanguage ( $ sAmazonLanguageString ) { $ aLanguages = $ this -> getConfig ( ) -> getConfigParam ( 'aAmazonLanguages' ) ; $ sAbbreviation = array_search ( $ sAmazonLanguageString , $ aLanguages ) ; $ aAllLangIds = $ this -> getLanguage ( ) -> getAllShopLanguageIds ( ) ; return array_sear... | Returns Language Id by Amazon Language string |
225,716 | public function getOrderLanguageId ( oxOrder $ oOrder ) { $ oData = $ this -> getClient ( ) -> getOrderReferenceDetails ( $ oOrder , array ( ) , true ) ; if ( isset ( $ oData -> GetOrderReferenceDetailsResult -> OrderReferenceDetails -> OrderLanguage ) === false ) { return ( int ) $ oOrder -> getFieldData ( 'oxlang' ) ... | Returns Language ID to use for made order |
225,717 | protected static function _deactivateOldModule ( ) { $ sModule = self :: OLD_MODULE_ID ; $ oModule = self :: _getModule ( ) ; if ( $ oModule -> load ( $ sModule ) === false ) { self :: _getUtilsView ( ) -> addErrorToDisplay ( new oxException ( 'EXCEPTION_MODULE_NOT_LOADED' ) ) ; return false ; } try { $ oModuleCache = ... | Deactivates the old module . |
225,718 | protected static function _removeTempVersionNumberFromDatabase ( ) { $ oConfig = self :: _getConfig ( ) ; $ sModuleId = self :: _getDatabase ( ) -> quote ( self :: TMP_DB_ID ) ; $ sQuotedShopId = self :: _getDatabase ( ) -> quote ( $ oConfig -> getShopId ( ) ) ; $ sDeleteSql = "DELETE FROM `oxconfig` ... | Removes the temporary version number of the module from the database . |
225,719 | protected static function _executeSqlFile ( $ sFile ) { $ blSuccess = false ; $ sFileWithPath = dirname ( __FILE__ ) . '/../../../_db/' . $ sFile ; if ( file_exists ( $ sFileWithPath ) ) { $ sSqlFile = file_get_contents ( $ sFileWithPath ) ; $ aSqlRows = explode ( ';' , $ sSqlFile ) ; $ aSqlRows = array_map ( 'trim' , ... | Executes a sql file . |
225,720 | public static function onActivate ( ) { $ sSql = "SELECT COUNT(OXID) FROM oxpayments WHERE OXID IN ('jagamazon', 'bestitamazon')" ; $ iRes = self :: _getDatabase ( ) -> getOne ( $ sSql ) ; if ( $ iRes !== false && ( int ) $ iRes === 0 ) { self :: _executeSqlFile ( 'install.sql' ) ; $ oDbHandler = ... | Execute required sql statements . |
225,721 | public static function getCurrentVersion ( ) { $ aVersions = ( array ) self :: _getConfig ( ) -> getConfigParam ( 'aModuleVersions' ) ; $ aPossibleModuleNames = array ( 'jagAmazonPayment4Oxid' , 'bestitAmazonPay4Oxid' ) ; foreach ( $ aPossibleModuleNames as $ sPossibleModuleName ) { if ( isset ( $ aVersions [ $ sPossib... | Returns the current installed version . |
225,722 | public static function clearTmp ( ) { $ sTmpDir = self :: _getConfig ( ) -> getConfigParam ( 'sCompileDir' ) ; $ sTmpDir = rtrim ( $ sTmpDir , '/' ) . '/' ; $ sSmartyDir = $ sTmpDir . 'smarty/' ; foreach ( self :: _streamSafeGlob ( $ sTmpDir , '*.txt' ) as $ sFileName ) { unlink ( $ sFileName ) ; } foreach ( self :: _s... | Clear tmp dir and smarty cache . |
225,723 | protected function _getAmazonClient ( $ aConfig = array ( ) ) { if ( $ this -> _oAmazonClient === null ) { $ aConfig = array_merge ( $ aConfig , array ( 'merchant_id' => $ this -> getConfig ( ) -> getConfigParam ( 'sAmazonSellerId' ) , 'access_key' => $ this -> getConfig ( ) -> getConfigParam ( 'sAmazonAWSAccessKeyId' ... | Returns the amazon api client . |
225,724 | protected function _addSandboxSimulationParams ( $ sMethod , array & $ aParams ) { if ( ( bool ) $ this -> getConfig ( ) -> getConfigParam ( 'blAmazonSandboxActive' ) !== true || ( bool ) $ this -> getConfig ( ) -> getConfigParam ( 'sSandboxSimulation' ) === false ) { return ; } $ sSandboxSimulation = ( string ) $ this... | Amazon add sandbox simulation params |
225,725 | public function getAmazonProperty ( $ sPropertyName , $ blCommon = false ) { $ sSandboxPrefix = '' ; if ( $ blCommon === false && ( bool ) $ this -> getConfig ( ) -> getConfigParam ( 'blAmazonSandboxActive' ) === true ) { $ sSandboxPrefix = 'Sandbox' ; } $ sAmazonLocale = $ this -> getConfig ( ) -> getConfigParam ( 'sA... | Returns class property by given property name and other params |
225,726 | public function processOrderReference ( oxOrder $ oOrder , stdClass $ oOrderReference ) { $ sOrderReferenceStatus = $ oOrderReference -> OrderReferenceStatus -> State ; if ( $ sOrderReferenceStatus === 'Open' && ( string ) $ oOrder -> getFieldData ( 'oxtransstatus' ) === 'AMZ-Order-Suspended' ) { $ this -> authorize ( ... | Process order reference . |
225,727 | public function getOrderReferenceDetails ( $ oOrder = null , array $ aParams = array ( ) , $ blReadonly = false ) { $ aRequestParameters = array ( ) ; $ sAmazonOrderReferenceId = ( $ oOrder === null ) ? ( string ) $ this -> getSession ( ) -> getVariable ( 'amazonOrderReferenceId' ) : '' ; if ( $ oOrder !== null ) { $ a... | Amazon GetOrderReferenceDetails method |
225,728 | public function setOrderReferenceDetails ( $ oBasket = null , array $ aRequestParameters = array ( ) ) { $ aRequestParameters [ 'amazon_order_reference_id' ] = $ this -> getSession ( ) -> getVariable ( 'amazonOrderReferenceId' ) ; if ( $ oBasket !== null ) { $ oActiveShop = $ this -> getConfig ( ) -> getActiveShop ( ) ... | Amazon SetOrderReferenceDetails method |
225,729 | public function confirmOrderReference ( array $ aRequestParameters = array ( ) ) { $ aRequestParameters [ 'amazon_order_reference_id' ] = $ this -> getSession ( ) -> getVariable ( 'amazonOrderReferenceId' ) ; return $ this -> _convertResponse ( $ this -> _getAmazonClient ( ) -> confirmOrderReference ( $ aRequestParamet... | Amazon ConfirmOrderReference method |
225,730 | protected function _setOrderTransactionErrorStatus ( oxOrder $ oOrder , stdClass $ oData , $ sStatus = null ) { if ( isset ( $ oData -> Error -> Code ) && ( bool ) $ oData -> Error -> Code !== false ) { if ( $ sStatus === null ) { $ sStatus = 'AMZ-Error-' . $ oData -> Error -> Code ; } $ oOrder -> assign ( array ( 'oxt... | Sets the order status |
225,731 | public function closeOrderReference ( $ oOrder = null , $ aRequestParameters = array ( ) , $ blUpdateOrderStatus = true ) { $ oData = $ this -> _callOrderRequest ( 'closeOrderReference' , $ oOrder , $ aRequestParameters , array ( 'amazon_order_reference_id' ) , $ blProcessable , 'AMZ-Order-Closed' ) ; if ( $ blUpdateOr... | Amazon CloseOrderReference method |
225,732 | public function authorize ( $ oOrder = null , $ aRequestParameters = array ( ) , $ blForceSync = false ) { $ sMode = $ this -> getConfig ( ) -> getConfigParam ( 'sAmazonMode' ) ; $ aRequestParameters [ 'transaction_timeout' ] = ( $ sMode === bestitAmazonPay4OxidClient :: BASIC_FLOW || $ blForceSync ) ? 0 : 1440 ; $ oDa... | Amazon Authorize method |
225,733 | public function processAuthorization ( oxOrder $ oOrder , stdClass $ oAuthorizationDetails ) { $ oAuthorizationStatus = $ oAuthorizationDetails -> AuthorizationStatus ; $ oOrder -> assign ( array ( 'oxtransstatus' => 'AMZ-Authorize-' . $ oAuthorizationStatus -> State ) ) ; $ oOrder -> save ( ) ; if ( $ oAuthorizationSt... | Processes the authorization |
225,734 | public function getAuthorizationDetails ( $ oOrder = null , array $ aRequestParameters = array ( ) ) { $ oData = $ this -> _callOrderRequest ( 'getAuthorizationDetails' , $ oOrder , $ aRequestParameters , array ( 'amazon_authorization_id' ) , $ blProcessable ) ; if ( $ blProcessable === true && isset ( $ oData -> GetAu... | Amazon GetAuthorizationDetails method |
225,735 | public function capture ( $ oOrder = null , $ aRequestParameters = array ( ) ) { $ oData = $ this -> _callOrderRequest ( 'capture' , $ oOrder , $ aRequestParameters , array ( 'amazon_authorization_id' , 'capture_amount' , 'currency_code' , 'capture_reference_id' , 'seller_capture_note' ) , $ blProcessable ) ; if ( $ bl... | Amazon Capture method |
225,736 | public function getCaptureDetails ( $ oOrder = null , $ aRequestParameters = array ( ) ) { $ oData = $ this -> _callOrderRequest ( 'getCaptureDetails' , $ oOrder , $ aRequestParameters , array ( 'amazon_capture_id' ) , $ blProcessable ) ; if ( $ blProcessable === true && isset ( $ oData -> GetCaptureDetailsResult -> Ca... | Amazon GetCaptureDetails method |
225,737 | public function saveCapture ( $ oOrder = null ) { if ( ( string ) $ oOrder -> getFieldData ( 'bestitAmazonCaptureId' ) !== '' ) { return $ this -> getCaptureDetails ( $ oOrder ) ; } elseif ( ( string ) $ oOrder -> getFieldData ( 'bestitAmazonAuthorizationId' ) !== '' ) { return $ this -> capture ( $ oOrder ) ; } return... | Save capture call . |
225,738 | public function refund ( $ oOrder = null , $ fPrice , $ aRequestParameters = array ( ) ) { if ( $ oOrder !== null ) { $ aRequestParameters [ 'refund_amount' ] = $ fPrice ; $ this -> _mapOrderToRequestParameters ( $ oOrder , $ aRequestParameters , array ( 'amazon_capture_id' , 'currency_code' , 'refund_reference_id' , '... | Amazon Refund method |
225,739 | public function getRefundDetails ( $ sAmazonRefundId ) { $ aRequestParameters [ 'amazon_refund_id' ] = $ sAmazonRefundId ; $ oData = $ this -> _convertResponse ( $ this -> _getAmazonClient ( ) -> getRefundDetails ( $ aRequestParameters ) ) ; if ( ( array ) $ oData !== array ( ) ) { $ sError = '' ; if ( isset ( $ oData ... | Amazon GetRefundDetails method |
225,740 | public function setOrderAttributes ( oxOrder $ oOrder , array $ aRequestParameters = array ( ) ) { $ this -> _mapOrderToRequestParameters ( $ oOrder , $ aRequestParameters , array ( 'amazon_order_reference_id' , 'seller_order_id' ) ) ; return $ this -> _getAmazonClient ( ) -> setOrderAttributes ( $ aRequestParameters )... | Sets the order attributes . |
225,741 | public function render ( ) { $ sOrderReferenceId = $ this -> _getContainer ( ) -> getConfig ( ) -> getRequestParameter ( 'amazonOrderReferenceId' ) ; if ( $ sOrderReferenceId ) { $ this -> _getContainer ( ) -> getSession ( ) -> setVariable ( 'amazonOrderReferenceId' , $ sOrderReferenceId ) ; } return parent :: render (... | Set Amazon reference ID to session |
225,742 | protected function _parseSingleAddress ( $ sString , $ sIsoCountryCode = null ) { $ aStreetNoStreetCountries = $ this -> getConfig ( ) -> getConfigParam ( 'aAmazonStreetNoStreetCountries' ) ; if ( in_array ( $ sIsoCountryCode , $ aStreetNoStreetCountries ) ) { preg_match ( '/\s*(?P<Number>\d[^\s]*)*\s*(?P<Name>[^\d]*[^... | Returns parsed Street name and Street number in array |
225,743 | protected function _parseAddressFields ( $ oAmazonData , array & $ aResult ) { $ aAmazonAddresses = array ( 1 => is_string ( $ oAmazonData -> AddressLine1 ) ? trim ( $ oAmazonData -> AddressLine1 ) : '' , 2 => is_string ( $ oAmazonData -> AddressLine2 ) ? trim ( $ oAmazonData -> AddressLine2 ) : '' , 3 => is_string ( $... | Parses the amazon address fields . |
225,744 | public function parseAmazonAddress ( $ oAmazonData ) { $ aResult = ( array ) $ oAmazonData ; $ aFullName = explode ( ' ' , trim ( $ oAmazonData -> Name ) ) ; $ aResult [ 'LastName' ] = array_pop ( $ aFullName ) ; $ aResult [ 'FirstName' ] = implode ( ' ' , $ aFullName ) ; $ sTable = getViewName ( 'oxcountry' ) ; $ oAma... | Returns Parsed address from Amazon by specific rules |
225,745 | public function encodeString ( $ sString ) { if ( $ this -> getConfig ( ) -> isUtf ( ) === true ) { return $ sString ; } $ sShopEncoding = $ this -> getLanguage ( ) -> translateString ( 'charset' ) ; return iconv ( 'UTF-8' , $ sShopEncoding , $ sString ) ; } | If shop is using non - Utf8 chars encode string according used encoding |
225,746 | public function getActiveUser ( ) { if ( $ this -> _oActiveUserObject === null ) { $ this -> _oActiveUserObject = false ; $ oUser = $ this -> getObjectFactory ( ) -> createOxidObject ( 'oxUser' ) ; if ( $ oUser -> loadActiveUser ( ) === true ) { $ this -> _oActiveUserObject = $ oUser ; } } return $ this -> _oActiveUser... | Returns the active user object . |
225,747 | public function getConfig ( ) { if ( $ this -> _oConfigObject === null ) { $ this -> _oConfigObject = oxRegistry :: getConfig ( ) ; } return $ this -> _oConfigObject ; } | Returns the config object . |
225,748 | public function getDatabase ( ) { if ( $ this -> _oDatabaseObject === null ) { $ this -> _oDatabaseObject = oxDb :: getDb ( oxDb :: FETCH_MODE_ASSOC ) ; } return $ this -> _oDatabaseObject ; } | Returns the database object . |
225,749 | public function getIpnHandler ( ) { if ( $ this -> _oIpnHandlerObject === null ) { $ this -> _oIpnHandlerObject = oxRegistry :: get ( 'bestitAmazonPay4OxidIpnHandler' ) ; } return $ this -> _oIpnHandlerObject ; } | Returns the ipn handler object . |
225,750 | public function getLanguage ( ) { if ( $ this -> _oLanguageObject === null ) { $ this -> _oLanguageObject = oxRegistry :: getLang ( ) ; } return $ this -> _oLanguageObject ; } | Returns the language object . |
225,751 | public function getSession ( ) { if ( $ this -> _oSessionObject === null ) { $ this -> _oSessionObject = oxRegistry :: getSession ( ) ; } return $ this -> _oSessionObject ; } | Returns the session object . |
225,752 | public function setPrimaryAmazonUserData ( ) { $ oUtils = $ this -> _getContainer ( ) -> getUtils ( ) ; $ sShopSecureHomeUrl = $ this -> _getContainer ( ) -> getConfig ( ) -> getShopSecureHomeUrl ( ) ; $ oData = $ this -> _getContainer ( ) -> getClient ( ) -> getOrderReferenceDetails ( ) ; $ oOrderReferenceDetail = iss... | Get s primary user details and logins user if one is not logged in Add s new address if user is logged in . |
225,753 | public function validatePayment ( ) { $ oSession = $ this -> _getContainer ( ) -> getSession ( ) ; $ oConfig = $ this -> _getContainer ( ) -> getConfig ( ) ; if ( ( string ) $ oSession -> getVariable ( 'amazonOrderReferenceId' ) === '' || ( string ) $ oConfig -> getRequestParameter ( 'paymentid' ) !== 'bestitamazon' ) ... | Set s order remark to session |
225,754 | protected function _addToMessages ( $ sText ) { $ aViewData = $ this -> getViewData ( ) ; $ aViewData [ 'sMessage' ] = isset ( $ aViewData [ 'sMessage' ] ) ? $ aViewData [ 'sMessage' ] . $ sText : $ sText ; $ this -> setViewData ( $ aViewData ) ; } | Adds the text to the message . |
225,755 | protected function _processOrderStates ( $ sQuery , $ sClientFunction ) { $ aResponses = array ( ) ; $ aResult = $ this -> _getContainer ( ) -> getDatabase ( ) -> getAll ( $ sQuery ) ; foreach ( $ aResult as $ aRow ) { $ oOrder = $ this -> _getContainer ( ) -> getObjectFactory ( ) -> createOxidObject ( 'oxOrder' ) ; if... | Processes the order states . |
225,756 | protected function _updateAuthorizedOrders ( ) { $ aProcessed = $ this -> _processOrderStates ( "SELECT OXID, OXORDERNR FROM oxorder WHERE BESTITAMAZONORDERREFERENCEID != '' AND BESTITAMAZONAUTHORIZATIONID != '' AND OXTRANSSTATUS = 'AMZ-Authorize-Pending'" , 'getAuthorizationDetails... | Authorize unauthorized orders or orders with pending status |
225,757 | protected function _captureOrders ( ) { $ sSQLAddShippedCase = '' ; if ( ( string ) $ this -> _getContainer ( ) -> getConfig ( ) -> getConfigParam ( 'sAmazonCapture' ) === 'SHIPPED' ) { $ sSQLAddShippedCase = ' AND OXSENDDATE > 0' ; } $ aProcessed = $ this -> _processOrderStates ( "SELECT OXID, OXORDERNR FRO... | Capture orders with Authorize status = open |
225,758 | protected function _updateRefundDetails ( ) { $ sQuery = "SELECT BESTITAMAZONREFUNDID FROM bestitamazonrefunds WHERE STATE = 'Pending' AND BESTITAMAZONREFUNDID != ''" ; $ aResult = $ this -> _getContainer ( ) -> getDatabase ( ) -> getAll ( $ sQuery ) ; foreach ( $ aResult as $ aRow ) ... | Check and update refund details for made refunds |
225,759 | public function render ( ) { set_time_limit ( 3600 ) ; if ( ( bool ) $ this -> _getContainer ( ) -> getConfig ( ) -> getConfigParam ( 'blAmazonERP' ) === true ) { $ this -> setViewData ( array ( 'sError' => 'ERP mode is ON (Module settings)' ) ) ; } elseif ( ( string ) $ this -> _getContainer ( ) -> getConfig ( ) -> ge... | The render function |
225,760 | protected function _getOperationName ( ) { $ operation = lcfirst ( $ this -> _getContainer ( ) -> getConfig ( ) -> getRequestParameter ( 'operation' ) ) ; if ( method_exists ( $ this -> _getContainer ( ) -> getClient ( ) , $ operation ) ) { return $ operation ; } $ this -> setViewData ( array ( 'sError' => "Operation '... | Method returns Operation name |
225,761 | protected function _getOrder ( ) { $ sOrderId = $ this -> _getContainer ( ) -> getConfig ( ) -> getRequestParameter ( 'oxid' ) ; if ( $ sOrderId !== null ) { $ oOrder = $ this -> _getContainer ( ) -> getObjectFactory ( ) -> createOxidObject ( 'oxOrder' ) ; if ( $ oOrder -> load ( $ sOrderId ) === true ) { return $ oOrd... | Method returns Order object |
225,762 | protected function _getParams ( ) { $ aResult = array ( ) ; $ aParams = ( array ) $ this -> _getContainer ( ) -> getConfig ( ) -> getRequestParameter ( 'aParams' ) ; foreach ( $ aParams as $ sKey => $ sValue ) { $ aResult [ html_entity_decode ( $ sKey ) ] = html_entity_decode ( $ sValue ) ; } return $ aResult ; } | Method returns Parameters from GET aParam array |
225,763 | public function amazonCall ( ) { $ sOperation = $ this -> _getOperationName ( ) ; if ( $ sOperation !== false ) { $ oResult = $ this -> _getContainer ( ) -> getClient ( ) -> { $ sOperation } ( $ this -> _getOrder ( ) , $ this -> _getParams ( ) ) ; $ this -> _addToMessages ( '<pre>' . print_r ( $ oResult , true ) . '</p... | Makes request to Amazon methods |
225,764 | public function render ( ) { if ( $ this -> _getContainer ( ) -> getConfig ( ) -> getConfigParam ( 'blAmazonERP' ) === true ) { return $ this -> _processError ( 'IPN response handling disabled - ERP mode is ON (Module settings)' ) ; } if ( $ this -> _getContainer ( ) -> getConfig ( ) -> getConfigParam ( 'sAmazonAuthori... | The controller entry point . |
225,765 | public function getIsSelectedCurrencyAvailable ( ) { $ oConfig = $ this -> getConfig ( ) ; $ blEnableMultiCurrency = ( bool ) $ oConfig -> getConfigParam ( 'blBestitAmazonPay4OxidEnableMultiCurrency' ) ; if ( $ blEnableMultiCurrency === true ) { return true ; } if ( $ this -> _isSelectedCurrencyAvailable === null ) { $... | Returns true if currency meets locale |
225,766 | public function isActive ( ) { if ( $ this -> _blActive !== null ) { return $ this -> _blActive ; } $ sTable = getViewName ( 'oxpayments' ) ; $ sSql = "SELECT OXACTIVE FROM {$sTable} WHERE OXID = 'bestitamazon'" ; $ blPaymentActive = ( bool ) $ this -> getDatabase ( ) -> getOne ( $ sSql ) ; if ( $... | Method checks if Amazon Pay is active and can be used |
225,767 | public function cleanUpUnusedAccounts ( ) { $ sTable = getViewName ( 'oxuser' ) ; $ sSql = "SELECT oxid, oxusername FROM {$sTable} WHERE oxusername LIKE '%-%-%@amazon.com' AND oxcreate < (NOW() - INTERVAL 1440 MINUTE)" ; $ aData = $ this -> getDatabase ( ) -> getAll ( $ sSql ) ; forea... | Deletes previously created user accounts which was not used |
225,768 | protected function _manageFullUserData ( $ oUser , $ oAmazonData ) { $ oContainer = $ this -> _getContainer ( ) ; $ oSession = $ oContainer -> getSession ( ) ; $ oConfig = $ oContainer -> getConfig ( ) ; $ aParsedData = $ oContainer -> getAddressUtil ( ) -> parseAmazonAddress ( $ oAmazonData -> Destination -> PhysicalD... | Manages received user data from Amazon |
225,769 | protected function _callSyncAmazonAuthorize ( $ oBasket , $ sAmazonOrderReferenceId , $ blOptimizedFlow ) { $ oContainer = $ this -> _getContainer ( ) ; $ oSession = $ oContainer -> getSession ( ) ; $ oUtils = $ oContainer -> getUtils ( ) ; $ oConfig = $ oContainer -> getConfig ( ) ; $ aParams = array ( 'amazon_order_r... | Calls Authorize method in Amazon depending on settings |
225,770 | protected function _performAmazonActions ( $ blAuthorizeAsync ) { $ oContainer = $ this -> _getContainer ( ) ; $ oSession = $ oContainer -> getSession ( ) ; $ oConfig = $ oContainer -> getConfig ( ) ; $ this -> _setFieldData ( 'bestitamazonorderreferenceid' , $ oSession -> getVariable ( 'amazonOrderReferenceId' ) ) ; $... | Async Authorize call and data update |
225,771 | public function finalizeOrder ( Basket $ oBasket , $ oUser , $ blRecalculatingOrder = false ) { if ( $ this -> _preFinalizeOrder ( $ oBasket , $ oUser , $ blIsAmazonOrder , $ blAuthorizeAsync ) === false ) { return oxOrder :: ORDER_STATE_PAYMENTERROR ; } $ iRet = $ this -> _parentFinalizeOrder ( $ oBasket , $ oUser , $... | Confirm Order details to Amazon if payment id is bestitamazon and amazonreferenceid exists Update user details with the full details received from amazon |
225,772 | public function validateDeliveryAddress ( $ oUser ) { $ oBasket = $ this -> _getContainer ( ) -> getSession ( ) -> getBasket ( ) ; if ( $ oBasket && ( string ) $ oBasket -> getPaymentId ( ) === 'bestitamazon' ) { return 0 ; } else { return parent :: validateDeliveryAddress ( $ oUser ) ; } } | Skips delivery address validation when payment == bestitamazon |
225,773 | public function getAmazonChangePaymentLink ( ) { $ oClient = $ this -> _getContainer ( ) -> getClient ( ) ; $ sLink = $ oClient -> getAmazonProperty ( 'sAmazonPayChangeLink' , true ) ; $ oData = $ oClient -> getOrderReferenceDetails ( $ this , array ( ) , true ) ; if ( ! empty ( $ oData -> GetOrderReferenceDetailsResul... | Method returns payment method change link for Invalid payment method order |
225,774 | public function refundAmazonOrder ( ) { $ oConfig = $ this -> _getContainer ( ) -> getConfig ( ) ; $ sId = $ this -> getEditObjectId ( ) ; if ( ( int ) $ sId !== - 1 && $ sId !== null && ( int ) $ oConfig -> getRequestParameter ( 'blAmazonConfirmRefund' ) === 1 ) { $ oOrder = $ this -> _getContainer ( ) -> getObjectFac... | Sends refund request to Amazon |
225,775 | public function getRefundsStatus ( ) { $ sId = $ this -> getEditObjectId ( ) ; if ( ( int ) $ sId !== - 1 && $ sId !== null ) { $ oDb = $ this -> _getContainer ( ) -> getDatabase ( ) ; $ sSql = "SELECT BESTITAMAZONREFUNDID FROM bestitamazonrefunds WHERE STATE = 'Pending' A... | Gets refunds status for the order |
225,776 | public function setQuickCheckoutBasket ( ) { $ oObjectFactory = $ this -> getObjectFactory ( ) ; $ oSession = $ this -> getSession ( ) ; $ oCurrentBasket = $ oSession -> getBasket ( ) ; $ oSession -> setVariable ( self :: BESTITAMAZONPAY_TEMP_BASKET , serialize ( $ oCurrentBasket ) ) ; $ oSession -> setBasket ( $ oObje... | Stores the basket which is present before the quick checkout . |
225,777 | protected function _validateBasket ( $ oBasket ) { $ aCurrentContent = $ oBasket -> getContents ( ) ; $ iCurrLang = $ this -> getLanguage ( ) -> getBaseLanguage ( ) ; foreach ( $ aCurrentContent as $ oContent ) { if ( $ oContent -> getLanguageId ( ) !== $ iCurrLang ) { $ oContent -> setLanguageId ( $ iCurrLang ) ; } } ... | Validates the basket . |
225,778 | public function restoreQuickCheckoutBasket ( ) { $ oSession = $ this -> getSession ( ) ; $ sBasket = $ oSession -> getVariable ( self :: BESTITAMAZONPAY_TEMP_BASKET ) ; if ( $ sBasket !== null ) { $ this -> getObjectFactory ( ) -> createOxidObject ( 'oxBasketItem' ) ; $ oBasket = unserialize ( $ sBasket ) ; $ this -> _... | Restores the basket which was present before the quick checkout . |
225,779 | public function getBasketHash ( $ sAmazonOrderReferenceId , $ oBasket ) { $ aBasket = array ( 'amazonOrderReferenceId' => $ sAmazonOrderReferenceId , 'totalSum' => $ oBasket -> getBruttoSum ( ) , 'contents' => array ( ) ) ; foreach ( $ oBasket -> getContents ( ) as $ oBasketItem ) { $ sId = $ oBasketItem -> getArticle ... | Generates the basket hash . |
225,780 | public function saveConfVars ( ) { $ sModuleId = $ this -> getEditObjectId ( ) ; if ( $ sModuleId === 'bestitamazonpay4oxid' ) { $ sQuickConfig = $ this -> _getContainer ( ) -> getConfig ( ) -> getRequestParameter ( 'bestitAmazonPay4OxidQuickConfig' ) ; try { $ aQuickConfig = json_decode ( $ sQuickConfig , true ) ; $ a... | Extends the save config variable function to store the amazon config vars from the provided config json object . |
225,781 | protected function _getShippingAvailableForPayment ( $ sShipSet ) { $ oDatabase = $ this -> _getContainer ( ) -> getDatabase ( ) ; $ sSql = "SELECT OXOBJECTID FROM oxobject2payment WHERE OXOBJECTID = {$oDatabase->quote($sShipSet)} AND OXPAYMENTID = {$oDatabase->quote('bestitamazon')... | Returns if Amazon pay is assigned available shipping ways |
225,782 | protected function _processResult ( $ aResult , $ oUser , $ oBasket ) { $ oConfig = $ this -> _getContainer ( ) -> getConfig ( ) ; $ sClass = $ oConfig -> getRequestParameter ( 'cl' ) ; $ sAmazonOrderReferenceId = $ this -> _getContainer ( ) -> getSession ( ) -> getVariable ( 'amazonOrderReferenceId' ) ; if ( $ sClass ... | If Amazon pay was selected remove other payment options and leave only Amazon pay If Amazon pay was selected remove shipping options where amazon pay is not assigned |
225,783 | public function getDeliverySetData ( $ sShipSet , $ oUser , $ oBasket ) { $ aResult = parent :: getDeliverySetData ( $ sShipSet , $ oUser , $ oBasket ) ; return $ this -> _processResult ( $ aResult , $ oUser , $ oBasket ) ; } | Returns the delivery set data . |
225,784 | public function wordPressSalts ( ) : array { $ generator = new Generator ( new Factory ) ; $ salts [ 'AUTH_KEY' ] = $ generator -> salt ( ) ; $ salts [ 'SECURE_AUTH_KEY' ] = $ generator -> salt ( ) ; $ salts [ 'LOGGED_IN_KEY' ] = $ generator -> salt ( ) ; $ salts [ 'NONCE_KEY' ] = $ generator -> salt ( ) ; $ salts [ 'A... | Generate and return all the WordPress salts as an array . |
225,785 | public function traditional ( ) : string { $ salts = $ this -> wordPressSalts ( ) ; return array_reduce ( array_keys ( $ salts ) , function ( $ saltsString , $ key ) use ( $ salts ) { $ saltsString .= "define('$key', '$salts[$key]');" . PHP_EOL ; return $ saltsString ; } , '' ) ; } | Gets an array of WordPress salts and then reduces them to a string for output to the CLI . Returns them in the traditional WordPress define format used in wp - config . php files . |
225,786 | public function sendorder ( ) { parent :: sendorder ( ) ; $ oOrder = $ this -> _getContainer ( ) -> getObjectFactory ( ) -> createOxidObject ( 'oxOrder' ) ; if ( $ oOrder -> load ( $ this -> getEditObjectId ( ) ) === true && $ oOrder -> getFieldData ( 'oxPaymentType' ) === 'bestitamazon' ) { $ this -> _getContainer ( )... | Capture order after changing it to shipped |
225,787 | public function cleanAmazonPay ( $ cancelOrderReference = false ) { $ oConfig = $ this -> _getContainer ( ) -> getConfig ( ) ; if ( $ cancelOrderReference === true || ( bool ) $ oConfig -> getRequestParameter ( 'cancelOrderReference' ) ) { $ this -> _getContainer ( ) -> getClient ( ) -> cancelOrderReference ( null , ar... | Cleans Amazon pay as the selected one including all related variables and values |
225,788 | public function render ( ) { $ sClass = $ this -> _getContainer ( ) -> getConfig ( ) -> getRequestParameter ( 'cl' ) ; if ( $ sClass !== 'order' && $ sClass !== 'thankyou' && ( bool ) $ this -> _getContainer ( ) -> getSession ( ) -> getVariable ( 'blAmazonSyncChangePayment' ) === true ) { $ this -> cleanAmazonPay ( tru... | Clears amazon pay variables . |
225,789 | protected function _parentToBasket ( $ sProductId = null , $ dAmount = null , $ aSelectList = null , $ aPersistentParameters = null , $ blOverride = false ) { return parent :: tobasket ( $ sProductId , $ dAmount , $ aSelectList , $ aPersistentParameters , $ blOverride ) ; } | Parent function wrapper . |
225,790 | public function tobasket ( $ sProductId = null , $ dAmount = null , $ aSelectList = null , $ aPersistentParameters = null , $ blOverride = false ) { $ oContainer = $ this -> _getContainer ( ) ; $ oConfig = $ oContainer -> getConfig ( ) ; $ isAmazonPay = ( bool ) $ oConfig -> getRequestParameter ( 'bestitAmazonPayIsAmaz... | Check if we are using amazon quick checkout . |
225,791 | public function getSelfLink ( ) { try { if ( ( bool ) $ this -> _getContainer ( ) -> getConfig ( ) -> getConfigParam ( 'sSSLShopURL' ) === true && ! $ this -> isAdmin ( ) && $ this -> getAmazonLoginIsActive ( ) ) { return $ this -> getSslSelfLink ( ) ; } } catch ( Exception $ oException ) { } return parent :: getSelfLi... | Forces to return shop self link if Amazon Login is active and we already have ORO Method is dedicated to stay always in checkout process under SSL |
225,792 | public function getBasketLink ( ) { if ( $ this -> getAmazonLoginIsActive ( ) === true ) { $ sValue = $ this -> getViewConfigParam ( 'basketlink' ) ; if ( ( string ) $ sValue === '' ) { $ sValue = $ this -> _getContainer ( ) -> getConfig ( ) -> getShopSecureHomeUrl ( ) . 'cl=basket' ; $ this -> setViewConfigParam ( 'ba... | Forces to return basket link if Amazon Login is active and we already have ORO in SSL |
225,793 | protected function _getInjectedCode ( ) { $ oUtils = $ this -> _getContainer ( ) -> getUtils ( ) ; $ aCodeInjected = $ oUtils -> fromStaticCache ( self :: CODE_INJECTED_STATIC_CACHE_KEY ) ; return $ aCodeInjected === null ? array ( ) : $ aCodeInjected ; } | Loads the injected code map from the static cache . |
225,794 | public function setJSCodeInjected ( $ sType ) { $ aCodeInjected = $ this -> _getInjectedCode ( ) ; $ aCodeInjected [ $ sType ] = true ; $ this -> _getContainer ( ) -> getUtils ( ) -> toStaticCache ( self :: CODE_INJECTED_STATIC_CACHE_KEY , $ aCodeInjected ) ; } | Marks the type as already injected . |
225,795 | public function wasJSCodeInjected ( $ sType ) { $ aCodeInjected = $ this -> _getInjectedCode ( ) ; return isset ( $ aCodeInjected [ $ sType ] ) && $ aCodeInjected [ $ sType ] ; } | Checks if the code with given type was already injected . |
225,796 | public function getBasketCurrency ( ) { $ oCurrency = $ this -> _getContainer ( ) -> getSession ( ) -> getBasket ( ) -> getBasketCurrency ( ) ; return $ oCurrency !== null ? $ oCurrency -> name : '' ; } | Returns the basket currency . |
225,797 | public function getAmazonBillingAddress ( ) { $ oOrderReferenceDetails = $ this -> _getContainer ( ) -> getClient ( ) -> getOrderReferenceDetails ( ) ; $ oDetails = $ oOrderReferenceDetails -> GetOrderReferenceDetailsResult -> OrderReferenceDetails ; if ( isset ( $ oDetails -> BillingAddress ) === true ) { $ aParsedDat... | Returns the amazon billing address . |
225,798 | public function getCountryName ( $ sCountryId ) { $ oCountry = $ this -> _getContainer ( ) -> getObjectFactory ( ) -> createOxidObject ( 'oxCountry' ) ; return ( $ oCountry -> load ( $ sCountryId ) === true ) ? ( string ) $ oCountry -> getFieldData ( 'oxTitle' ) : '' ; } | Returns the county name for the current billing address country . |
225,799 | public function updateUserWithAmazonData ( ) { $ billingAddress = $ this -> getAmazonBillingAddress ( ) ; if ( $ billingAddress !== null ) { $ oUser = $ this -> getUser ( ) ; $ oUser -> assign ( $ billingAddress ) ; $ oUser -> save ( ) ; } } | Updates the user data with the amazon data . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.