Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • AdminHttpViewControllers
  • ApiV2Controllers
  • Authentication
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Strategies
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Storages
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Extensions
    • Customers
    • Emails
    • Helpers
    • Invoices
    • Orders
    • Serializers
    • Templates
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • HttpViewControllers
  • InfoBox
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
  • Invoice
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • Modules
    • Collections
    • Controllers
    • Interfaces
  • None
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • Precheck
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • Shared
    • ClassFinder
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • SharedShoppingCart
    • Interfaces
  • Slider
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository

Classes

  • AbstractAddonValueServiceFactory
  • AbstractAddonValueStorage
  • AbstractApiV2Controller
  • AbstractCategoryServiceFactory
  • AbstractCollection
  • AbstractCreateAccountProcess
  • AbstractCustomerFactory
  • AbstractCustomerServiceFactory
  • AbstractFileStorage
  • AbstractHttpContextFactory
  • AbstractHttpViewControllerRegistryFactory
  • AbstractImagesApiV2Controller
  • AbstractInvoiceServiceFactory
  • AbstractJsonSerializer
  • AbstractModuleCenterModule
  • AbstractModuleCenterModuleController
  • AbstractOrderServiceFactory
  • AbstractProductAttributeServiceFactory
  • AbstractProductServiceFactory
  • AbstractSliderServiceFactory
  • AddonValueService
  • AddonValueServiceFactory
  • AddonValueStorageFactory
  • AddressBlock
  • AddressBookService
  • AddressClass
  • AddressesApiV2Controller
  • AddressFormatProvider
  • AddressJsonSerializer
  • AdminFavoritesAjaxController
  • AdminHttpViewController
  • AdminInfoBoxAjaxController
  • AdminLayoutHttpControllerResponse
  • AdminPageHttpControllerResponse
  • AfterbuyAjaxController
  • AfterbuyModuleCenterModule
  • AfterbuyModuleCenterModuleController
  • AmazonAdvPaymentsModuleCenterModuleController
  • Asset
  • AssetCollection
  • AttachmentCollection
  • AttachmentName
  • AttachmentPath
  • AttachmentsApiV2Controller
  • AttachmentsHandler
  • AuthFactory
  • AuthService
  • AuthSettings
  • AuthStrategyCollection
  • BoolType
  • BrickfoxModuleCenterModule
  • BrickfoxModuleCenterModuleController
  • CacheTokenHelper
  • CartController
  • CartDropdownController
  • CartShippingCostsController
  • CategoriesApiV2Controller
  • Category
  • CategoryAddonValueStorage
  • CategoryFactory
  • CategoryIconsApiV2Controller
  • CategoryImagesApiV2Controller
  • CategoryJsonSerializer
  • CategoryListItem
  • CategoryListItemCollection
  • CategoryListItemJsonSerializer
  • CategoryListProvider
  • CategoryListProviderFactory
  • CategoryObjectService
  • CategoryReadService
  • CategoryRepository
  • CategoryRepositoryDeleter
  • CategoryRepositoryReader
  • CategoryRepositoryWriter
  • CategoryServiceFactory
  • CategorySettings
  • CategorySettingsRepository
  • CategorySettingsRepositoryReader
  • CategorySettingsRepositoryWriter
  • CategoryWriteService
  • CheckQuantityController
  • CheckStatusController
  • ClassFinder
  • ColorHelper
  • ContactCollection
  • ContactName
  • ContactType
  • ContentNavigationCollection
  • CookieBarController
  • CountriesApiV2Controller
  • CountryJsonSerializer
  • CountryService
  • CreateAccountProcess
  • CreateGuestController
  • CreateRegistreeController
  • CrossCuttingLoader
  • CurrencyCode
  • Customer
  • CustomerAccountInputValidator
  • CustomerAdditionalAddressInfo
  • CustomerAddonValueStorage
  • CustomerAddress
  • CustomerAddressDeleter
  • CustomerAddressInputValidator
  • CustomerAddressReader
  • CustomerAddressRepository
  • CustomerAddressWriter
  • CustomerB2BStatus
  • CustomerCallNumber
  • CustomerCity
  • CustomerCompany
  • CustomerCountry
  • CustomerCountryIso2
  • CustomerCountryIso3
  • CustomerCountryName
  • CustomerCountryReader
  • CustomerCountryRepository
  • CustomerCountryZone
  • CustomerCountryZoneIsoCode
  • CustomerCountryZoneName
  • CustomerCountryZoneReader
  • CustomerCountryZoneRepository
  • CustomerDateOfBirth
  • CustomerDeleter
  • CustomerEmail
  • CustomerFactory
  • CustomerFirstname
  • CustomerGender
  • CustomerHashedPassword
  • CustomerHouseNumber
  • CustomerInputToCollectionTransformer
  • CustomerInputValidator
  • CustomerInputValidatorSettings
  • CustomerJsonSerializer
  • CustomerLastname
  • CustomerLoginController
  • CustomerMemo
  • CustomerMemoCollection
  • CustomerNumber
  • CustomerPassword
  • CustomerPostcode
  • CustomerReader
  • CustomerReadService
  • CustomerRegistrationInputValidatorService
  • CustomerRepository
  • CustomersApiV2Controller
  • CustomerService
  • CustomerServiceFactory
  • CustomerServiceSettings
  • CustomerStatusHelper
  • CustomerStatusInformation
  • CustomerStatusProvider
  • CustomerStreet
  • CustomerSuburb
  • CustomerVatNumber
  • CustomerWriter
  • CustomerWriteService
  • DashboardController
  • DataTableColumn
  • DataTableColumnCollection
  • DataTableColumnType
  • DataTableHelper
  • DecimalType
  • DefaultApiV2Controller
  • DefaultTemplateSettings
  • DocumentFileStorage
  • DynamicShopMessagesController
  • EditableCollection
  • EditableKeyValueCollection
  • EkomiModuleCenterModule
  • EkomiModuleCenterModuleController
  • Email
  • EmailAddress
  • EmailAttachment
  • EmailCollection
  • EmailContact
  • EmailContent
  • EmailDeleter
  • EmailFactory
  • EmailJsonSerializer
  • EmailParser
  • EmailReader
  • EmailRepository
  • EmailsApiV2Controller
  • EmailsController
  • EmailService
  • EmailStringType
  • EmailSubject
  • EmailWriter
  • EmbeddedModuleController
  • EmptyCurrencyCode
  • EmptyDateTime
  • EmptyLanguageCode
  • EmptyProductImage
  • EnvCategoryServiceSettings
  • EnvInvoiceServiceSettings
  • EnvironmentClassFinderSettings
  • EnvironmentHttpContextFactory
  • EnvironmentHttpViewControllerRegistryFactory
  • EnvProductImageFileStorageSettings
  • EnvSlideImageFileStorageSettings
  • ExistingDirectory
  • ExistingFile
  • ExtraContentController
  • FileDownloadInformation
  • FilenameStringType
  • FilesystemHelper
  • FilterController
  • FindologicModuleCenterModule
  • FindologicModuleCenterModuleController
  • GoogleAdwordConversionModuleCenterModule
  • GoogleAdwordConversionModuleCenterModuleController
  • GXCoreLoader
  • GXCoreLoaderSettings
  • GXEngineOrder
  • GXEngineProduct
  • HeidelpayModuleCenterModuleController
  • HermesModuleCenterModule
  • HermesModuleCenterModuleController
  • HttpApiV2Controller
  • HttpContext
  • HttpContextReader
  • HttpControllerResponse
  • HttpDispatcher
  • HttpResponseProcessor
  • HttpService
  • HttpServiceFactory
  • HttpViewController
  • HttpViewControllerFactory
  • HttpViewControllerRegistry
  • IdCollection
  • IdType
  • IloxxModuleCenterModule
  • IloxxModuleCenterModuleController
  • ImageFileStorage
  • ImageProcessingController
  • ImageRequestController
  • InfoBoxFactory
  • InfoBoxMessage
  • InfoBoxMessageCollection
  • InfoBoxRepository
  • InfoBoxRepositoryDeleter
  • InfoBoxRepositoryReader
  • InfoBoxRepositoryWriter
  • InfoBoxService
  • IntrashipModuleCenterModule
  • IntrashipModuleCenterModuleController
  • IntType
  • InvoiceActions
  • InvoiceArchiveReadService
  • InvoiceArchiveWriteService
  • InvoiceFileEntitler
  • InvoiceInformation
  • InvoiceListGenerator
  • InvoiceListItem
  • InvoiceListItemCollection
  • InvoiceRepository
  • InvoiceServiceFactory
  • InvoicesModalsAjaxController
  • InvoicesOverviewAjaxController
  • InvoicesOverviewColumns
  • InvoicesOverviewController
  • InvoicesOverviewTooltips
  • ItRechtModuleCenterModule
  • ItRechtModuleCenterModuleController
  • JanolawModuleCenterModule
  • JanolawModuleCenterModuleController
  • JsConfigurationController
  • JSEngineConfiguration
  • JsonHttpControllerResponse
  • JsTranslationsController
  • KeyValueCollection
  • KlarnaModuleCenterModuleController
  • LanguageCode
  • LanguageHelper
  • LanguageProvider
  • LawsController
  • LegacyProductImageProcessing
  • LettrModuleCenterModule
  • LettrModuleCenterModuleController
  • LiveSearchController
  • MagnalisterModuleCenterModule
  • MagnalisterModuleCenterModuleController
  • MailbeezModuleCenterModule
  • MailbeezModuleCenterModuleController
  • MailerAdapter
  • MaxFileSizeController
  • Md5Strategy
  • MediafinanzModuleCenterModule
  • MediafinanzModuleCenterModuleController
  • ModuleCenterController
  • ModuleCenterModuleCollection
  • NewAttributesController
  • NewsletterLinkModuleCenterModule
  • NewsletterLinkModuleCenterModuleController
  • NonEmptyStringType
  • OldOrderOverviewModuleCenterModule
  • OldOrderOverviewModuleCenterModuleController
  • OrderActions
  • OrderAddonValueStorage
  • OrderAddressBlock
  • OrderFactory
  • OrderItem
  • OrderItemAddonValueStorage
  • OrderItemAttribute
  • OrderItemAttributeCollection
  • OrderItemAttributeFactory
  • OrderItemAttributeRepository
  • OrderItemAttributeRepositoryDeleter
  • OrderItemAttributeRepositoryFactory
  • OrderItemAttributeRepositoryReader
  • OrderItemAttributeRepositoryWriter
  • OrderItemCollection
  • OrderItemDownloadInformation
  • OrderItemDownloadInformationCollection
  • OrderItemFactory
  • OrderItemProperty
  • OrderItemPropertyFactory
  • OrderItemPropertyRepository
  • OrderItemPropertyRepositoryDeleter
  • OrderItemPropertyRepositoryReader
  • OrderItemPropertyRepositoryWriter
  • OrderItemRepository
  • OrderItemRepositoryDeleter
  • OrderItemRepositoryReader
  • OrderItemRepositoryWriter
  • OrderJsonSerializer
  • OrderListGenerator
  • OrderListItem
  • OrderListItemCollection
  • OrderListItemJsonSerializer
  • OrderObjectService
  • OrderPaymentType
  • OrderReadService
  • OrderRepository
  • OrderRepositoryDeleter
  • OrderRepositoryReader
  • OrderRepositoryWriter
  • OrdersApiV2Controller
  • OrderServiceFactory
  • OrderServiceSettings
  • OrderShippingType
  • OrdersHistoryApiV2Controller
  • OrdersItemsApiV2Controller
  • OrdersItemsAttributesApiV2Controller
  • OrdersModalsAjaxController
  • OrdersOverviewAjaxController
  • OrdersOverviewColumns
  • OrdersOverviewController
  • OrdersOverviewTooltips
  • OrderStatusHistoryListItem
  • OrderStatusHistoryListItemCollection
  • OrderStatusHistoryStorage
  • OrderStatusStyles
  • OrdersTotalsApiV2Controller
  • OrderTooltipController
  • OrderTotal
  • OrderTotalCollection
  • OrderTotalFactory
  • OrderTotalRepository
  • OrderTotalRepositoryDeleter
  • OrderTotalRepositoryReader
  • OrderTotalRepositoryWriter
  • OrderTrackingInformationCollection
  • OrderWriteService
  • PackedDownloadController
  • PasswordEncryptionSettings
  • PasswordHashStrategy
  • PathType
  • PayOneModuleCenterModuleController
  • PayPalConfigurationController
  • PayPalController
  • PaypalNGModuleCenterModuleController
  • PostfinderModuleCenterModule
  • PostfinderModuleCenterModuleController
  • Precheck
  • ProductAddonValueStorage
  • ProductAttribute
  • ProductAttributeCollection
  • ProductAttributeFactory
  • ProductAttributeObjectService
  • ProductAttributeRepository
  • ProductAttributeRepositoryDeleter
  • ProductAttributeRepositoryReader
  • ProductAttributeRepositoryWriter
  • ProductAttributeService
  • ProductAttributeServiceFactory
  • ProductAttributesModuleCenterModule
  • ProductAttributesModuleCenterModuleController
  • ProductCategoryLinker
  • ProductFactory
  • ProductImage
  • ProductImageCollection
  • ProductImageContainer
  • ProductImageContainerRepository
  • ProductImageFileStorage
  • ProductImagesApiV2Controller
  • ProductJsonSerializer
  • ProductListItem
  • ProductListItemCollection
  • ProductListItemJsonSerializer
  • ProductListProvider
  • ProductListProviderFactory
  • ProductObjectService
  • ProductPermissionSetter
  • ProductQuestionController
  • ProductReadService
  • ProductRepository
  • ProductRepositoryDeleter
  • ProductRepositoryReader
  • ProductRepositoryWriter
  • ProductsApiV2Controller
  • ProductServiceFactory
  • ProductSettings
  • ProductSettingsRepository
  • ProductSettingsRepositoryReader
  • ProductSettingsRepositoryWriter
  • ProductsLinksApiV2Controller
  • ProductWriteService
  • ProtectedShopsModuleCenterModule
  • ProtectedShopsModuleCenterModuleController
  • RedirectHttpControllerResponse
  • SessionTimeoutAjaxController
  • SharedShoppingCartConfigurationController
  • SharedShoppingCartController
  • SharedShoppingCartDeleter
  • SharedShoppingCartModuleCenterModule
  • SharedShoppingCartModuleCenterModuleController
  • SharedShoppingCartReader
  • SharedShoppingCartRepository
  • SharedShoppingCartService
  • SharedShoppingCartSettings
  • SharedShoppingCartWriter
  • ShipcloudController
  • ShipcloudModuleCenterModule
  • ShipcloudModuleCenterModuleController
  • ShopKeyController
  • Slide
  • SlideCollection
  • SlideImage
  • SlideImageArea
  • SlideImageAreaCollection
  • SlideImageAreaRepository
  • SlideImageAreaRepositoryDeleter
  • SlideImageAreaRepositoryReader
  • SlideImageAreaRepositoryWriter
  • SlideImageCollection
  • SlideImageFileStorage
  • SlideImageRepository
  • SlideImageRepositoryDeleter
  • SlideImageRepositoryReader
  • SlideImageRepositoryWriter
  • Slider
  • SliderAssignmentRepository
  • SliderCollection
  • SlideRepository
  • SlideRepositoryDeleter
  • SlideRepositoryReader
  • SlideRepositoryWriter
  • SliderJsonSerializer
  • SliderReadService
  • SliderRepository
  • SliderRepositoryDeleter
  • SliderRepositoryReader
  • SliderRepositoryWriter
  • SlidersDetailsAjaxController
  • SlidersDetailsController
  • SliderServiceFactory
  • SlidersOverviewAjaxController
  • SlidersOverviewController
  • SliderWriteService
  • StaticCrossCuttingLoader
  • StaticGXCoreLoader
  • StatisticsService
  • StoredCategory
  • StoredOrderItem
  • StoredOrderItemAttribute
  • StoredOrderItemAttributeCollection
  • StoredOrderItemCollection
  • StoredOrderItemProperty
  • StoredOrderTotal
  • StoredOrderTotalCollection
  • StoredProduct
  • StoredProductAttribute
  • StoredProductAttributeCollection
  • StringCollection
  • StringHelper
  • StringType
  • StyleEdit3AuthenticationController
  • TemplateConfigurationController
  • TrustedShopsModuleCenterModule
  • TrustedShopsModuleCenterModuleController
  • UnknownCustomerCountry
  • UploadedFile
  • UrlRewrite
  • UrlRewriteCollection
  • UrlRewriteStorage
  • UserConfigurationController
  • UserConfigurationReader
  • UserConfigurationService
  • UserConfigurationWriter
  • UsernamePasswordCredentials
  • VatNumberValidator
  • WishListController
  • WritableDirectory
  • WritableFile
  • YategoModuleCenterModule
  • YategoModuleCenterModuleController
  • YoochooseModuleCenterModule
  • YoochooseModuleCenterModuleController
  • ZoneJsonSerializer
  • ZonesApiV2Controller

Interfaces

  • AddonValueContainerInterface
  • AddonValueServiceInterface
  • AddonValueStorageFactoryInterface
  • AddressBlockInterface
  • AddressBookServiceInterface
  • AddressClassInterface
  • AddressFormatProviderInterface
  • AdminStatusOnlyInterface
  • AssetCollectionInterface
  • AssetInterface
  • AttachmentCollectionInterface
  • AttachmentNameInterface
  • AttachmentPathInterface
  • AttachmentsHandlerInterface
  • AuthCredentialsInterface
  • AuthFactoryInterface
  • AuthServiceInterface
  • AuthSettingsInterface
  • AuthStrategyInterface
  • CacheTokenHelperInterface
  • CategoryFactoryInterface
  • CategoryInterface
  • CategoryListProviderFactoryInterface
  • CategoryListProviderInterface
  • CategoryObjectServiceInterface
  • CategoryReadServiceInterface
  • CategoryRepositoryDeleterInterface
  • CategoryRepositoryInterface
  • CategoryRepositoryReaderInterface
  • CategoryRepositoryWriterInterface
  • CategoryServiceSettingsInterface
  • CategorySettingsInterface
  • CategorySettingsRepositoryInterface
  • CategorySettingsRepositoryReaderInterface
  • CategorySettingsRepositoryWriterInterface
  • CategoryWriteServiceInterface
  • ClassFinderInterface
  • ClassFinderSettingsInterface
  • ContactCollectionInterface
  • ContactNameInterface
  • ContactTypeInterface
  • ContentNavigationCollectionInterface
  • ContentViewInterface
  • CountryServiceInterface
  • CrossCuttingLoaderInterface
  • CrossCuttingObjectInterface
  • CustomerAccountInputValidatorInterface
  • CustomerAdditionalAddressInfoInterface
  • CustomerAddressDeleterInterface
  • CustomerAddressInputValidatorInterface
  • CustomerAddressInterface
  • CustomerAddressReaderInterface
  • CustomerAddressRepositoryInterface
  • CustomerAddressWriterInterface
  • CustomerB2BStatusInterface
  • CustomerCallNumberInterface
  • CustomerCityInterface
  • CustomerCompanyInterface
  • CustomerCountryInterface
  • CustomerCountryIso2Interface
  • CustomerCountryIso3Interface
  • CustomerCountryNameInterface
  • CustomerCountryReaderInterface
  • CustomerCountryRepositoryInterface
  • CustomerCountryZoneInterface
  • CustomerCountryZoneIsoCodeInterface
  • CustomerCountryZoneNameInterface
  • CustomerCountryZoneReaderInterface
  • CustomerCountryZoneRepositoryInterface
  • CustomerDeleterInterface
  • CustomerEmailInterface
  • CustomerFirstnameInterface
  • CustomerGenderInterface
  • CustomerHouseNumberInterface
  • CustomerInputValidatorInterface
  • CustomerInputValidatorSettingsInterface
  • CustomerInterface
  • CustomerLastnameInterface
  • CustomerNumberInterface
  • CustomerPasswordInterface
  • CustomerPostcodeInterface
  • CustomerReaderInterface
  • CustomerReadServiceInterface
  • CustomerRegistrationInputValidatorServiceInterface
  • CustomerRepositoryInterface
  • CustomerServiceInterface
  • CustomerServiceSettingsInterface
  • CustomerStatusHelperInterface
  • CustomerStatusProviderInterface
  • CustomerStreetInterface
  • CustomerSuburbInterface
  • CustomerVatNumberInterface
  • CustomerWriterInterface
  • CustomerWriteServiceInterface
  • EmailAddressInterface
  • EmailAttachmentInterface
  • EmailCollectionInterface
  • EmailContactInterface
  • EmailContentInterface
  • EmailDeleterInterface
  • EmailFactoryInterface
  • EmailInterface
  • EmailReaderInterface
  • EmailRepositoryInterface
  • EmailServiceInterface
  • EmailSubjectInterface
  • EmailWriterInterface
  • FilesystemHelperInterface
  • GXCoreLoaderInterface
  • GXCoreLoaderSettingsInterface
  • HttpContextInterface
  • HttpContextReaderInterface
  • HttpControllerResponseInterface
  • HttpDispatcherInterface
  • HttpResponseProcessorInterface
  • HttpServiceFactoryInterface
  • HttpServiceInterface
  • HttpViewControllerFactoryInterface
  • HttpViewControllerInterface
  • HttpViewControllerRegistryInterface
  • IdInterface
  • InfoBoxFactoryInterface
  • InfoBoxMessageInterface
  • InfoBoxRepositoryDeleterInterface
  • InfoBoxRepositoryInterface
  • InfoBoxRepositoryReaderInterface
  • InfoBoxRepositoryWriterInterface
  • InfoBoxServiceInterface
  • InvoiceArchiveReadServiceInterface
  • InvoiceArchiveWriteServiceInterface
  • InvoiceFileEntitlerInterface
  • InvoiceListGeneratorInterface
  • InvoiceRepositoryInterface
  • InvoiceServiceSettingsInterface
  • LanguageHelperInterface
  • LanguageProviderInterface
  • MailerAdapterInterface
  • ModuleCenterModuleCollectionInterface
  • ModuleCenterModuleInterface
  • OrderFactoryInterface
  • OrderInterface
  • OrderItemAttributeFactoryInterface
  • OrderItemAttributeInterface
  • OrderItemAttributeRepositoryDeleterInterface
  • OrderItemAttributeRepositoryFactoryInterface
  • OrderItemAttributeRepositoryInterface
  • OrderItemAttributeRepositoryReaderInterface
  • OrderItemAttributeRepositoryWriterInterface
  • OrderItemFactoryInterface
  • OrderItemInterface
  • OrderItemPropertyFactoryInterface
  • OrderItemPropertyRepositoryDeleterInterface
  • OrderItemPropertyRepositoryReaderInterface
  • OrderItemPropertyRepositoryWriterInterface
  • OrderItemRepositoryDeleterInterface
  • OrderItemRepositoryInterface
  • OrderItemRepositoryReaderInterface
  • OrderItemRepositoryWriterInterface
  • OrderListGeneratorInterface
  • OrderObjectServiceInterface
  • OrderPaymentTypeInterface
  • OrderReadServiceInterface
  • OrderRepositoryDeleterInterface
  • OrderRepositoryInterface
  • OrderRepositoryReaderInterface
  • OrderRepositoryWriterInterface
  • OrderServiceSettingsInterface
  • OrderShippingTypeInterface
  • OrderStatusHistoryReaderInterface
  • OrderStatusHistoryWriterInterface
  • OrderTotalFactoryInterface
  • OrderTotalInterface
  • OrderTotalRepositoryDeleterInterface
  • OrderTotalRepositoryInterface
  • OrderTotalRepositoryReaderInterface
  • OrderTotalRepositoryWriterInterface
  • OrderWriteServiceInterface
  • ProductAttributeFactoryInterface
  • ProductAttributeInterface
  • ProductAttributeObjectServiceInterface
  • ProductAttributeRepositoryDeleterInterface
  • ProductAttributeRepositoryInterface
  • ProductAttributeRepositoryReaderInterface
  • ProductAttributeRepositoryWriterInterface
  • ProductAttributeServiceInterface
  • ProductCategoryLinkerInterface
  • ProductFactoryInterface
  • ProductImageContainerInterface
  • ProductImageContainerRepositoryInterface
  • ProductImageInterface
  • ProductImagePathsSettingsInterface
  • ProductImageProcessingInterface
  • ProductInterface
  • ProductListProviderFactoryInterface
  • ProductListProviderInterface
  • ProductObjectServiceInterface
  • ProductPermissionSetterInterface
  • ProductReadServiceInterface
  • ProductRepositoryDeleterInterface
  • ProductRepositoryInterface
  • ProductRepositoryReaderInterface
  • ProductRepositoryWriterInterface
  • ProductSettingsInterface
  • ProductSettingsRepositoryInterface
  • ProductSettingsRepositoryReaderInterface
  • ProductSettingsRepositoryWriterInterface
  • ProductWriteServiceInterface
  • SerializerInterface
  • SharedShoppingCartDeleterInterface
  • SharedShoppingCartReaderInterface
  • SharedShoppingCartRepositoryInterface
  • SharedShoppingCartServiceInterface
  • SharedShoppingCartSettingsInterface
  • SharedShoppingCartWriterInterface
  • SlideImageAreaInterface
  • SlideImageAreaRepositoryDeleterInterface
  • SlideImageAreaRepositoryInterface
  • SlideImageAreaRepositoryReaderInterface
  • SlideImageAreaRepositoryWriterInterface
  • SlideImageInterface
  • SlideImagePathsSettingsInterface
  • SlideImageRepositoryDeleterInterface
  • SlideImageRepositoryInterface
  • SlideImageRepositoryReaderInterface
  • SlideImageRepositoryWriterInterface
  • SlideInterface
  • SliderAssignmentRepositoryInterface
  • SlideRepositoryDeleterInterface
  • SlideRepositoryInterface
  • SlideRepositoryReaderInterface
  • SlideRepositoryWriterInterface
  • SliderInterface
  • SliderReadServiceInterface
  • SliderRepositoryDeleterInterface
  • SliderRepositoryInterface
  • SliderRepositoryReaderInterface
  • SliderRepositoryWriterInterface
  • SliderWriteServiceInterface
  • StatisticsServiceInterface
  • StoredCategoryInterface
  • StoredOrderItemAttributeInterface
  • StoredOrderItemInterface
  • StoredOrderTotalInterface
  • StoredProductAttributeInterface
  • StoredProductInterface
  • StringHelperInterface
  • UrlKeywordsRepairerInterface
  • UserConfigurationReaderInterface
  • UserConfigurationServiceInterface
  • UserConfigurationWriterInterface
  • VatNumberValidatorInterface

Exceptions

  • AjaxException
  • AttachmentNotFoundException
  • FileNotFoundException
  • HttpApiV2Exception
  • InvalidCustomerDataException
  • MissingControllerNameException
  • UnknownEnvironmentException
  1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 
<?php
/* --------------------------------------------------------------
    PayPalConfiguration.inc.php 2016-10-20
    Gambio GmbH
    http://www.gambio.de
    Copyright (c) 2015 Gambio GmbH
    Released under the GNU General Public License (Version 2)
    [http://www.gnu.org/licenses/gpl-2.0.html]
    --------------------------------------------------------------
*/

/**
 * Class PayPalConfigurationController
 * @package HttpViewControllers
 */
class PayPalConfigurationController extends AdminHttpViewController
{
    /**
     * @var array Array with Values that are passed to the template
     */
    protected $valueArray = array();

    /**
     * @var PayPalText Helper for language-specific texts
     */
    protected $paypalText;

    /**
     * @var PayPalConfigurationStorage
     */
    protected $configurationStorage;

    protected $logger;

    const MESSAGES_NAMESPACE = __class__;

    /**
     * Initialize the Controller with required properties
     *
     * @param \HttpContextReaderInterface     $httpContextReader
     * @param \HttpResponseProcessorInterface $httpResponseProcessor
     * @param \ContentViewInterface           $contentView
     *
     * @inheritdoc
     */
    public function __construct(HttpContextReaderInterface $httpContextReader,
                                HttpResponseProcessorInterface $httpResponseProcessor,
                                ContentViewInterface $contentView)
    {
        if($_SESSION['customers_status']['customers_status_id'] != 0)
        {
            throw new Exception('unauthorized access');
        }
        $contentView->set_caching_enabled(false);
        parent::__construct($httpContextReader, $httpResponseProcessor, $contentView);
        if(!is_array($_SESSION[self::MESSAGES_NAMESPACE]))
        {
            $_SESSION[self::MESSAGES_NAMESPACE] = array();
        }
        $this->paypalText = MainFactory::create('PayPalText');
        $this->configurationStorage = MainFactory::create('PayPalConfigurationStorage');
        $this->logger = MainFactory::create('PayPalLogger');
        $this->contentView->set_template_dir(DIR_FS_ADMIN . 'html/content/paypal3/');
    }

    /**
    * adds stripslashes() to parent::_getPostData() to reverse the forced magic quotes introduced by the compatibiliy layer
    */
    protected function _getPostData($name)
    {
        $value = parent::_getPostData($name);
        if(is_string($value))
        {
            $value = stripslashes($value);
        }
        return $value;
    }


    /**
     * Run the actionDefault method.
     * This is invoked through admin/admin.php?do=PayPalConfiguration
     *
     * @return \AdminPageHttpControllerResponse
     */
    public function actionDefault()
    {
        if($this->_isConfigured() === false && !$this->_getQueryParameter('skip_firstconfig') == '1')
        {
            return MainFactory::create('RedirectHttpControllerResponse', xtc_href_link('admin.php', 'do=PayPalConfiguration/FirstTime'));
        }
        $this->_prepareValuesArray(true);
        if(!empty($this->valueArray['messages']))
        {
            isset($GLOBALS['messageStack']) or $GLOBALS['messageStack'] = new messageStack();
            foreach($this->valueArray['messages'] as $message)
            {
                $GLOBALS['messageStack']->add($message['text'], $message['class']);
            }
        }

        $this->valueArray['pex_block'] = $this->_render('admin_paypal_configuration_pexprofiles.html', $this->valueArray);
        $html = $this->_render('admin_paypal_configuration.html', $this->valueArray);
        $html = $this->paypalText->replaceLanguagePlaceholders($html);

        return MainFactory::create('AdminPageHttpControllerResponse', $this->paypalText->get_text('paypal_configuration'), $html);
    }

    /**
     * shows first-time configuration assistant
     */
    public function actionFirstTime()
    {
        if(class_exists('LogControl'))
        {
            $secure_token = LogControl::get_secure_token();
        }
        else
        {
            $secure_token = FileLog::get_secure_token();
        }

        $create_webhook = ENABLE_SSL_CATALOG === 'true' || ENABLE_SSL_CATALOG === true;
        // $use_paypal_plus = constant('STORE_COUNTRY') == 81 ? '1' : '0';
        $use_paypal_plus = '0';
        $use_ecs = in_array(ACCOUNT_OPTIONS, array('guest', 'both')) ? '1' : '0';

        $valueArray = array(
            'page_token'
                => $_SESSION['coo_page_token']->generate_token(),
            'form_get_target'
                => './admin.php',
            'do'
                => 'PayPalConfiguration',
            'messages'
                => $_SESSION[self::MESSAGES_NAMESPACE],
            'testhack'
                => $this->_getQueryParameter('testhack') == '1' ? '1' : '0',
            'skip_firstconfig_link'
                => xtc_href_link('admin.php', 'do=PayPalConfiguration&skip_firstconfig=1'),
            'create_webhook'
                => $create_webhook,
            'use_paypal_plus'
                => $use_paypal_plus,
            'use_ecs'
                => $use_ecs,
        );
        $_SESSION[self::MESSAGES_NAMESPACE] = array();
        $html = $this->_render('admin_paypal_configuration_first.html', $valueArray);
        $html = $this->paypalText->replaceLanguagePlaceholders($html);
        return MainFactory::create('AdminPageHttpControllerResponse', $this->paypalText->get_text('paypal_configuration_first'), $html);
    }

    /**
     * saves first-time configuration
     */
    public function actionSaveFirstConfiguration()
    {
        $_SESSION['coo_page_token']->is_valid($this->_getPostData('page_token')) or die('invalid page token');
        try {
            if($this->_getPostData('testhack') != '1')
            {
                $this->configurationStorage->set('mode', 'live');
                $this->configurationStorage->set(
                    'restapi-credentials/live/client_id',
                    $this->_getPostData('restapi-credentials-live-client_id')
                );
                $this->configurationStorage->set(
                    'restapi-credentials/live/secret',
                    $this->_getPostData('restapi-credentials-live-secret')
                );
                $this->_checkCredentials();
            }
            else
            {
                $this->configurationStorage->set('mode', 'sandbox');
            }
        }
        catch(Exception $e)
        {
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'error', 'text' => $this->paypalText->get_text('credentials_invalid_try_again'));
            $this->configurationStorage->set('restapi-credentials/live/client_id', '');
            $this->configurationStorage->set('restapi-credentials/live/secret', '');
            return MainFactory::create('RedirectHttpControllerResponse', xtc_href_link('admin.php', 'do=PayPalConfiguration/FirstTime'));
        }

        // create PEx profile
        $languages = new language();
        $langToLocaleMap = array(
            'cn' => 'zh_CN',
            'da' => 'da_DK',
            'de' => 'DE',
            'dk' => 'da_DK',
            'en' => 'GB',
            'es' => 'ES',
            'fr' => 'FR',
            'he' => 'he_IL',
            'id' => 'id_ID',
            'il' => 'he_IL',
            'it' => 'IT',
            'ja' => 'ja_JP',
            'jp' => 'ja_JP',
            'nl' => 'NL',
            'no' => 'no_NO',
            'pl' => 'PL',
            'pt' => 'PT',
            'ru' => 'RU',
            'se' => 'sv_SE',
            'sv' => 'sv_SE',
            'th' => 'th_TH',
            'tr' => 'tr_TR',
            'zh' => 'zh_CN',
            'zh' => 'zh_HK',
        );
        foreach($languages->catalog_languages as $iso2 => $langData)
        {
            try
            {
                $profile = MainFactory::create('PayPalExperienceProfile');
                $profile->name = 'Gambio '.$langData['code'];
                if(array_key_exists($langData['code'], $langToLocaleMap))
                {
                    $profile->locale_code = $langToLocaleMap[$langData['code']];
                }
                else
                {
                    $profile->locale_code = 'DE'; // fallback
                }
                $profile_id = $profile->save();
                $this->configurationStorage->set('payment_experience_profile/'.$langData['code'], $profile_id);
            }
            catch(Exception $e)
            {
                $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'error', 'text' => sprintf('%s (%s)', $this->paypalText->get_text('error_creating_profile'), $e->getMessage()));
            }
        }

        // create Webhook
        try
        {
            $webhookFactory = MainFactory::create('PayPalWebhookFactory');
            $webhookResponse = $webhookFactory->renewWebhook();
        }
        catch(Exception $e)
        {
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'error', 'text' => $this->paypalText->get_text('error_registering_webhook') . '(' . $e->getMessage() .')');
        }

        // configure PP+
        $this->configurationStorage->set('use_paypal_plus', ($this->_getPostData('use_paypal_plus') == '1' ? '1' : '0'));

        // configure ECS
        if($this->_getPostData('use_ecs') == '1')
        {
            $this->configurationStorage->set('use_ecs_cart', '1');
            $this->configurationStorage->set('use_ecs_products', '1');
        }

        return MainFactory::create('RedirectHttpControllerResponse', xtc_href_link('admin.php', 'do=PayPalConfiguration'));
    }

    /**
     * determines whether the interface has been configured, i.e. at least one set of credentials (live/sandbox) has been saved
     */
    protected function _isConfigured()
    {
        $isConfigured = false;
        $mode = $this->configurationStorage->get('mode');
        $client_id = $this->configurationStorage->get('restapi-credentials/'.$mode.'/client_id');
        $secret = $this->configurationStorage->get('restapi-credentials/'.$mode.'/secret');
        if(!empty($client_id) && !empty($secret))
        {
            $isConfigured = true;
        }
        return $isConfigured;
    }

    /**
     * Save configuration
     */
    public function actionSaveConfiguration()
    {
        $_SESSION['coo_page_token']->is_valid($this->_getPostData('page_token')) or die('invalid page token');
        try {
            $this->configurationStorage->set(
                'mode',
                $this->_getPostData('mode')
            );
            $this->configurationStorage->set(
                'restapi-credentials/live/client_id',
                $this->_getPostData('restapi-credentials-live-client_id')
            );
            $this->configurationStorage->set(
                'restapi-credentials/live/secret',
                $this->_getPostData('restapi-credentials-live-secret')
            );
            $this->configurationStorage->set(
                'restapi-credentials/sandbox/client_id',
                $this->_getPostData('restapi-credentials-sandbox-client_id')
            );
            $this->configurationStorage->set(
                'restapi-credentials/sandbox/secret',
                $this->_getPostData('restapi-credentials-sandbox-secret')
            );
            $this->configurationStorage->set(
                'use_paypal_plus',
                $this->_getPostData('use_paypal_plus')
            );
            $this->configurationStorage->set(
                'intent',
                $this->_getPostData('intent')
            );
            $this->configurationStorage->set(
                'use_ecs_cart',
                $this->_getPostData('use_ecs_cart')
            );
            $this->configurationStorage->set(
                'use_ecs_products',
                $this->_getPostData('use_ecs_products')
            );
            $this->configurationStorage->set(
                'ecs_button_style',
                $this->_getPostData('ecs_button_style')
            );
            $this->configurationStorage->set(
                'allow_ecs_login',
                $this->_getPostData('allow_ecs_login')
            );
            $this->configurationStorage->set(
                'show_installments_presentment_specific_product',
                $this->_getPostData('show_installments_presentment_specific_product')
            );
            $this->configurationStorage->set(
                'show_installments_presentment_specific_cart',
                $this->_getPostData('show_installments_presentment_specific_cart')
            );
            $this->configurationStorage->set(
                'show_installments_presentment_specific_payment',
                $this->_getPostData('show_installments_presentment_specific_payment')
            );
            $this->configurationStorage->set(
                'show_installments_presentment_specific_computed',
                $this->_getPostData('show_installments_presentment_specific_computed')
            );
            $this->configurationStorage->set(
                'thirdparty_payments/invoice/mode',
                $this->_getPostData('thirdparty_payments_invoice_mode')
            );
            $this->configurationStorage->set(
                'thirdparty_payments/cod/mode',
                $this->_getPostData('thirdparty_payments_cod_mode')
            );
            $this->configurationStorage->set(
                'thirdparty_payments/moneyorder/mode',
                $this->_getPostData('thirdparty_payments_moneyorder_mode')
            );
            $this->configurationStorage->set(
                'thirdparty_payments/eustandardtransfer/mode',
                $this->_getPostData('thirdparty_payments_eustandardtransfer_mode')
            );
            $this->configurationStorage->set(
                'thirdparty_payments/cash/mode',
                $this->_getPostData('thirdparty_payments_cash_mode')
            );
            $this->configurationStorage->set(
                'logo/image',
                $this->_getPostData('logo-image')
            );
            $this->configurationStorage->set(
                'logo/position',
                $this->_getPostData('logo-position')
            );
            $this->configurationStorage->set(
                'orderstatus/completed',
                $this->_getPostData('orderstatus_completed')
            );
            $this->configurationStorage->set(
                'orderstatus/pending',
                $this->_getPostData('orderstatus_pending')
            );
            $this->configurationStorage->set(
                'orderstatus/error',
                $this->_getPostData('orderstatus_error')
            );
            $this->configurationStorage->set(
                'debug_logging',
                $this->_getPostData('debug_logging')
            );
            $this->configurationStorage->set(
                'allow_selfpickup',
                $this->_getPostData('allow_selfpickup')
            );
            $this->configurationStorage->set(
                'pui_invoice_hide_column',
                $this->_getPostData('pui_invoice_hide_column')
            );
        }
        catch(Exception $e)
        {
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'error', 'text' => $e->getMessage());
        }
        try
        {
            unset($_SESSION['paypal_access_token']);
            unset($_SESSION['paypal_access_token_expiration']);
            $this->_checkCredentials();
        }
        catch(Exception $e)
        {
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'error', 'text' => $this->paypalText->get_text('credentials_invalid'));
        }

        $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'info', 'text' => $this->paypalText->get_text('configuration_saved'));
        return MainFactory::create('RedirectHttpControllerResponse', './admin.php?do=PayPalConfiguration');
    }

    /**
     * Save a new or altered Web Payment Experience Profile
     */
    public function actionSaveExperienceProfile()
    {
        try
        {
            $exp_id = $this->_getPostData('exp_id');
            if(!empty($exp_id))
            {
                $profile = MainFactory::create('PayPalExperienceProfile', $exp_id);
            }
            else
            {
                $profile = MainFactory::create('PayPalExperienceProfile');
            }
            $profile->name = $this->_getPostData('exp_name');
            $profile->landing_page_type = $this->_getPostData('exp_lp_type');
            $profile->bank_txn_pending_url = $this->_getPostData('exp_bank_txn_pending_url');
            $profile->allow_note = $this->_getPostData('exp_allow_note') == true;
            $profile->no_shipping = (int)$this->_getPostData('exp_no_shipping');
            $profile->address_override = (int)$this->_getPostData('exp_address_override');
            $profile->brand_name = $this->_getPostData('exp_brand_name');
            $profile->logo_image = $this->_getPostData('exp_logo_image');
            $profile->locale_code = $this->_getPostData('exp_locale_code');
            $profile_id = $profile->save();
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'info', 'text' => $this->paypalText->get_text('profile_saved'));
            $redirect_url = './admin.php?do=PayPalConfiguration&exp_id='.$profile_id;
        }
        catch(Exception $e)
        {
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'error', 'text' => $e->getMessage());
            $redirect_url = './admin.php?do=PayPalConfiguration';
        }
        return MainFactory::create('RedirectHttpControllerResponse', $redirect_url);
    }

    /**
     * Select Web Payment Experience Profile to use for payments
     */
    public function actionSelectExperienceProfile()
    {
        $_SESSION['coo_page_token']->is_valid($this->_getPostData('page_token')) or die('invalid page token');
        $languageIso2 = $this->_getPostData('language');
        $Language = new language();
        if(!in_array($languageIso2, array_keys($Language->catalog_languages)))
        {
            throw new Exception('invalid language code '.$languageIso2);
        }
        //$this->configurationStorage->set('payment_experience_profile_id', $this->_getPostData('exp_id'));
        $this->configurationStorage->set('payment_experience_profile/'.$languageIso2, $this->_getPostData('exp_id'));
        $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'info', 'text' => $this->paypalText->get_text('profile_selected'));
        return MainFactory::create('RedirectHttpControllerResponse', './admin.php?do=PayPalConfiguration');
    }

    /**
     * Delete a Web Payment Experience Profile
     */
    public function actionDeleteExperienceProfile()
    {
        $_SESSION['coo_page_token']->is_valid($this->_getPostData('page_token')) or die('invalid page token');
        try
        {
            $profile = MainFactory::create('PayPalExperienceProfile', $this->_getPostData('exp_id'));
            $profile->delete();
            $language = new language();
            foreach($language->catalog_languages as $iso2 => $langData)
            {
                if($this->_getPostData('exp_id') == $this->configurationStorage->get('payment_experience_profile/'.$langData['code']))
                {
                    $this->configurationStorage->set('payment_experience_profile/'.$langData['code'], '');
                }
            }
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'info', 'text' => $this->paypalText->get_text('profile_deleted'));
        }
        catch(Exception $e)
        {
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'error', 'text' => $this->paypalText->get_text('error_deleting_profile') . '(' . $e->getMessage() .')');
        }

        return MainFactory::create('RedirectHttpControllerResponse', './admin.php?do=PayPalConfiguration');
    }

    /**
     * renew Webhook registration
     */
    public function actionRenewWebhook()
    {
        $_SESSION['coo_page_token']->is_valid($this->_getPostData('page_token')) or die('invalid page token');
        try
        {
            $webhookFactory = MainFactory::create('PayPalWebhookFactory');
            $webhookResponse = $webhookFactory->renewWebhook();
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'info', 'text' => $this->paypalText->get_text('webhook_registered') .' '. $webhookResponse->id);
        }
        catch(Exception $e)
        {
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'error', 'text' => $this->paypalText->get_text('error_registering_webhook') . '(' . $e->getMessage() .')');
        }

        return MainFactory::create('RedirectHttpControllerResponse', './admin.php?do=PayPalConfiguration');
    }

    /**
     * deletes a Webhook
     */
    public function actionDeleteWebhook()
    {
        $_SESSION['coo_page_token']->is_valid($this->_getPostData('page_token')) or die('invalid page token');
        $webhookId = $this->_getPostData('webhook_id');
        try
        {
            $webhookFactory = MainFactory::create('PayPalWebhookFactory');
            $webhookResponse = $webhookFactory->deleteWebhook($webhookId);
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'info', 'text' => $this->paypalText->get_text('webhook_deleted'));
        }
        catch(Exception $e)
        {
            $_SESSION[self::MESSAGES_NAMESPACE][] = array('class' => 'error', 'text' => $this->paypalText->get_text('error_deleting_webhook') . '(' . $e->getMessage() .')');
        }

        return MainFactory::create('RedirectHttpControllerResponse', './admin.php?do=PayPalConfiguration');
    }

    public function actionConnectCheck()
    {
        $checkConnect = $this->_getQueryParameter('check_connect');
        $url = $this->_getQueryParameter('url');
        $valid_urls = array(
            $this->configurationStorage->get('service_base_url/sandbox').'/v1/payments',
            $this->configurationStorage->get('service_base_url/live').'/v1/payments'
        );
        if(!in_array($url, $valid_urls))
        {
            return MainFactory::create('HttpControllerResponse', 'invalid URL');
        }
        $response = 'parameter error';
        if(!empty($checkConnect) && !empty($url))
        {
            $t_timeout = 5;
            $cc = MainFactory::create('ConnectChecker');
            try {
                if($checkConnect == 1) # check by GET
                {
                    $connectinfo = $cc->check_connect($url, $t_timeout);
                }
                if($checkConnect == 2) # check by POST
                {
                    $connectinfo = $cc->check_connect($url, $t_timeout, true, 'CONNECTION_TEST');
                }
                $response =  '<div class="connection_ok">'.$this->paypalText->get_text('connection_ok').'</div>';
            }
            catch(Exception $e)
            {
                $response = '<div class="connection_error">'.$this->paypalText->get_text('connection_error').': '.$e->getMessage().'</div>'.$url;
            }
        }
        return MainFactory::create('HttpControllerResponse', $response);
    }


    /**
     * Prepare the value array. The array keys are the variable names
     * that are passed to template
     */
    protected function _prepareValuesArray($includeExperienceProfiles = false)
    {
        $webhookFactory = MainFactory::create('PayPalWebhookFactory');
        $webhook_id = $this->configurationStorage->get('webhook_id');
        $webhook_id_is_valid = false;
        if(!empty($webhook_id))
        {
            $webhook_id_is_valid = $webhookFactory->checkWebhook($webhook_id);
        }

        if(class_exists('LogControl'))
        {
            $secure_token = LogControl::get_secure_token();
        }
        else
        {
            $secure_token = FileLog::get_secure_token();
        }
        $Language = new language();

        $this->valueArray = array(
            'page_token'
                => $_SESSION['coo_page_token']->generate_token(),
            'form_get_target'
                => './admin.php',
            'do'
                => 'PayPalConfiguration',
            'messages'
                => $_SESSION[self::MESSAGES_NAMESPACE],
            'languages'
                => $Language->catalog_languages,
            /*
            'experienceProfilesList'
                => $experienceProfilesList,
            'login_valid'
                => $this->_checkCredentials(),
            */
            'mode'
                => $this->configurationStorage->get('mode'),
            'mode_sandbox_selected'
                => $this->configurationStorage->get('mode') == 'sandbox' ? 'selected="selected"' : '',
            'mode_live_selected'
                => $this->configurationStorage->get('mode') == 'live' ? 'selected="selected"' : '',
            'clientid_live'
                => $this->configurationStorage->get('restapi-credentials/live/client_id'),
            'secret_live'
                => $this->configurationStorage->get('restapi-credentials/live/secret'),
            'clientid_sandbox'
                => $this->configurationStorage->get('restapi-credentials/sandbox/client_id'),
            'secret_sandbox'
                => $this->configurationStorage->get('restapi-credentials/sandbox/secret'),
            /*
            'activeExpProfileID'
                => $this->configurationStorage->get('payment_experience_profile_id'),
            */
            'use_paypal_plus'
                => $this->configurationStorage->get('use_paypal_plus'),
            'use_ecs_cart'
                => $this->configurationStorage->get('use_ecs_cart'),
            'use_ecs_products'
                => $this->configurationStorage->get('use_ecs_products'),
            'allow_ecs_login'
                => $this->configurationStorage->get('allow_ecs_login'),
            'intent'
                => $this->configurationStorage->get('intent'),
            'ecs_button_style'
                => $this->configurationStorage->get('ecs_button_style'),
            'show_installments_presentment_specific_product'
                => $this->configurationStorage->get('show_installments_presentment_specific_product'),
            'show_installments_presentment_specific_cart'
                => $this->configurationStorage->get('show_installments_presentment_specific_cart'),
            'show_installments_presentment_specific_payment'
                => $this->configurationStorage->get('show_installments_presentment_specific_payment'),
            'show_installments_presentment_specific_computed'
                => $this->configurationStorage->get('show_installments_presentment_specific_computed'),
            'thirdparty_payments_invoice_mode'
                => $this->configurationStorage->get('thirdparty_payments/invoice/mode'),
            'thirdparty_payments_cod_mode'
                => $this->configurationStorage->get('thirdparty_payments/cod/mode'),
            'thirdparty_payments_moneyorder_mode'
                => $this->configurationStorage->get('thirdparty_payments/moneyorder/mode'),
            'thirdparty_payments_eustandardtransfer_mode'
                => $this->configurationStorage->get('thirdparty_payments/eustandardtransfer/mode'),
            'thirdparty_payments_cash_mode'
                => $this->configurationStorage->get('thirdparty_payments/cash/mode'),
            'logo_image'
                => $this->configurationStorage->get('logo/image'),
            'logo_position'
                => $this->configurationStorage->get('logo/position'),
            'orderstatus_completed'
                => $this->configurationStorage->get('orderstatus/completed'),
            'orderstatus_pending'
                => $this->configurationStorage->get('orderstatus/pending'),
            'orderstatus_error'
                => $this->configurationStorage->get('orderstatus/error'),
            'debug_logging'
                => $this->configurationStorage->get('debug_logging'),
            'webhook_id'
                => $webhook_id,
            'webhook_id_is_valid'
                => $webhook_id_is_valid,
            'webhook_test_url'
                => HTTPS_CATALOG_SERVER . DIR_WS_CATALOG. 'shop.php?do=PayPal/Webhook&test=accessibility',
            'webhooks'
                => array(),
            'status_update_url'
                => xtc_catalog_href_link('shop.php', 'do=PayPal/StatusUpdate&key='.$secure_token.'&days=30'),
            'orders_status_list'
                => xtc_get_orders_status(),
            'ssl_enabled'
                => constant('ENABLE_SSL_CATALOG') === 'true' || constant('ENABLE_SSL_CATALOG') === true,
            'debug_output'
                => print_r($this->configurationStorage->get_all(), true),
            'allow_selfpickup'
                => $this->configurationStorage->get('allow_selfpickup'),
            'connect_check_url'
                => xtc_href_link('admin.php', 'do=PayPalConfiguration/ConnectCheck&check_connect=1&url='),
            'connect_check_urls'
                => array(
                    $this->configurationStorage->get('service_base_url/sandbox').'/v1/payments',
                    $this->configurationStorage->get('service_base_url/live').'/v1/payments'
                    ),
            'pui_invoice_hide_column'
                => $this->configurationStorage->get('pui_invoice_hide_column'),
        );
        $_SESSION[self::MESSAGES_NAMESPACE] = array();

        try
        {
            $this->valueArray['login_valid'] = $this->_checkCredentials();
        }
        catch(Exception $e)
        {
            $this->valueArray['login_valid'] = false;
            $this->valueArray['messages'][] = array('class' => 'error', 'text' => $this->paypalText->get_text('error_checking_credentials') .': '. $e->getMessage());
        }

        if($this->configurationStorage->get('mode') == 'sandbox')
        {
            $this->valueArray['messages'][] = array('class' => 'info', 'text' => $this->paypalText->get_text('warning_sandbox_mode_active'));
        }

        if(strpos(@constant('MODULE_PAYMENT_INSTALLED'), 'paypal3.php') === false)
        {
            $this->valueArray['messages'][] = array('class' => 'info', 'text' => $this->paypalText->get_text('payment_module_not_installed'));
        }
        elseif(!(@constant('MODULE_PAYMENT_PAYPAL3_STATUS') == 'True'))
        {
            $this->valueArray['messages'][] = array('class' => 'info', 'text' => $this->paypalText->get_text('payment_module_not_enabled'));
        }

        if(strpos(@constant('MODULE_PAYMENT_INSTALLED'), 'paypal3_installments.php') !== false)
        {
            if(strpos(@constant('MODULE_ORDER_TOTAL_INSTALLED'), 'ot_paypal3_instfee.php') === false)
            {
                $this->valueArray['messages'][] = array('class' => 'info', 'text' => $this->paypalText->get_text('instfee_module_not_installed'));
            }
        }

        if($includeExperienceProfiles === true)
        {
            $this->valueArray['experienceProfile'] = array();
            $noProfileLanguages = array();
            foreach($Language->catalog_languages as $iso2 => $langData)
            {
                $this->valueArray['experienceProfile'][$langData['code']] = $this->configurationStorage->get('payment_experience_profile/'.$langData['code']);
                if(empty($this->valueArray['experienceProfile'][$langData['code']]))
                {
                    $noProfileLanguages[] = $iso2;
                }
            }

            if(!empty($noProfileLanguages))
            {
                $this->valueArray['messages'][] = array('class' => 'info', 'text' => $this->paypalText->get_text('peps_missing').': '.implode(', ', $noProfileLanguages));
            }

            $defaultProfile = MainFactory::create('PayPalExperienceProfile');
            $this->valueArray['experienceProfilesList'] = array();
            $ppRestService = MainFactory::create('PayPalRestService');
            try
            {
                $experienceProfilesRequest = MainFactory::create('PayPalRestRequest', 'GET', '/v1/payment-experience/web-profiles');
                $experienceProfilesResponse = $ppRestService->performRequest($experienceProfilesRequest);
                $experienceProfilesList = $experienceProfilesResponse->getResponseObject();
                foreach($experienceProfilesList as $expProfileListKey => $expProfile)
                {
                    if(!in_array($expProfile->id, $this->valueArray['experienceProfile']))
                    {
                        continue;
                    }
                    if(
                        (int)$expProfile->input_fields->no_shipping != (int)$defaultProfile->no_shipping ||
                        (int)$expProfile->input_fields->address_override != (int)$defaultProfile->address_override
                    )
                    {
                        $experienceProfilesList[$expProfileListKey]->isOld = true;
                        $this->valueArray['messages'][] = array('class' => 'info', 'text' => $this->paypalText->get_text('old_experience_profile').': '.$expProfile->name.' ('.$expProfile->id.')');
                    }
                }
            }
            catch(Exception $e)
            {
                $this->logger->debug_notice(sprintf("Failed to retrieve web profiles.\nRequest: %s\nResponse: %s", (string)$ppRestService->getLastRequest(), (string)$ppRestService->getLastResponse()));
                $this->valueArray['messages'][] = array('class' => 'error', 'text' => $this->paypalText->get_text('error_retrieving_web_profiles') .': '. $e->getMessage());
                $experienceProfilesList = null;
            }
            $this->valueArray['experienceProfilesList'] = $experienceProfilesList;
        }

        if($this->_getQueryParameter('exp_id') !== null)
        {
            $this->valueArray['currentExpProfile'] = MainFactory::create_object('PayPalExperienceProfile');
            if($this->_getQueryParameter('exp_id') == 'new')
            {
                    $this->valueArray['edit_profile'] = true;
            }
            else
            {
                try
                {
                    $this->valueArray['edit_profile'] = true;
                    $this->valueArray['currentExpProfile'] = MainFactory::create('PayPalExperienceProfile', $this->_getQueryParameter('exp_id'));
                    $this->valueArray['currentExpProfileID'] = $this->_getQueryParameter('exp_id');
                }
                catch(Exception $e)
                {
                    $this->valueArray['edit_profile'] = false;
                }
            }
        }
        else
        {
            $this->valueArray['currentExpProfile'] = MainFactory::create_object('PayPalExperienceProfile');
            $this->valueArray['edit_profile'] = false;
        }

        $this->valueArray['webhooks'] = array();
        if($this->valueArray['login_valid'] == true)
        {
            try
            {
                $this->valueArray['webhooks'] = $webhookFactory->listAllWebhooks();
            }
            catch(Exception $e)
            {
                $this->valueArray['messages'][] = array('class' => 'info', 'text' => $this->paypalText->get_text('failed_to_retrieve_webhooks_list') .' ('. $e->getMessage() .')');
            }
        }

        $this->valueArray['flags'] = array();
        foreach($Language->catalog_languages as $iso => $langData)
        {
            $new_flag_file = '/lang/'.$langData['directory'].'/flag.png';
            $old_flag_file = '/lang/'.$langData['directory'].'/'.$langData['code'].'.png';
            if(file_exists(DIR_FS_CATALOG.$new_flag_file))
            {
                $this->valueArray['flags'][$langData['code']] = sprintf('<img src="%s" alt="%s">', HTTP_SERVER.DIR_WS_CATALOG.$new_flag_file, $langData['code']);
            }
            elseif(DIR_FS_CATALOG.file_exists($old_flag_file))
            {
                $this->valueArray['flags'][$langData['code']] = sprintf('<img src="%s" alt="%s">', HTTP_SERVER.DIR_WS_CATALOG.$old_flag_file, $langData['code']);
            }
            else
            {
                $this->valueArray['flags'][$langData['code']] = sprintf('[%s]', $langData['code']);
            }
        }
    }

    /**
     * Check REST service credentials
     * by retrieving an access token
     */
    protected function _checkCredentials()
    {
        unset($_SESSION['paypal_access_token']);
        unset($_SESSION['paypal_access_token_expiration']);
        $credentialsValid = false;
        $ppRestRequest = MainFactory::create('PayPalRestRequest', 'GET', '');
        $credentialsValid = true;
        return $credentialsValid;
    }


}
API documentation generated by ApiGen