├── src ├── Storefront │ ├── Content │ │ ├── Styles │ │ │ ├── Plugins │ │ │ │ ├── CustomerAccount.css │ │ │ │ ├── OffersCatalog.css │ │ │ │ ├── PaymentSetup.css │ │ │ │ ├── CustomerManagementSetup.css │ │ │ │ ├── ProcessOrder.css │ │ │ │ ├── RegistrationConfirmation.css │ │ │ │ ├── Error.css │ │ │ │ ├── BrandingSetup.css │ │ │ │ ├── AddSubscriptionsPage.css │ │ │ │ ├── CustomerRegistration.css │ │ │ │ ├── OfferTile.css │ │ │ │ ├── Subscriptions.css │ │ │ │ ├── AdminConsole.css │ │ │ │ ├── AddSubscriptions.css │ │ │ │ ├── UpdateSubscriptions.css │ │ │ │ ├── HomePage.css │ │ │ │ └── OfferList.css │ │ │ └── WebPortal │ │ │ │ ├── Login.css │ │ │ │ ├── ControlPanel.css │ │ │ │ ├── StandardSplashScreen.css │ │ │ │ ├── Actions.css │ │ │ │ ├── PrimaryNavigation.css │ │ │ │ ├── Dialog.css │ │ │ │ └── Notifications.css │ │ └── Images │ │ │ ├── Plugins │ │ │ ├── csv.png │ │ │ ├── ring.gif │ │ │ ├── banner.png │ │ │ ├── cloud.png │ │ │ ├── ripple.gif │ │ │ ├── home-icon.png │ │ │ ├── action-new.png │ │ │ ├── action-pick.png │ │ │ ├── action-save.png │ │ │ ├── action-undo.png │ │ │ ├── office-icon.png │ │ │ ├── action-delete.png │ │ │ ├── action-refresh.png │ │ │ ├── company-logo.jpg │ │ │ ├── office365-logo.png │ │ │ ├── Tiles │ │ │ │ ├── home-tile.png │ │ │ │ ├── account-tile.png │ │ │ │ ├── branding-tile.png │ │ │ │ ├── offers-tile.png │ │ │ │ ├── payment-tile.png │ │ │ │ ├── dashboard-tile.png │ │ │ │ └── subscriptions-tile.png │ │ │ ├── office-products.png │ │ │ └── ProductLogos │ │ │ │ ├── azure-logo.png │ │ │ │ ├── intune-logo.png │ │ │ │ ├── office-logo.png │ │ │ │ ├── skype-logo.png │ │ │ │ ├── visio-logo.png │ │ │ │ ├── yammer-logo.png │ │ │ │ ├── dynamics-logo.png │ │ │ │ ├── exchange-logo.png │ │ │ │ ├── onedrive-logo.png │ │ │ │ ├── project-logo.png │ │ │ │ ├── microsoft-logo.png │ │ │ │ └── sharepoint-logo.png │ │ │ └── WebPortal │ │ │ ├── back.png │ │ │ ├── help.png │ │ │ ├── tick.png │ │ │ ├── avatar.png │ │ │ ├── cross.png │ │ │ ├── forward.png │ │ │ ├── refresh.png │ │ │ ├── search.png │ │ │ ├── ellipsis.png │ │ │ ├── attach-black.png │ │ │ ├── back-large.png │ │ │ ├── cross-black.png │ │ │ ├── down-arrow.png │ │ │ ├── mCSB_buttons.png │ │ │ ├── plus-black.png │ │ │ ├── sorted-asc.png │ │ │ ├── sorted-desc.png │ │ │ ├── tick-black.png │ │ │ ├── notifications.png │ │ │ ├── notification-info.png │ │ │ ├── notification-error.png │ │ │ ├── notification-progress.gif │ │ │ ├── notification-success.png │ │ │ └── notification-warning.png │ ├── favicon.ico │ ├── Global.asax │ ├── Views │ │ ├── Shared │ │ │ ├── UpdateCompanyInformation.cshtml │ │ │ ├── UpdateContactInformation.cshtml │ │ │ ├── Error.cshtml │ │ │ ├── FrameworkFragments.cshtml │ │ │ ├── StandardSplashScreen.cshtml │ │ │ ├── AddSubscriptions.cshtml │ │ │ ├── CustomerRegistration.cshtml │ │ │ ├── Home.cshtml │ │ │ ├── AdminConsole.cshtml │ │ │ └── RegistrationConfirmation.cshtml │ │ ├── Controls │ │ │ ├── OffersCatalog.cshtml │ │ │ └── OfferTile.cshtml │ │ ├── Home │ │ │ └── Error.cshtml │ │ ├── Services │ │ │ ├── ControlPanel.cshtml │ │ │ ├── PrimaryNavigation.cshtml │ │ │ ├── Login.cshtml │ │ │ ├── Dialog.cshtml │ │ │ ├── Notifications.cshtml │ │ │ └── Actions.cshtml │ │ └── Web.config │ ├── Scripts │ │ ├── Plugins │ │ │ ├── CommerceOperationType.js │ │ │ ├── UpdateCompanyInformationPresenter.js │ │ │ ├── UpdateContactInformationPresenter.js │ │ │ └── ErrorCode.js │ │ └── WebPortal │ │ │ ├── Dependencies │ │ │ └── appinsights.js │ │ │ ├── Services │ │ │ ├── HeaderBar │ │ │ │ ├── ActionsSection.js │ │ │ │ ├── HeaderBarSection.js │ │ │ │ ├── UserSection.js │ │ │ │ └── NotificationsSection.js │ │ │ └── Login │ │ │ │ └── Login.js │ │ │ ├── Views │ │ │ └── List │ │ │ │ ├── IListEventListener.js │ │ │ │ └── Column.js │ │ │ ├── Infrastructure │ │ │ └── Settings.js │ │ │ └── Utilities │ │ │ └── Throttler.js │ ├── libman.json │ ├── Security │ │ ├── IAccessTokenProvider.cs │ │ └── AccessTokenProvider.cs │ ├── Settings.StyleCop │ ├── Models │ │ ├── ContactUsInformation.cs │ │ ├── RoleModel.cs │ │ ├── MicrosoftOffer.cs │ │ ├── OfferCatalogViewModel.cs │ │ ├── CommerceOperationType.cs │ │ ├── Validators │ │ │ └── ExpiryDateInTenYearsAttribute.cs │ │ ├── ManagedSubscriptionsViewModel.cs │ │ ├── SubscriptionsSummary.cs │ │ ├── AdminConsoleViewModel.cs │ │ ├── PaymentConfiguration.cs │ │ ├── CustomerUsageSubscriptionsModel.cs │ │ ├── PortalCustomer.cs │ │ ├── PartnerSubscriptionModel.cs │ │ ├── OrderViewModel.cs │ │ ├── SubscriptionHistory.cs │ │ ├── PreApprovedCustomersViewModel.cs │ │ ├── PurchaseLineItem.cs │ │ ├── PurchaseLineItemWithOffer.cs │ │ ├── OrderSubscriptionItemViewModel.cs │ │ ├── TransactionResult.cs │ │ ├── CustomerLicensesModel.cs │ │ ├── CustomerSubscriptionModel.cs │ │ ├── PartnerOffer.cs │ │ ├── CustomerSubscriptionEntity.cs │ │ ├── BrandingConfiguration.cs │ │ └── SubscriptionViewModel.cs │ ├── GlobalSuppressions.cs │ ├── Infrastructure │ │ ├── IBusinessTransactionWithOutput.cs │ │ ├── IBusinessTransactionWithInput.cs │ │ └── IBusinessTransaction.cs │ ├── Controllers │ │ ├── BaseController.cs │ │ └── AccountController.cs │ ├── BusinessLogic │ │ ├── Commerce │ │ │ ├── PaymentGateways │ │ │ │ ├── PayUMoney │ │ │ │ │ ├── PaymentResponseResult.cs │ │ │ │ │ ├── TransactionResult.cs │ │ │ │ │ ├── PaymentResponse.cs │ │ │ │ │ ├── TransactionStatusResponse.cs │ │ │ │ │ ├── RefundResponse.cs │ │ │ │ │ └── Constant.cs │ │ │ │ └── PaymentGatewayConfig.cs │ │ │ └── ICommerceOperations.cs │ │ ├── IVaultService.cs │ │ ├── IGraphClient.cs │ │ └── DomainObject.cs │ ├── Startup.cs │ ├── Filters │ │ ├── UserRole.cs │ │ ├── Mvc │ │ │ ├── AiHandleErrorAttribute.cs │ │ │ ├── AuthenticationFilterAttribute.cs │ │ │ └── AuthorizeAttribute.cs │ │ ├── WebApi │ │ │ ├── PortalAuthorizeAttribute.cs │ │ │ └── AuthenticationFilterAttribute.cs │ │ └── AuthorizationPolicy.cs │ ├── Configuration │ │ ├── Manager │ │ │ ├── IWebPortalConfigurationFactory.cs │ │ │ └── WebPortalConfigurationFactory.cs │ │ └── Web Portal │ │ │ └── CoreSegment.cs │ ├── App_Start │ │ ├── RouteConfig.cs │ │ ├── WebApiConfig.cs │ │ └── FilterConfig.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Telemetry │ │ ├── ITelemetryProvider.cs │ │ └── EmptyTelemetryProvider.cs │ └── StringExtensions.cs └── Deployment │ ├── WebSite.parameters.json │ └── Deployment.deployproj ├── .github ├── PULL_REQUEST_TEMPLATE.md └── ISSUE_TEMPLATE │ ├── FEATURE_REQUEST.md │ └── BUG_REPORT.md ├── CODE_OF_CONDUCT.md ├── azure-pipelines.yml ├── LICENSE ├── azuredeploy.param.json ├── Partner-Center-Storefront.sln └── .gitattributes /src/Storefront/Content/Styles/Plugins/CustomerAccount.css: -------------------------------------------------------------------------------- 1 | .Padded { 2 | padding: 15px; 3 | } -------------------------------------------------------------------------------- /src/Storefront/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/favicon.ico -------------------------------------------------------------------------------- /src/Storefront/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Microsoft.Store.PartnerCenter.Storefront.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/csv.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ring.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ring.gif -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/banner.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/cloud.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ripple.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ripple.gif -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/back.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/help.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/tick.png -------------------------------------------------------------------------------- /src/Storefront/Views/Shared/UpdateCompanyInformation.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "UpdateCompanyInformation"; 4 | } 5 | 6 |

UpdateCompanyInformation

7 | 8 | -------------------------------------------------------------------------------- /src/Storefront/Views/Shared/UpdateContactInformation.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "UpdateContactInformation"; 4 | } 5 | 6 |

UpdateContactInformation

7 | 8 | -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/home-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/home-icon.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/avatar.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/cross.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/forward.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/refresh.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/search.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/action-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/action-new.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/action-pick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/action-pick.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/action-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/action-save.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/action-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/action-undo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/office-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/office-icon.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/ellipsis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/ellipsis.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/action-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/action-delete.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/action-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/action-refresh.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/company-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/company-logo.jpg -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/office365-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/office365-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/attach-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/attach-black.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/back-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/back-large.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/cross-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/cross-black.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/down-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/down-arrow.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/mCSB_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/mCSB_buttons.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/plus-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/plus-black.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/sorted-asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/sorted-asc.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/sorted-desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/sorted-desc.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/tick-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/tick-black.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/Tiles/home-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/Tiles/home-tile.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/office-products.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/office-products.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/notifications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/notifications.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/Tiles/account-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/Tiles/account-tile.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/Tiles/branding-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/Tiles/branding-tile.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/Tiles/offers-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/Tiles/offers-tile.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/Tiles/payment-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/Tiles/payment-tile.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/notification-info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/notification-info.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/Tiles/dashboard-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/Tiles/dashboard-tile.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/notification-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/notification-error.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/azure-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/azure-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/intune-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/intune-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/office-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/office-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/skype-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/skype-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/visio-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/visio-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/yammer-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/yammer-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/Tiles/subscriptions-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/Tiles/subscriptions-tile.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/notification-progress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/notification-progress.gif -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/notification-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/notification-success.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/WebPortal/notification-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/WebPortal/notification-warning.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/dynamics-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/dynamics-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/exchange-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/exchange-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/onedrive-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/onedrive-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/project-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/project-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/microsoft-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/microsoft-logo.png -------------------------------------------------------------------------------- /src/Storefront/Content/Images/Plugins/ProductLogos/sharepoint-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PartnerCenterSamples/Reseller-Web-Application/HEAD/src/Storefront/Content/Images/Plugins/ProductLogos/sharepoint-logo.png -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Please add a meaningful description for this change. Ensure the PR has required unit tests. 4 | 5 | ## Related issue 6 | 7 | Kindly link any related issues (e.g. Fixes #xyz). 8 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/OffersCatalog.css: -------------------------------------------------------------------------------- 1 | .NewRow { 2 | clear: left; 3 | } 4 | 5 | .OfferCatalog { 6 | float: left; 7 | width: 280px; 8 | margin: 20px; 9 | } 10 | 11 | .OfferCatalog > div { 12 | min-height: 280px; 13 | } 14 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/PaymentSetup.css: -------------------------------------------------------------------------------- 1 | #PaymentForm { 2 | padding: 15px; 3 | } 4 | 5 | #PaymentForm > table { 6 | display: none; 7 | } 8 | 9 | #PaymentForm > table > tbody > tr > td { 10 | vertical-align: top; 11 | padding-bottom: 20px; 12 | } -------------------------------------------------------------------------------- /src/Storefront/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = Resources.ErrorPageTitleCaption; 5 | } 6 | 7 |

@Resources.ErrorPageTitleCaption

8 |

@Resources.ErrorPageDetailsCaption

9 | 10 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/CustomerManagementSetup.css: -------------------------------------------------------------------------------- 1 | #CustomerPreApprovalForm { 2 | padding: 15px; 3 | } 4 | 5 | #CustomerPreApprovalForm > table { 6 | display: none; 7 | } 8 | 9 | #CustomerPreApprovalForm > table > tbody > tr > td { 10 | vertical-align: top; 11 | padding-bottom: 20px; 12 | } -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/ProcessOrder.css: -------------------------------------------------------------------------------- 1 | #ProcessOrderContainer { 2 | margin: 15px; 3 | } 4 | 5 | .confirmation-done-button { 6 | margin-top: 20px; 7 | display: inline-block; 8 | } 9 | 10 | .confirmation-table { 11 | min-width: 500px; 12 | } 13 | 14 | .confirmation-total { 15 | font-weight: 700; 16 | font-size: 16px; 17 | } 18 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/RegistrationConfirmation.css: -------------------------------------------------------------------------------- 1 | #RegistrationConfirmationContainer { 2 | margin: 15px; 3 | } 4 | 5 | .confirmation-done-button { 6 | margin-top: 20px; 7 | display: inline-block; 8 | } 9 | 10 | .confirmation-table { 11 | min-width: 500px; 12 | } 13 | 14 | .confirmation-total { 15 | font-weight: 700; 16 | font-size: 16px; 17 | } 18 | -------------------------------------------------------------------------------- /src/Storefront/Views/Controls/OffersCatalog.cshtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/WebPortal/Login.css: -------------------------------------------------------------------------------- 1 | .login-container { 2 | margin: 0px auto; 3 | width: 1px; 4 | text-align: left; 5 | } 6 | 7 | .user-name-cell { 8 | text-align: left; 9 | width: 400px; 10 | } 11 | 12 | .login-input { 13 | width: 400px; 14 | height: 30px; 15 | } 16 | 17 | .password-cell { 18 | padding-top: 15px; 19 | } 20 | 21 | .error { 22 | color: red; 23 | height: 25px; 24 | } 25 | -------------------------------------------------------------------------------- /src/Storefront/Scripts/Plugins/CommerceOperationType.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.CommerceOperationType = { 2 | 3 | /// 4 | /// A brand new purchase. 5 | /// 6 | NewPurchase:0, 7 | 8 | /// 9 | /// Purchase of additional seats for an existing subscription. 10 | /// 11 | AdditionalSeatsPurchase:1, 12 | 13 | /// 14 | /// Existing subscription renewal. 15 | /// 16 | Renewal:2 17 | } 18 | 19 | //@ sourceURL=CommerceOperationType.js -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/Error.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-image: radial-gradient(rgb(40, 40, 40), rgb(0, 128, 128)); 3 | text-align: center; 4 | padding-top: 200px; 5 | font-family: "Segoe UI"; 6 | } 7 | 8 | body > div { 9 | color: white; 10 | display: inline; 11 | font-weight: 100; 12 | } 13 | 14 | .organizationName { 15 | font-size: 80px; 16 | } 17 | 18 | .errorMessage { 19 | font-size: 28px; 20 | } 21 | 22 | .links { 23 | font-size: 20px; 24 | } 25 | 26 | .links a { 27 | color: white; 28 | } 29 | -------------------------------------------------------------------------------- /src/Storefront/Views/Shared/FrameworkFragments.cshtml: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 | 6 | @* Render framework services, views and plugins UI templates *@ 7 | @foreach (string template in ViewBag.Templates) 8 | { 9 | Html.RenderPartial(template); 10 | } 11 | 12 | @if (!HttpContext.Current.IsDebuggingEnabled) 13 | { 14 | @* We are in release mode, render the non start up classes now and send them to the browser *@ 15 | @Scripts.Render("~/WebPortalClasses/") 16 | } 17 | -------------------------------------------------------------------------------- /src/Storefront/Views/Home/Error.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 |
13 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | # Feature Request 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I am always frustrated when [...] 11 | 12 | **Describe the solution you would like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you have considered** 16 | A clear and concise description of any alternative solutions or features you have considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. -------------------------------------------------------------------------------- /src/Storefront/Views/Services/ControlPanel.cshtml: -------------------------------------------------------------------------------- 1 |
2 | 3 | 13 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/WebPortal/ControlPanel.css: -------------------------------------------------------------------------------- 1 | /* Control panel styles */ 2 | 3 | #ControlPanel { 4 | display: block; 5 | position: absolute; 6 | float: left; 7 | height: calc(100% - 41px); 8 | width: 0; 9 | min-height: 400px; 10 | color: #B5B5B5; 11 | background-color: #333333; 12 | z-index: 2; 13 | min-height: 559px; 14 | overflow: auto; 15 | } 16 | 17 | #ContextualControlArea { 18 | padding: 3px; 19 | display: none; 20 | } 21 | 22 | .Backbutton { 23 | display: block; 24 | margin-left: auto; 25 | margin-right: auto; 26 | cursor: pointer; 27 | opacity: 0.7; 28 | } 29 | 30 | .Backbutton:hover { 31 | opacity: 1; 32 | } 33 | -------------------------------------------------------------------------------- /src/Storefront/libman.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "defaultProvider": "cdnjs", 4 | "libraries": [ 5 | { 6 | "provider": "cdnjs", 7 | "library": "jquery@2.2.4", 8 | "destination": "Scripts/WebPortal/Dependencies/", 9 | "files": [ 10 | "jquery.min.js", 11 | "jquery.js" 12 | ] 13 | }, 14 | { 15 | "library": "jqueryui@1.12.1", 16 | "destination": "Scripts/WebPortal/Dependencies/", 17 | "files": [ 18 | "jquery-ui.min.js", 19 | "jquery-ui.js" 20 | ] 21 | }, 22 | { 23 | "provider": "cdnjs", 24 | "library": "knockout@3.4.2", 25 | "destination": "Scripts/WebPortal/Dependencies/" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG_REPORT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | # Steps to reproduce 8 | 9 | > What steps can reproduce the defect? 10 | > Please share the setup, commandline for vstest.console, sample project, target 11 | > framework etc. 12 | 13 | ## Expected behavior 14 | 15 | > Share the expected output 16 | 17 | ## Actual behavior 18 | 19 | > What is the behavior observed? 20 | 21 | ## Diagnostic logs 22 | 23 | > Please share test platform diagnostics logs. 24 | > The logs may contain test assembly paths, kindly review and mask those before sharing. 25 | 26 | ## Environment 27 | 28 | > Please share additional details about your environment. 29 | > Version -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/BrandingSetup.css: -------------------------------------------------------------------------------- 1 | #GrandBrandingContainer { 2 | padding: 15px; 3 | } 4 | 5 | #BrandingContainer { 6 | display: none; 7 | } 8 | #BrandingContainer > tbody > tr > td { 9 | vertical-align: top; 10 | padding-bottom: 20px; 11 | } 12 | 13 | #BrandingContainer input[type=file] { 14 | display: none; 15 | } 16 | 17 | #BrandingContainer #ContactUsPhone { 18 | margin-right: 10px; 19 | } 20 | 21 | #BrandingContainer #ContactUsEmailLabel { 22 | margin-right: 10px; 23 | } 24 | 25 | #BrandingContainer #ContactSalesPhone { 26 | margin-right: 10px; 27 | } 28 | 29 | #BrandingContainer #ContactSalesEmailLabel { 30 | margin-right: 10px; 31 | } 32 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/AddSubscriptionsPage.css: -------------------------------------------------------------------------------- 1 | #AddSubscriptionsPageContainer { 2 | margin: 20px; 3 | } 4 | 5 | #AddSubscriptionsPageContainer .product-title { 6 | font-size: 40px; 7 | font-weight: 100; 8 | margin-bottom: 10px; 9 | display: inline-block; 10 | } 11 | 12 | #AddSubscriptionsPageContainer .add-subscriptions-label { 13 | font-size: 20px; 14 | font-weight: 100; 15 | display: inline-block; 16 | } 17 | 18 | #AddSubscriptionsPageContainer #AddSubscriptionsViewContainer { 19 | margin-top: 30px; 20 | margin-bottom: 30px; 21 | } 22 | 23 | #AddSubscriptionsPageContainer #SubmitButton { 24 | margin-top: 20px; 25 | display: inline-block; 26 | } 27 | -------------------------------------------------------------------------------- /src/Storefront/Security/IAccessTokenProvider.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Security 8 | { 9 | using System; 10 | using System.Threading.Tasks; 11 | using IdentityModel.Clients.ActiveDirectory; 12 | 13 | public interface IAccessTokenProvider 14 | { 15 | Task GetAccessTokenAsync(string authority, string authorizationCode, Uri redirectUri, ClientCredential clientCredential, string resource); 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | - master 3 | 4 | pool: 5 | vmImage: 'VS2017-Win2016' 6 | 7 | variables: 8 | solution: '**/*.sln' 9 | buildPlatform: 'Any CPU' 10 | buildConfiguration: 'Release' 11 | 12 | steps: 13 | - task: NuGetToolInstaller@0 14 | 15 | - task: NuGetCommand@2 16 | inputs: 17 | restoreSolution: '$(solution)' 18 | 19 | - task: VSBuild@1 20 | inputs: 21 | solution: '$(solution)' 22 | msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"' 23 | platform: '$(buildPlatform)' 24 | configuration: '$(buildConfiguration)' 25 | 26 | - task: VSTest@2 27 | inputs: 28 | platform: '$(buildPlatform)' 29 | configuration: '$(buildConfiguration)' -------------------------------------------------------------------------------- /src/Storefront/Settings.StyleCop: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | cloneable 5 | 6 | False 7 | 8 | 9 | 10 | 11 | False 12 | 13 | \.g\.cs$ 14 | \.generated\.cs$ 15 | \.g\.i\.cs$ 16 | TemporaryGeneratedFile_.*\.cs$ 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Storefront/Views/Services/PrimaryNavigation.cshtml: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 16 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/CustomerRegistration.css: -------------------------------------------------------------------------------- 1 | #CustomerRegistrationContainer { 2 | margin: 15px; 3 | } 4 | 5 | #CustomerRegistrationContainer .product-title { 6 | font-size: 40px; 7 | font-weight: 100; 8 | margin-bottom: 10px; 9 | display: inline-block; 10 | } 11 | 12 | #CustomerRegistrationContainer .feature-title { 13 | font-size: 20px; 14 | font-weight: 100; 15 | display: inline-block; 16 | } 17 | 18 | #CustomerRegistrationContainer #AddSubscriptionsViewContainer { 19 | margin-top: 30px; 20 | margin-bottom: 30px; 21 | } 22 | 23 | #CustomerRegistrationContainer #Consent { 24 | margin-left: 0px; 25 | } 26 | 27 | #CustomerRegistrationContainer #SubmitButton { 28 | margin-top: 20px; 29 | display: inline-block; 30 | } 31 | -------------------------------------------------------------------------------- /src/Storefront/Models/ContactUsInformation.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// Holds contact us information. 11 | /// 12 | public class ContactUsInformation 13 | { 14 | /// 15 | /// Gets or sets the email address. 16 | /// 17 | public string Email { get; set; } 18 | 19 | /// 20 | /// Gets or sets the phone number. 21 | /// 22 | public string Phone { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Storefront/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | 2 | // This file is used by Code Analysis to maintain SuppressMessage 3 | // attributes that are applied to this project. 4 | // Project-level suppressions either have no target or are given 5 | // a specific target and scoped to a namespace, type, member, etc. 6 | 7 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "This is the excepted name of the function.", Scope = "member", Target = "~M:Microsoft.Store.PartnerCenter.Storefront.MvcApplication.Application_Error(System.Object,System.EventArgs)")] 8 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "This is the expceted name of the function.", Scope = "member", Target = "~M:Microsoft.Store.PartnerCenter.Storefront.MvcApplication.Application_Start")] 9 | 10 | -------------------------------------------------------------------------------- /src/Storefront/Infrastructure/IBusinessTransactionWithOutput.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Infrastructure 8 | { 9 | /// 10 | /// A transaction that has an output. 11 | /// 12 | /// The type of data returned when the transaction is executed. 13 | public interface IBusinessTransactionWithOutput : IBusinessTransaction 14 | { 15 | /// 16 | /// Gets the transaction execution result. 17 | /// 18 | TOutput Result { get; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Storefront/Models/RoleModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// Represents a role in the application utilized to grant permissions. 11 | /// 12 | public class RoleModel 13 | { 14 | /// 15 | /// Gets or sets the description for the role. 16 | /// 17 | public string Description { get; set; } 18 | 19 | /// 20 | /// Gets or sets the name associated with the role. 21 | /// 22 | public string DisplayName { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Storefront/Controllers/BaseController.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Controllers 8 | { 9 | using System.Web; 10 | using System.Web.Http; 11 | using BusinessLogic; 12 | 13 | /// 14 | /// The base web API controller. All web API controllers should inherit from this class. 15 | /// 16 | public class BaseController : ApiController 17 | { 18 | /// 19 | /// Gets the signed in user principal. 20 | /// 21 | protected CustomerPortalPrincipal Principal => HttpContext.Current.User as CustomerPortalPrincipal; 22 | } 23 | } -------------------------------------------------------------------------------- /src/Storefront/Infrastructure/IBusinessTransactionWithInput.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Infrastructure 8 | { 9 | using System; 10 | 11 | /// 12 | /// A transaction that needs an input to execute. 13 | /// 14 | /// The type of input. 15 | public interface IBusinessTransactionWithInput : IBusinessTransaction 16 | { 17 | /// 18 | /// Gets a callback function which will be invoked to retrieve the input. 19 | /// 20 | Func AcquireInput { get; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Storefront/Models/MicrosoftOffer.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System; 10 | using PartnerCenter.Models.Offers; 11 | 12 | /// 13 | /// Represents a Microsoft offer. 14 | /// 15 | public class MicrosoftOffer 16 | { 17 | /// 18 | /// Gets or sets the Microsoft offer details. 19 | /// 20 | public Offer Offer { get; set; } 21 | 22 | /// 23 | /// Gets or sets the offer's thumbnail URI. 24 | /// 25 | public Uri ThumbnailUri { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Storefront/Views/Shared/StandardSplashScreen.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/Commerce/PaymentGateways/PayUMoney/PaymentResponseResult.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.Commerce.PaymentGateways.PayUMoney 8 | { 9 | /// 10 | /// result class 11 | /// 12 | public class PaymentResponseResult 13 | { 14 | /// 15 | /// Gets or sets merchant transaction id 16 | /// 17 | public string MerchantTransactionId { get; set; } 18 | 19 | /// 20 | /// Gets or sets post back 21 | /// 22 | public PostBackParameters PostBackParam { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Storefront/Startup.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | [assembly: Microsoft.Owin.OwinStartupAttribute(typeof(Microsoft.Store.PartnerCenter.Storefront.Startup))] 8 | 9 | namespace Microsoft.Store.PartnerCenter.Storefront 10 | { 11 | using global::Owin; 12 | 13 | /// 14 | /// Manages the application start up. 15 | /// 16 | public partial class Startup 17 | { 18 | /// 19 | /// Configured the application. 20 | /// 21 | /// The application. 22 | public void Configuration(IAppBuilder application) 23 | { 24 | this.ConfigureAuth(application); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Storefront/Models/OfferCatalogViewModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System.Collections.Generic; 10 | 11 | /// 12 | /// The offer catalog view model. 13 | /// 14 | public class OfferCatalogViewModel 15 | { 16 | /// 17 | /// Gets or sets the partner offers. 18 | /// 19 | public IEnumerable Offers { get; set; } 20 | 21 | /// 22 | /// Gets or sets a value indicating whether the portal has been configured or not. 23 | /// 24 | public bool IsPortalConfigured { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Storefront/Filters/UserRole.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Filters 8 | { 9 | /// 10 | /// Defines different user roles. 11 | /// 12 | public enum UserRole 13 | { 14 | /// 15 | /// A customer of the partner. 16 | /// 17 | Customer, 18 | 19 | /// 20 | /// A partner user. 21 | /// 22 | Partner, 23 | 24 | /// 25 | /// A customer or a partner. 26 | /// 27 | Any, 28 | 29 | /// 30 | /// An unauthenticated user. 31 | /// 32 | None 33 | } 34 | } -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/IVaultService.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic 8 | { 9 | using System.Security; 10 | using System.Threading.Tasks; 11 | 12 | /// 13 | /// Represents a secure mechanism for retrieving sensitive information. 14 | /// 15 | public interface IVaultService 16 | { 17 | /// 18 | /// Gets the specified entity from the vault. 19 | /// 20 | /// Identifier of the entity to be retrieved. 21 | /// The value retrieved from the vault. 22 | Task GetAsync(string identifier); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Storefront/Models/CommerceOperationType.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// Enumerates the types of commerce operations done by the portal. 11 | /// 12 | public enum CommerceOperationType 13 | { 14 | /// 15 | /// A brand new purchase. 16 | /// 17 | NewPurchase, 18 | 19 | /// 20 | /// Purchase of additional seats for an existing subscription. 21 | /// 22 | AdditionalSeatsPurchase, 23 | 24 | /// 25 | /// Existing subscription renewal. 26 | /// 27 | Renewal 28 | } 29 | } -------------------------------------------------------------------------------- /src/Storefront/Infrastructure/IBusinessTransaction.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Infrastructure 8 | { 9 | using System.Threading.Tasks; 10 | 11 | /// 12 | /// Represents an atomic business transaction which can be rolled back in case there was a failure. 13 | /// 14 | public interface IBusinessTransaction 15 | { 16 | /// 17 | /// Executes the transaction. 18 | /// 19 | /// A task. 20 | Task ExecuteAsync(); 21 | 22 | /// 23 | /// Rolls back the transaction. 24 | /// 25 | /// A task. 26 | Task RollbackAsync(); 27 | } 28 | } -------------------------------------------------------------------------------- /src/Storefront/Configuration/Manager/IWebPortalConfigurationFactory.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Configuration.Manager 8 | { 9 | /// 10 | /// Creates instances. 11 | /// 12 | public interface IWebPortalConfigurationFactory 13 | { 14 | /// 15 | /// Creates a new instance. 16 | /// 17 | /// The web portal configuration file path. 18 | /// A new web portal configuration manager instance. 19 | WebPortalConfigurationManager Create(string configurationFilePath); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Storefront/Models/Validators/ExpiryDateInTenYearsAttribute.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models.Validators 8 | { 9 | using System; 10 | using System.ComponentModel.DataAnnotations; 11 | 12 | /// 13 | /// The Credit Card Expiry date range validation attribute. 14 | /// 15 | [AttributeUsage(AttributeTargets.Property)] 16 | public class ExpiryDateInTenYearsAttribute : RangeAttribute 17 | { 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | public ExpiryDateInTenYearsAttribute() : base(DateTime.Now.Year, DateTime.Now.Year + 10) 22 | { 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Storefront/Models/ManagedSubscriptionsViewModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System.Collections.Generic; 10 | 11 | /// 12 | /// The managed subscriptions view model. 13 | /// 14 | public class ManagedSubscriptionsViewModel 15 | { 16 | /// 17 | /// Gets or sets the customers managed subscriptions 18 | /// 19 | public IEnumerable CustomerManagedSubscriptions { get; set; } 20 | 21 | /// 22 | /// Gets or sets the partner managed subscriptions 23 | /// 24 | public IEnumerable PartnerManagedSubscriptions { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/OfferTile.css: -------------------------------------------------------------------------------- 1 | .TileContainer { 2 | text-align: left; 3 | height: 100%; 4 | width: 100%; 5 | color: #464443; 6 | background-color: rgb(244,244,244); 7 | padding: 10px 2px 10px 2px 8 | } 9 | 10 | .TileContainer .Title { 11 | font-size: 20px; 12 | } 13 | 14 | .TileContainer .SubTitle { 15 | font-size: 16px; 16 | } 17 | 18 | .TileContainer .Features { 19 | font-size: 14px; 20 | font-weight: 100; 21 | } 22 | 23 | .TileContainer .PriceContainer { 24 | font-size: 28px; 25 | font-weight: 500; 26 | padding: 10px 0 10px 0; 27 | } 28 | 29 | .TileContainer .PerYear { 30 | font-size: 18px; 31 | font-weight: 300; 32 | } 33 | 34 | .TileContainer .BuyNow { 35 | font-size: 18px; 36 | font-weight: 100; 37 | } 38 | 39 | .TileSelected { 40 | background-color: rgb(90, 200, 220) !important; 41 | } 42 | 43 | .TileTitle { 44 | height: 70px; 45 | vertical-align: top; 46 | } 47 | 48 | .FeaturesContainer { 49 | padding: 10px 0 0 0; 50 | } -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/IGraphClient.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic 8 | { 9 | using System.Collections.Generic; 10 | using System.Threading.Tasks; 11 | using Models; 12 | 13 | /// 14 | /// Represents an object that interacts with Microsoft Azure AD Graph API. 15 | /// 16 | public interface IGraphClient 17 | { 18 | /// 19 | /// Gets a list of roles assigned to the specified object identifier. 20 | /// 21 | /// Object identifier for the object to be checked. 22 | /// A list of roles that that are associated with the specified object identifier. 23 | Task> GetDirectoryRolesAsync(string objectId); 24 | } 25 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /azuredeploy.param.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureStorageConnectionEndpointSuffix": { 3 | "value": "core.windows.net" 4 | }, 5 | "hostingPlanName": { 6 | "value": "Free" 7 | }, 8 | "partnerCenterApplicationId": { 9 | "value": "" 10 | }, 11 | "partnerCenterApplicationSecret": { 12 | "value": "" 13 | }, 14 | "partnerCenterAadTenantId": { 15 | "value": "" 16 | }, 17 | "webPortalClientId": { 18 | "value": "" 19 | }, 20 | "webPortalClientSecret": { 21 | "value": "" 22 | }, 23 | "webPortalAadTenantId": { 24 | "value": "" 25 | }, 26 | "siteName": { 27 | "value": "" 28 | }, 29 | "repoUrl": { 30 | "value": "https://github.com/PartnerCenterSamples/Reseller-Web-Application" 31 | }, 32 | "branch": { 33 | "value": "master" 34 | }, 35 | "aadAuthorityEndpoint": { 36 | "value": "https://login.microsoftonline.com/" 37 | }, 38 | "graphEndpoint": { 39 | "value": "https://graph.windows.net" 40 | }, 41 | "partnerCenterApiEndPoint": { 42 | "value": "https://api.partnercenter.microsoft.com" 43 | }, 44 | "skuName": { 45 | "value": "F1" 46 | }, 47 | "skuCapacity": { 48 | "value": 1 49 | } 50 | } -------------------------------------------------------------------------------- /src/Deployment/WebSite.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureStorageConnectionEndpointSuffix": { 3 | "value": "core.windows.net" 4 | }, 5 | "hostingPlanName": { 6 | "value": "Free" 7 | }, 8 | "partnerCenterApplicationId": { 9 | "value": "" 10 | }, 11 | "partnerCenterApplicationSecret": { 12 | "value": "" 13 | }, 14 | "partnerCenterAadTenantId": { 15 | "value": "" 16 | }, 17 | "webPortalClientId": { 18 | "value": "" 19 | }, 20 | "webPortalClientSecret": { 21 | "value": "" 22 | }, 23 | "webPortalAadTenantId": { 24 | "value": "" 25 | }, 26 | "siteName": { 27 | "value": "" 28 | }, 29 | "repoUrl": { 30 | "value": "https://github.com/Microsoft/Partner-Center-Storefront" 31 | }, 32 | "branch": { 33 | "value": "master" 34 | }, 35 | "aadAuthorityEndpoint": { 36 | "value": "https://login.microsoftonline.com/" 37 | }, 38 | "graphEndpoint": { 39 | "value": "https://graph.windows.net" 40 | }, 41 | "partnerCenterApiEndPoint": { 42 | "value": "https://api.partnercenter.microsoft.com" 43 | }, 44 | "skuName": { 45 | "value": "F1" 46 | }, 47 | "skuCapacity": { 48 | "value": 1 49 | } 50 | } -------------------------------------------------------------------------------- /src/Storefront/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront 8 | { 9 | using System.Web.Mvc; 10 | using System.Web.Routing; 11 | 12 | /// 13 | /// Holds routing configuration. 14 | /// 15 | public static class RouteConfig 16 | { 17 | /// 18 | /// Registers routes. 19 | /// 20 | /// A collection of routes. 21 | public static void RegisterRoutes(RouteCollection routes) 22 | { 23 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 24 | 25 | routes.MapRoute( 26 | name: "Default", 27 | url: "{controller}/{action}/{id}", 28 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Storefront/Scripts/WebPortal/Dependencies/appinsights.js: -------------------------------------------------------------------------------- 1 | var appInsights = window.appInsights || function (config) { 2 | function i(config) { t[config] = function () { var i = arguments; t.queue.push(function () { t[config].apply(t, i) }) } } var t = { config: config }, u = document, e = window, o = "script", s = "AuthenticatedUserContext", h = "start", c = "stop", l = "Track", a = l + "Event", v = l + "Page", y = u.createElement(o), r, f; y.src = config.url || "https://az416426.vo.msecnd.net/scripts/a/ai.0.js"; u.getElementsByTagName(o)[0].parentNode.appendChild(y); try { t.cookie = u.cookie } catch (p) { } for (t.queue = [], t.version = "1.0", r = ["Event", "Exception", "Metric", "PageView", "Trace", "Dependency"]; r.length;)i("track" + r.pop()); return i("set" + s), i("clear" + s), i(h + a), i(c + a), i(h + v), i(c + v), i("flush"), config.disableExceptionTracking || (r = "onerror", i("_" + r), f = e[r], e[r] = function (config, i, u, e, o) { var s = f && f(config, i, u, e, o); return s !== !0 && t["_" + r](config, i, u, e, o), s }), t 3 | } ({ 4 | instrumentationKey: portalResources.Keys.InstrumentationKey 5 | }); 6 | 7 | window.appInsights = appInsights; 8 | appInsights.trackPageView(); -------------------------------------------------------------------------------- /src/Storefront/Models/SubscriptionsSummary.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System.Collections.Generic; 10 | 11 | /// 12 | /// The subscription summary view model. 13 | /// 14 | public class SubscriptionsSummary 15 | { 16 | /// 17 | /// Gets or sets the subscription's in this summary. 18 | /// 19 | public IEnumerable Subscriptions { get; set; } 20 | 21 | /// 22 | /// Gets or sets the total amount for this subscription summary. 23 | /// 24 | public string SummaryTotal { get; set; } 25 | 26 | /// 27 | /// Gets or sets Customer view model 28 | /// 29 | public CustomerViewModel CustomerViewModel { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Storefront/Configuration/Manager/WebPortalConfigurationFactory.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Configuration.Manager 8 | { 9 | /// 10 | /// The default web portal configuration factory implementation. 11 | /// 12 | public class WebPortalConfigurationFactory : IWebPortalConfigurationFactory 13 | { 14 | /// 15 | /// Creates a new web portal configuration manager instance. 16 | /// 17 | /// The web portal configuration file path. 18 | /// A new web portal configuration manager instance. 19 | public WebPortalConfigurationManager Create(string configurationFilePath) 20 | { 21 | return new StandardWebPortalConfigurationManager(configurationFilePath); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/WebPortal/StandardSplashScreen.css: -------------------------------------------------------------------------------- 1 | .StandardSplashScreen { 2 | position: absolute; 3 | left: 0; 4 | right: 0; 5 | width: 100%; 6 | height: 100%; 7 | min-width: 1024px; 8 | min-height: 600px; 9 | background-image: radial-gradient(#63B4C3, #2984B2); 10 | background-repeat: round; 11 | display: none; 12 | } 13 | 14 | .StandardSplashScreen #Content { 15 | position: absolute; 16 | left: 5%; 17 | top: 50%; 18 | } 19 | 20 | .StandardSplashScreen #ProductTitle { 21 | color: white; 22 | font-size: 60px; 23 | font-weight: 400; 24 | } 25 | 26 | .StandardSplashScreen #PoweredBy { 27 | color: white; 28 | font-size: 16px; 29 | font-weight: 100; 30 | } 31 | 32 | .StandardSplashScreen #Message { 33 | color: white; 34 | font-size: 16px; 35 | font-weight: 100; 36 | padding-right: 10px; 37 | white-space: nowrap; 38 | } 39 | 40 | .StandardSplashScreen #LoadingIndicator { 41 | color: white; 42 | } 43 | 44 | .StandardSplashScreen #Retry { 45 | color: white; 46 | font-weight: 100; 47 | } -------------------------------------------------------------------------------- /src/Storefront/Models/AdminConsoleViewModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// The admin console view model. 11 | /// 12 | public class AdminConsoleViewModel 13 | { 14 | /// 15 | /// Gets or sets a value indicating whether the partner offers have been configured or not. 16 | /// 17 | public bool IsOffersConfigured { get; set; } 18 | 19 | /// 20 | /// Gets or sets a value indicating whether the website's branding has been configured or not. 21 | /// 22 | public bool IsBrandingConfigured { get; set; } 23 | 24 | /// 25 | /// Gets or sets a value indicating whether the website's payment options have been configured or not. 26 | /// 27 | public bool IsPaymentConfigured { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/Commerce/PaymentGateways/PayUMoney/TransactionResult.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.Commerce.PaymentGateways.PayUMoney 8 | { 9 | /// 10 | /// Transaction result class. 11 | /// 12 | public class TransactionResult 13 | { 14 | /// 15 | /// Gets or sets merchant transaction ID. 16 | /// 17 | public string MerchantTransactionId { get; set; } 18 | 19 | /// 20 | /// Gets or sets payment ID. 21 | /// 22 | public int PaymentId { get; set; } 23 | 24 | /// 25 | /// Gets or sets status. 26 | /// 27 | public string Status { get; set; } 28 | 29 | /// 30 | /// Gets or sets amount. 31 | /// 32 | public double Amount { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Storefront/Models/PaymentConfiguration.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// Holds payment configuration properties. 11 | /// 12 | public class PaymentConfiguration 13 | { 14 | /// 15 | /// Gets or sets the payment client Id. 16 | /// 17 | public string ClientId { get; set; } 18 | 19 | /// 20 | /// Gets or sets the payment client secret. 21 | /// 22 | public string ClientSecret { get; set; } 23 | 24 | /// 25 | /// Gets or sets the payment account type. 26 | /// 27 | public string AccountType { get; set; } 28 | 29 | /// 30 | /// Gets or sets the Web Experience Profile Id. 31 | /// 32 | public string WebExperienceProfileId { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/DomainObject.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic 8 | { 9 | /// 10 | /// The base class for all domain objects. 11 | /// 12 | public abstract class DomainObject 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// An application domain instance. 18 | protected DomainObject(ApplicationDomain applicationDomain) 19 | { 20 | applicationDomain.AssertNotNull(nameof(applicationDomain)); 21 | this.ApplicationDomain = applicationDomain; 22 | } 23 | 24 | /// 25 | /// Gets the application domain instance hosting all domain services. 26 | /// 27 | protected ApplicationDomain ApplicationDomain { get; private set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Storefront/Views/Shared/AddSubscriptions.cshtml: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 |
7 | 8 |

9 | @Resources.PlaceOrderCaption 10 | @Resources.Cancel 11 |
12 | 13 | 31 | 32 | 33 |
-------------------------------------------------------------------------------- /src/Storefront/Models/CustomerUsageSubscriptionsModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// The customer licenses view model. 11 | /// 12 | public class CustomerUsageSubscriptionsModel 13 | { 14 | /// 15 | /// Gets or sets the customer license Id. 16 | /// 17 | public string Id { get; set; } 18 | 19 | /// 20 | /// Gets or sets the friendly name. 21 | /// 22 | public string Name { get; set; } 23 | 24 | /// 25 | /// Gets or sets the customer license status like None, Active, Suspended or Deleted 26 | /// 27 | public string Status { get; set; } 28 | 29 | /// 30 | /// Gets or sets the license creation date. 31 | /// 32 | public string CreationDate { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/WebPortal/Actions.css: -------------------------------------------------------------------------------- 1 | .Actions { 2 | height: 100%; 3 | padding: 0; 4 | margin: 0; 5 | border-spacing: 0; 6 | border-collapse: separate; 7 | white-space: nowrap; 8 | } 9 | 10 | .Action { 11 | vertical-align: middle; 12 | display: none; 13 | font-weight: 400; 14 | font-size: 16px; 15 | color: white; 16 | padding: 1px; 17 | } 18 | 19 | .Action span { 20 | max-width: 300px; 21 | vertical-align: middle; 22 | overflow: hidden; 23 | text-overflow: ellipsis; 24 | white-space: nowrap; 25 | display: inline-block; 26 | } 27 | 28 | .Action img { 29 | vertical-align: middle; 30 | } 31 | 32 | .LeafActions { 33 | position: absolute; 34 | display: none; 35 | top: 41px; 36 | color: white; 37 | font-size: 14px; 38 | background-color: #333333; 39 | z-index: 100; 40 | margin-left: -1px; 41 | } 42 | 43 | .LeafActions td { 44 | max-width: 280px; 45 | min-width: 150px; 46 | width: 100%; 47 | overflow: hidden; 48 | text-overflow: ellipsis; 49 | white-space: nowrap; 50 | padding: 10px; 51 | } 52 | 53 | .ActionArrow { 54 | padding: 2px; 55 | transition: transform 300ms; 56 | } 57 | -------------------------------------------------------------------------------- /src/Storefront/Models/PortalCustomer.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// Represents Portal Customer 11 | /// 12 | public class PortalCustomer 13 | { 14 | /// 15 | /// Gets or sets a value indicating the partner center Id of the customer. 16 | /// 17 | public string TenantId { get; set; } 18 | 19 | /// 20 | /// Gets or sets a value indicating the Company Name of the customer. 21 | /// 22 | public string CompanyName { get; set; } 23 | 24 | /// 25 | /// Gets or sets a value indicating the Domain of the customer. 26 | /// 27 | public string Domain { get; set; } 28 | 29 | /// 30 | /// Gets or sets a value indicating whether the customer is pre approved for transactions. 31 | /// 32 | public bool IsPreApproved { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Storefront/Scripts/Plugins/UpdateCompanyInformationPresenter.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.UpdateCompanyInformationPresenter = function (webPortal, feature, context) { 2 | /// 3 | /// Manages the offers experience. 4 | /// 5 | /// The web portal instance. 6 | /// The feature for which this presenter is created. 7 | this.base.constructor.call(this, webPortal, feature, "Update company information", "/Template/"); 8 | }; 9 | 10 | // inherit BasePresenter 11 | $WebPortal.Helpers.inherit(Microsoft.WebPortal.UpdateCompanyInformationPresenter, Microsoft.WebPortal.Core.TemplatePresenter); 12 | 13 | Microsoft.WebPortal.UpdateCompanyInformationPresenter.prototype.onActivate = function () { 14 | /// 15 | /// Called when the presenter is activated. 16 | /// 17 | }; 18 | 19 | Microsoft.WebPortal.UpdateCompanyInformationPresenter.prototype.onRender = function () { 20 | /// 21 | /// Called when the presenter is about to be rendered. 22 | /// 23 | }; 24 | 25 | Microsoft.WebPortal.UpdateCompanyInformationPresenter.prototype.onShow = function () { 26 | /// 27 | /// Called when content is shown. 28 | /// 29 | }; 30 | 31 | //@ sourceURL=UpdateCompanyInformationPresenter.js -------------------------------------------------------------------------------- /src/Storefront/Scripts/Plugins/UpdateContactInformationPresenter.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.UpdateContactInformationPresenter = function (webPortal, feature, context) { 2 | /// 3 | /// Manages the offers experience. 4 | /// 5 | /// The web portal instance. 6 | /// The feature for which this presenter is created. 7 | this.base.constructor.call(this, webPortal, feature, "Update contact information", "/Template//"); 8 | }; 9 | 10 | // inherit BasePresenter 11 | $WebPortal.Helpers.inherit(Microsoft.WebPortal.UpdateContactInformationPresenter, Microsoft.WebPortal.Core.TemplatePresenter); 12 | 13 | Microsoft.WebPortal.UpdateContactInformationPresenter.prototype.onActivate = function () { 14 | /// 15 | /// Called when the presenter is activated. 16 | /// 17 | }; 18 | 19 | Microsoft.WebPortal.UpdateContactInformationPresenter.prototype.onRender = function () { 20 | /// 21 | /// Called when the presenter is about to be rendered. 22 | /// 23 | }; 24 | 25 | Microsoft.WebPortal.UpdateContactInformationPresenter.prototype.onShow = function () { 26 | /// 27 | /// Called when content is shown. 28 | /// 29 | }; 30 | 31 | //@ sourceURL=UpdateContactInformationPresenter.js -------------------------------------------------------------------------------- /src/Storefront/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront 8 | { 9 | using System.Web.Http; 10 | using System.Web.Mvc; 11 | using Models.Validators; 12 | 13 | /// 14 | /// Configures Web API routes. 15 | /// 16 | public static class WebApiConfig 17 | { 18 | /// 19 | /// Registers web API routes. 20 | /// 21 | /// HTTP configuration. 22 | public static void Register(HttpConfiguration configuration) 23 | { 24 | configuration.MapHttpAttributeRoutes(); 25 | 26 | DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(ExpiryDateInTenYearsAttribute), typeof(RangeAttributeAdapter)); 27 | 28 | configuration.Routes.MapHttpRoute( 29 | name: "DefaultApi", 30 | routeTemplate: "api/{controller}/{id}", 31 | defaults: new { id = RouteParameter.Optional }); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Storefront/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/Subscriptions.css: -------------------------------------------------------------------------------- 1 | #CustomerSubscriptionsContainer { 2 | } 3 | 4 | #CustomerSubscriptionsContainer .subscriptions-content { 5 | padding: 15px; 6 | } 7 | 8 | .subscriptions-title-row { 9 | width: 500px; 10 | position: relative; 11 | } 12 | 13 | .subscriptions-links { 14 | position: absolute; 15 | top: 42%; 16 | right: 0px; 17 | } 18 | 19 | .subscriptions-links a { 20 | margin-right: 5px; 21 | margin-left: 5px; 22 | font-size: 18px; 23 | font-weight: 400; 24 | } 25 | 26 | .subscriptions-total { 27 | font-weight: 700; 28 | font-size: 16px; 29 | } 30 | 31 | .collapse_up, 32 | .collapse_down { 33 | padding: 4px 21px 4px 4px; 34 | cursor: pointer; 35 | } 36 | 37 | .collapse_up { 38 | background: url(data:image/gif;base64,R0lGODlhCwALAJEAAAAAAP///xUVFf///yH5BAEAAAMALAAAAAALAAsAAAIRnC2nKLnT4or00Puy3rx7VQAAOw==) no-repeat center left !important; 39 | background-size: 15px; 40 | } 41 | 42 | .collapse_down { 43 | background: url(data:image/gif;base64,R0lGODlhCwALAJEAAAAAAP///xUVFf///yH5BAEAAAMALAAAAAALAAsAAAIPnI+py+0/hJzz0IruwjsVADs=) no-repeat center left !important; 44 | background-size: 15px; 45 | } 46 | 47 | 48 | tr.SubscriptionRow { 49 | display: table-row; 50 | } 51 | 52 | tr.SubscriptionHistoryRow { 53 | display: none; 54 | } 55 | 56 | .subscription-action { 57 | display: block; 58 | } 59 | -------------------------------------------------------------------------------- /src/Storefront/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/Commerce/PaymentGateways/PayUMoney/PaymentResponse.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.Commerce.PaymentGateways.PayUMoney 8 | { 9 | using System.Collections.Generic; 10 | 11 | /// 12 | /// PayUMoneyPaymentResponse class 13 | /// 14 | public class PaymentResponse 15 | { 16 | /// 17 | /// Gets or sets error code 18 | /// 19 | public string ErrorCode { get; set; } 20 | 21 | /// 22 | /// Gets or sets message code 23 | /// 24 | public string Message { get; set; } 25 | 26 | /// 27 | /// Gets or sets response code 28 | /// 29 | public string ResponseCode { get; set; } 30 | 31 | /// 32 | /// Gets or sets result 33 | /// 34 | public List Result { get; set; } 35 | 36 | /// 37 | /// Gets or sets status 38 | /// 39 | public string Status { get; set; } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Storefront/Models/PartnerSubscriptionModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// The partner subscription model 11 | /// 12 | public class PartnerSubscriptionModel 13 | { 14 | /// 15 | /// Gets or sets the customer license Id. 16 | /// 17 | public string Id { get; set; } 18 | 19 | /// 20 | /// Gets or sets the offer name. 21 | /// 22 | public string OfferName { get; set; } 23 | 24 | /// 25 | /// Gets or sets the customer license status like None, Active, Suspended or Deleted 26 | /// 27 | public string Status { get; set; } 28 | 29 | /// 30 | /// Gets or sets the total number of licenses for this customer license. 31 | /// 32 | public string Quantity { get; set; } 33 | 34 | /// 35 | /// Gets or sets the license creation date. 36 | /// 37 | public string CreationDate { get; set; } 38 | } 39 | } -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/AdminConsole.css: -------------------------------------------------------------------------------- 1 | #AdminConsoleContainer { 2 | width: 100%; 3 | margin-top: 60px; 4 | } 5 | 6 | #AdminConsoleContainer .WelcomeMessageContainer { 7 | margin: auto; 8 | text-align: center; 9 | white-space: nowrap; 10 | } 11 | 12 | #AdminConsoleContainer .WelcomeMessageContainer > label { 13 | font-size: 32px; 14 | } 15 | 16 | #AdminConsoleContainer .UserName { 17 | font-weight: 600; 18 | } 19 | 20 | #AdminConsoleContainer .Progress { 21 | margin: auto; 22 | text-align: center; 23 | } 24 | 25 | #AdminConsoleContainer .PromptMessage { 26 | margin: auto; 27 | font-size: 20px; 28 | text-align: center; 29 | padding-top: 20px; 30 | white-space: nowrap; 31 | } 32 | 33 | #AdminConsoleContainer .SetupSectionTitle { 34 | margin: auto; 35 | padding: 20px 0px 20px 0px; 36 | width: 1px; 37 | text-align: left; 38 | font-size: 18px; 39 | white-space: nowrap; 40 | } 41 | 42 | #AdminConsoleContainer .SetupSectionTitle label { 43 | color: rgb(41, 142, 186); 44 | vertical-align: top; 45 | float: left; 46 | font-weight: 100; 47 | } 48 | 49 | #AdminConsoleContainer .SetupSectionStatus { 50 | margin-top: 8px; 51 | vertical-align: bottom; 52 | float: right; 53 | } -------------------------------------------------------------------------------- /src/Storefront/Models/OrderViewModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System.Collections.Generic; 10 | using System.ComponentModel.DataAnnotations; 11 | 12 | /// 13 | /// The Order view model (orders contain subscriptions, CreditCard and optionally Customer Id). 14 | /// 15 | public class OrderViewModel 16 | { 17 | /// 18 | /// Gets or sets the Order Id. 19 | /// 20 | public string OrderId { get; set; } 21 | 22 | /// 23 | /// Gets or sets the Customer Id. 24 | /// 25 | public string CustomerId { get; set; } 26 | 27 | /// 28 | /// Gets or sets the subscriptions the customer ordered. 29 | /// 30 | [Required] 31 | public IEnumerable Subscriptions { get; set; } 32 | 33 | /// 34 | /// Gets or sets the Operation Type for the order. 35 | /// 36 | [Required] 37 | public CommerceOperationType OperationType { get; set; } 38 | } 39 | } -------------------------------------------------------------------------------- /src/Storefront/Models/SubscriptionHistory.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// The subscription history view model. 11 | /// 12 | public class SubscriptionHistory 13 | { 14 | /// 15 | /// Gets or sets number of seats bought for the subscription. 16 | /// 17 | public string SeatsBought { get; set; } 18 | 19 | /// 20 | /// Gets or sets the price at which the subscription was ordered. 21 | /// 22 | public string PricePerSeat { get; set; } 23 | 24 | /// 25 | /// Gets or sets the price at which the subscription was ordered. 26 | /// 27 | public string OrderTotal { get; set; } 28 | 29 | /// 30 | /// Gets or sets the transaction date. 31 | /// 32 | public string OrderDate { get; set; } 33 | 34 | /// 35 | /// Gets or sets the operation type (NewPurchase, AdditionalSeatsPurchase, Renewal) 36 | /// 37 | public string OperationType { get; set; } 38 | } 39 | } -------------------------------------------------------------------------------- /src/Storefront/Views/Services/Login.cshtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Storefront/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront 8 | { 9 | using System.Web.Http.Filters; 10 | using System.Web.Mvc; 11 | using Filters.Mvc; 12 | 13 | /// 14 | /// Configures application filters. 15 | /// 16 | public static class FilterConfig 17 | { 18 | /// 19 | /// Registers global MVC filters. 20 | /// 21 | /// The global MVC filter collection. 22 | public static void RegisterGlobalMvcFilters(GlobalFilterCollection filters) 23 | { 24 | filters.Add(new AuthenticationFilterAttribute()); 25 | filters.Add(new AiHandleErrorAttribute()); 26 | } 27 | 28 | /// 29 | /// Registers global Web API filters. 30 | /// 31 | /// The global web API filter collection. 32 | public static void RegisterWebApiFilters(HttpFilterCollection filters) 33 | { 34 | filters.Add(new Filters.WebApi.AuthenticationFilterAttribute()); 35 | filters.Add(new Filters.WebApi.ErrorHandlerAttribute()); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Storefront/Scripts/WebPortal/Services/HeaderBar/ActionsSection.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.Services.ActionsSection = function (webPortal) { 2 | /// 3 | /// Renders the actions the user can invoke on the current feature. 4 | /// 5 | /// The web portal instance. 6 | 7 | this.base.constructor.call(this, webPortal, webPortal.Settings.Ids.ActionsSection, "actionsHeaderBarSection-template"); 8 | 9 | // create and register the actions service 10 | this.actionBarSevice = new Microsoft.WebPortal.Services.ActionsService(this.webPortal, "Actions", "#" + webPortal.Settings.Ids.ActionsSection); 11 | this.webPortal.registerPortalService(this.actionBarSevice); 12 | }; 13 | 14 | $WebPortal.Helpers.inherit(Microsoft.WebPortal.Services.ActionsSection, Microsoft.WebPortal.Services.HeaderBarSection); 15 | 16 | Microsoft.WebPortal.Services.ActionsSection.prototype.initialize = function () { 17 | /// 18 | /// This function is called to initialize the header bar section. 19 | /// 20 | 21 | if (!this.webPortal.Services.Actions) { 22 | this.webPortal.registerPortalService(this.actionBarSevice); 23 | } 24 | }; 25 | 26 | Microsoft.WebPortal.Services.ActionsSection.prototype.destroy = function () { 27 | /// 28 | /// This function is called to destroy the header bar section. 29 | /// 30 | 31 | this.webPortal.deregisterPortalService(this.actionBarSevice); 32 | }; 33 | 34 | //@ sourceURL=ActionsSection.js -------------------------------------------------------------------------------- /src/Storefront/Models/PreApprovedCustomersViewModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System.Collections.Generic; 10 | 11 | /// 12 | /// Represents PreApproved Customers view model. 13 | /// 14 | public class PreApprovedCustomersViewModel 15 | { 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | public PreApprovedCustomersViewModel() 20 | { 21 | } 22 | 23 | /// 24 | /// Gets or sets a list of customers managed in the portal for pre approval. 25 | /// 26 | public IEnumerable Items { get; set; } 27 | 28 | /// 29 | /// Gets or sets a value indicating whether All customers in the portal are preapproved. 30 | /// 31 | public bool IsEveryCustomerPreApproved { get; set; } 32 | 33 | /// 34 | /// Gets or sets a list of customer identifiers which need to be preapproved. 35 | /// 36 | public List CustomerIds { get; set; } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Storefront/Scripts/WebPortal/Services/HeaderBar/HeaderBarSection.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.Services.HeaderBarSection = function (webPortal, id, template) { 2 | /// 3 | /// A base class that represents a section in the header bar. Extend this to implement your custom header bar sections. 4 | /// 5 | /// The web portal instance. 6 | /// The section id. 7 | /// The section template. 8 | 9 | if (!webPortal) { 10 | throw new Error("Microsoft.WebPortal.Services.HeaderBarSection: Invalid webPortal instance."); 11 | } 12 | 13 | this.webPortal = webPortal; 14 | 15 | this.webPortal.Helpers.throwIfNotSet(id, "id", "Microsoft.WebPortal.Services.HeaderBarSection.constructor."); 16 | this.webPortal.Helpers.throwIfNotSet(template, "template", "Microsoft.WebPortal.Services.HeaderBarSection.constructor."); 17 | 18 | this.id = ko.observable(id); 19 | this.template = ko.observable(template); 20 | this.style = ko.observable(""); 21 | }; 22 | 23 | Microsoft.WebPortal.Services.HeaderBarSection.prototype.initialize = function () { 24 | /// 25 | /// This function is called to initialize the header bar section. 26 | /// 27 | }; 28 | 29 | Microsoft.WebPortal.Services.HeaderBarSection.prototype.destroy = function () { 30 | /// 31 | /// This function is called to destroy the header bar section. 32 | /// 33 | }; 34 | 35 | //@ sourceURL=HeaderBarSection.js -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/WebPortal/PrimaryNavigation.css: -------------------------------------------------------------------------------- 1 | /* Primary Navigation Panel styles */ 2 | 3 | #PrimaryNavigation { 4 | position: absolute; 5 | width: 100%; 6 | z-index: 100; 7 | display: none; 8 | } 9 | 10 | #TileBasedPrimaryNavigation { 11 | left: 0; 12 | top: 41px; 13 | width: 100%; 14 | height: 190px; 15 | vertical-align: middle; 16 | overflow-y: hidden; 17 | overflow-x: auto; 18 | min-width: 1024px; 19 | background-color: rgba(51, 51, 51, 0.6); 20 | } 21 | 22 | #PrimaryNavigationTiles { 23 | position: absolute; 24 | padding-right: 30px; 25 | top: 50%; 26 | height: 130px; 27 | margin-top: -65px; 28 | white-space: nowrap; 29 | } 30 | 31 | .Tile { 32 | height: 130px; 33 | width: 120px; 34 | display: inline-block; 35 | margin-left: 20px; 36 | border: 3px solid rgba(51, 51, 51, 0); 37 | } 38 | 39 | .Tile:hover { 40 | border: 3px solid #626262; 41 | cursor: pointer; 42 | } 43 | 44 | .TileText { 45 | position: relative; 46 | display: block; 47 | top: 60px; 48 | left: 10px; 49 | width: 100px; 50 | color: white; 51 | font-size: 13px; 52 | font-weight: normal; 53 | overflow: hidden; 54 | text-overflow: ellipsis; 55 | white-space: nowrap; 56 | padding-top: 6px; 57 | } 58 | 59 | .TileImage { 60 | display: block; 61 | position: relative; 62 | top: 50%; 63 | left: 50%; 64 | width: 90px; 65 | height: 90px; 66 | margin-top: -45px; 67 | margin-left: -45px; 68 | } 69 | -------------------------------------------------------------------------------- /src/Storefront/Models/PurchaseLineItem.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// Holds the information for a new purchase line item. 11 | /// 12 | public class PurchaseLineItem 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// The partner's offer ID to purchase. 18 | /// The quantity to purchase. 19 | public PurchaseLineItem(string partnerOfferId, int quantity) 20 | { 21 | partnerOfferId.AssertNotEmpty(nameof(partnerOfferId)); 22 | quantity.AssertPositive(nameof(quantity)); 23 | 24 | this.PartnerOfferId = partnerOfferId; 25 | this.Quantity = quantity; 26 | } 27 | 28 | /// 29 | /// Gets the partner's offer ID to purchase. 30 | /// 31 | public string PartnerOfferId { get; private set; } 32 | 33 | /// 34 | /// Gets the quantity to purchase. 35 | /// 36 | public int Quantity { get; private set; } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Storefront/Scripts/WebPortal/Services/HeaderBar/UserSection.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.Services.UserSection = function (webPortal, loggedInUser) { 2 | /// 3 | /// Renders the user information section in the header bar. Displays the user name and avatar icon and manages the user menu. 4 | /// 5 | /// The web portal instance. 6 | 7 | this.base.constructor.call(this, webPortal, "UserInfoSection", "userSection-template"); 8 | 9 | this.loggedInUser = loggedInUser; 10 | 11 | // create and register the actions service 12 | this.userMenuSevice = ko.observable(null); 13 | //this.webPortal.registerPortalService(this.userMenuSevice); 14 | }; 15 | 16 | $WebPortal.Helpers.inherit(Microsoft.WebPortal.Services.UserSection, Microsoft.WebPortal.Services.HeaderBarSection); 17 | 18 | Microsoft.WebPortal.Services.UserSection.prototype.initialize = function () { 19 | /// 20 | /// This function is called to initialize the header bar section. 21 | /// 22 | 23 | var service = new Microsoft.WebPortal.Services.UserMenuService(this.webPortal, "#UserInfoSection"); 24 | this.userMenuSevice(service); 25 | this.webPortal.registerPortalService(service); 26 | }; 27 | 28 | Microsoft.WebPortal.Services.UserSection.prototype.destroy = function () { 29 | /// 30 | /// This function is called to destroy the header bar section. 31 | /// 32 | 33 | this.webPortal.deregisterPortalService(this.userMenuSevice()); 34 | }; 35 | 36 | //@ sourceURL=UserSection.js -------------------------------------------------------------------------------- /src/Storefront/Security/AccessTokenProvider.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Security 8 | { 9 | using System; 10 | using System.Threading.Tasks; 11 | using IdentityModel.Clients.ActiveDirectory; 12 | 13 | public class AccessTokenProvider : IAccessTokenProvider 14 | { 15 | public async Task GetAccessTokenAsync(string authority, string authorizationCode, Uri redirectUri, ClientCredential clientCredential, string resource) 16 | { 17 | AuthenticationContext authContext; 18 | AuthenticationResult authResult; 19 | 20 | authority.AssertNotEmpty(nameof(authority)); 21 | authorizationCode.AssertNotEmpty(nameof(authorizationCode)); 22 | redirectUri.AssertNotNull(nameof(redirectUri)); 23 | clientCredential.AssertNotNull(nameof(clientCredential)); 24 | 25 | authContext = new AuthenticationContext(authority); 26 | authResult = await authContext.AcquireTokenByAuthorizationCodeAsync( 27 | authorizationCode, 28 | redirectUri, 29 | clientCredential, 30 | resource).ConfigureAwait(false); 31 | 32 | return authResult; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Storefront/Views/Controls/OfferTile.cshtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Storefront/Filters/Mvc/AiHandleErrorAttribute.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Filters.Mvc 8 | { 9 | using System; 10 | using System.Web.Mvc; 11 | using BusinessLogic; 12 | 13 | /// 14 | /// Attribute used to track exceptions using Application Insights if it is configured. 15 | /// 16 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] 17 | public sealed class AiHandleErrorAttribute : HandleErrorAttribute 18 | { 19 | /// 20 | /// Called when an exception occurs. 21 | /// 22 | /// The action-filter context. 23 | /// If customerError is set to Off then the exception will be reported through telemetry. 24 | public override void OnException(ExceptionContext filterContext) 25 | { 26 | if (filterContext?.HttpContext != null && filterContext.Exception != null && filterContext.HttpContext.IsCustomErrorEnabled) 27 | { 28 | ApplicationDomain.Instance.TelemetryService.Provider.TrackException(filterContext.Exception); 29 | } 30 | 31 | base.OnException(filterContext); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Storefront/Configuration/Web Portal/CoreSegment.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Configuration.WebPortal 8 | { 9 | /// 10 | /// A container for portal core asset segments. 11 | /// 12 | public class CoreSegment 13 | { 14 | /// 15 | /// The start up assets segment. 16 | /// 17 | private AssetsSegment startup; 18 | 19 | /// 20 | /// The non start up assets segment. 21 | /// 22 | private AssetsSegment nonStartup; 23 | 24 | /// 25 | /// Gets or sets startup assets. 26 | /// 27 | public AssetsSegment Startup 28 | { 29 | get => this.startup; 30 | 31 | set 32 | { 33 | this.startup = value; 34 | this.startup.Name = "Startup"; 35 | } 36 | } 37 | 38 | /// 39 | /// Gets or sets non startup assets. 40 | /// 41 | public AssetsSegment NonStartup 42 | { 43 | get => this.nonStartup; 44 | 45 | set 46 | { 47 | this.nonStartup = value; 48 | this.nonStartup.Name = "Nonstartup"; 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/Commerce/PaymentGateways/PayUMoney/TransactionStatusResponse.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.Commerce.PaymentGateways.PayUMoney 8 | { 9 | using System.Collections.Generic; 10 | 11 | /// 12 | /// Transaction status response class. 13 | /// 14 | public class TransactionStatusResponse 15 | { 16 | /// 17 | /// Gets or sets status. 18 | /// Status will be 0 if API call is a success, Status will be -1 in case of failure you'll get system handled failure reasons in this case. 19 | /// 20 | public int Status { get; set; } 21 | 22 | /// 23 | /// Gets or sets message. 24 | /// 25 | public string Message { get; set; } 26 | 27 | /// 28 | /// Gets or sets transaction result. 29 | /// 30 | public List Result { get; set; } 31 | 32 | /// 33 | /// Gets or sets error code. Always Null from PayUMoney documentation. 34 | /// 35 | public object ErrorCode { get; set; } 36 | 37 | /// 38 | /// Gets or sets response code. 39 | /// 40 | public object ResponseCode { get; set; } 41 | } 42 | } -------------------------------------------------------------------------------- /src/Storefront/Filters/Mvc/AuthenticationFilterAttribute.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Filters.Mvc 8 | { 9 | using System; 10 | using System.Web; 11 | using System.Web.Mvc; 12 | using System.Web.Mvc.Filters; 13 | using BusinessLogic; 14 | 15 | /// 16 | /// Augments MVC authentication by replacing the principal with a more usable customer portal principal object. 17 | /// 18 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] 19 | public sealed class AuthenticationFilterAttribute : ActionFilterAttribute, IAuthenticationFilter 20 | { 21 | /// 22 | /// Authenticates an incoming request. 23 | /// 24 | /// The filter context. 25 | public void OnAuthentication(AuthenticationContext filterContext) 26 | { 27 | filterContext.Principal = new CustomerPortalPrincipal(HttpContext.Current.User as System.Security.Claims.ClaimsPrincipal); 28 | } 29 | 30 | /// 31 | /// Challenges the caller. 32 | /// 33 | /// The filter context. 34 | public void OnAuthenticationChallenge(AuthenticationChallengeContext filterContext) 35 | { 36 | // Do nothing 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/Storefront/Views/Shared/CustomerRegistration.cshtml: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 |
7 |
8 | 9 |

10 | @Resources.Submit 11 |
12 | 44 |
-------------------------------------------------------------------------------- /src/Storefront/Scripts/WebPortal/Views/List/IListEventListener.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.Views.List.IListEventListener = function () { 2 | /// 3 | /// Specifies the contract a list event listener must implement. 4 | /// 5 | }; 6 | 7 | Microsoft.WebPortal.Views.List.IListEventListener.prototype.onMoreDataNeeded = function (taskProgress, index, count) { 8 | /// 9 | /// Handles getting more data for the list as it needs it. 10 | /// 11 | /// A JQuery deferred object which should be resolved with the data or rejected if the list has the entire data set. 12 | /// The starting index of the data. 13 | /// The number of rows needed. 14 | }; 15 | 16 | Microsoft.WebPortal.Views.List.IListEventListener.prototype.onSelectionChanged = function (selectedRows) { 17 | /// 18 | /// Handles list selection changes. 19 | /// 20 | /// An array of selected rows. 21 | }; 22 | 23 | Microsoft.WebPortal.Views.List.IListEventListener.prototype.onSortChanged = function (sortColumn, sortDirection) { 24 | /// 25 | /// Handles list sort changes. 26 | /// 27 | /// The new sort column. 28 | /// The new sort direction. 29 | }; 30 | 31 | Microsoft.WebPortal.Views.List.IListEventListener.prototype.onCellClicked = function (column, row) { 32 | /// 33 | /// Handles cell clicks. 34 | /// 35 | /// The cell's column. 36 | /// The rows which had the cell that was clicked. 37 | }; 38 | 39 | //@ sourceURL=ListEventListener.js -------------------------------------------------------------------------------- /src/Storefront/Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Controllers 8 | { 9 | using System.Web; 10 | using System.Web.Mvc; 11 | using Owin.Security; 12 | using Owin.Security.Cookies; 13 | using Owin.Security.OpenIdConnect; 14 | 15 | /// 16 | /// Manages user logins and logouts. 17 | /// 18 | public class AccountController : Controller 19 | { 20 | /// 21 | /// Logs a user in to the application. 22 | /// 23 | public void Login() 24 | { 25 | if (!Request.IsAuthenticated) 26 | { 27 | HttpContext.GetOwinContext().Authentication.Challenge( 28 | new AuthenticationProperties { RedirectUri = "/" }, 29 | OpenIdConnectAuthenticationDefaults.AuthenticationType); 30 | } 31 | } 32 | 33 | /// 34 | /// Logs a user out of the application. 35 | /// 36 | public void SignOut() 37 | { 38 | string callbackUrl = Url.Action("Index", "Home", routeValues: null, protocol: Request.Url.Scheme); 39 | 40 | HttpContext.GetOwinContext().Authentication.SignOut( 41 | new AuthenticationProperties { RedirectUri = callbackUrl }, 42 | OpenIdConnectAuthenticationDefaults.AuthenticationType, 43 | CookieAuthenticationDefaults.AuthenticationType); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /src/Storefront/Scripts/WebPortal/Services/Login/Login.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.Services.Login = function (webPortal) { 2 | /// 3 | /// The Login service. Maintains the login state and broadcasts user login events. 4 | /// 5 | /// The web portal instance. 6 | 7 | this.base.constructor.call(this, webPortal, "Login"); 8 | 9 | this.isLoggedIn = ko.observable(false); 10 | this.isInErrorState = ko.observable(false); 11 | this.errorMessage = ko.observable(); 12 | this.userName = ko.observable(""); 13 | this.password = ko.observable(""); 14 | this.rememberMe = ko.observable(false); 15 | }; 16 | 17 | $WebPortal.Helpers.inherit(Microsoft.WebPortal.Services.Login, Microsoft.WebPortal.Core.PortalService); 18 | 19 | Microsoft.WebPortal.Services.Login.prototype._runService = function () { 20 | /// 21 | /// Runs the Login service. 22 | /// 23 | 24 | if (isAuthenticated) { 25 | this.isLoggedIn(true); 26 | this.userName(userName); 27 | this.webPortal.EventSystem.broadcast(Microsoft.WebPortal.Event.UserLoggedIn, true); 28 | } 29 | }; 30 | 31 | Microsoft.WebPortal.Services.Login.prototype._stopService = function () { 32 | /// 33 | /// Stops the Login service. 34 | /// 35 | }; 36 | 37 | Microsoft.WebPortal.Services.Login.prototype.login = function () { 38 | /// 39 | /// Displays the login dialog to the user. 40 | /// 41 | 42 | window.location = "Account/Login"; 43 | }; 44 | 45 | Microsoft.WebPortal.Services.Login.prototype.logout = function () { 46 | /// 47 | /// Logs the user out from the application. 48 | /// 49 | 50 | window.location = "Account/SignOut"; 51 | }; 52 | 53 | //@ sourceURL=Login.js -------------------------------------------------------------------------------- /src/Storefront/Views/Web.config: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /src/Storefront/Models/PurchaseLineItemWithOffer.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// Associates a purchase line item with a partner offer. 11 | /// 12 | public class PurchaseLineItemWithOffer 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | public PurchaseLineItemWithOffer() 18 | { 19 | } 20 | 21 | /// 22 | /// Initializes a new instance of the class. 23 | /// 24 | /// The purchase line item. 25 | /// The partner offer. 26 | public PurchaseLineItemWithOffer(PurchaseLineItem purchaseLineItem, PartnerOffer partnerOffer) 27 | { 28 | purchaseLineItem.AssertNotNull(nameof(purchaseLineItem)); 29 | partnerOffer.AssertNotNull(nameof(partnerOffer)); 30 | 31 | this.PurchaseLineItem = purchaseLineItem; 32 | this.PartnerOffer = partnerOffer; 33 | } 34 | 35 | /// 36 | /// Gets the purchase line item. 37 | /// 38 | public PurchaseLineItem PurchaseLineItem { get; private set; } 39 | 40 | /// 41 | /// Gets the partner offer. 42 | /// 43 | public PartnerOffer PartnerOffer { get; private set; } 44 | } 45 | } -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/AddSubscriptions.css: -------------------------------------------------------------------------------- 1 | #SubscriptionsList { 2 | display: none; 3 | height: 500px; 4 | border-top: 1px solid #E5DFD2; 5 | margin-bottom: 10px; 6 | } 7 | 8 | .add-plan-header { 9 | margin-bottom: 50px; 10 | margin-left: 15px; 11 | } 12 | 13 | #availableSubscriptions { 14 | width: 500px; 15 | height: 30px; 16 | } 17 | 18 | .first-payment-total-container { 19 | margin-right: 20px; 20 | float: right; 21 | display: inline-block; 22 | } 23 | 24 | .first-payment-total-container label { 25 | text-align: right; 26 | font-size: 24px; 27 | } 28 | 29 | .offer-title { 30 | font-size: 20px; 31 | font-weight: 300; 32 | } 33 | 34 | .offer-license { 35 | font-size: 14px; 36 | font-weight: 100; 37 | } 38 | 39 | .offer-notes { 40 | padding-left: 12px; 41 | } 42 | 43 | .offer-notes li { 44 | white-space: normal; 45 | } 46 | 47 | .left-padded { 48 | padding-left: 20px; 49 | } 50 | 51 | .right-padded { 52 | padding-right: 20px; 53 | } 54 | 55 | .order-quantity { 56 | width: 40px; 57 | margin-left: 10px; 58 | } 59 | 60 | .offer-price { 61 | font-size: 24px; 62 | font-weight: 400; 63 | } 64 | 65 | .monthly-fee { 66 | font-size: 14px; 67 | font-weight: 300; 68 | } 69 | 70 | .remove-link { 71 | display: inline-block; 72 | margin-bottom: 20px; 73 | } 74 | 75 | .empty-offers-error-message { 76 | position: relative; 77 | height: 100%; 78 | } 79 | 80 | .empty-offers-error-message label { 81 | position: absolute; 82 | top: 50%; 83 | font-size: 28px; 84 | } 85 | 86 | .PortalOfferList { 87 | display: none; 88 | height: 100%; 89 | width: 100%; 90 | margin-top: 20px; 91 | } 92 | 93 | #PartnerOffersCatalog { 94 | display: inline-block; 95 | } 96 | 97 | .PortalOfferCaption { 98 | padding-bottom: 20px; 99 | } -------------------------------------------------------------------------------- /src/Storefront/Models/OrderSubscriptionItemViewModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System; 10 | 11 | /// 12 | /// The order view model. 13 | /// 14 | public class OrderSubscriptionItemViewModel 15 | { 16 | /// 17 | /// Gets or sets the offer Id tied to the order. 18 | /// 19 | public string OfferId { get; set; } 20 | 21 | /// 22 | /// Gets or sets the subscription Id. 23 | /// 24 | public string SubscriptionId { get; set; } 25 | 26 | /// 27 | /// Gets or sets the partner offer Id. 28 | /// 29 | public string PartnerOfferId { get; set; } 30 | 31 | /// 32 | /// Gets or sets the subscription name of the offer being ordered. 33 | /// 34 | public string SubscriptionName { get; set; } 35 | 36 | /// 37 | /// Gets or sets the subscription expiry date of the offer being ordered. 38 | /// 39 | public DateTime SubscriptionExpiryDate { get; set; } 40 | 41 | /// 42 | /// Gets or sets the quantity of the offer being ordered. 43 | /// 44 | public int Quantity { get; set; } 45 | 46 | /// 47 | /// Gets or sets the price of the offer being ordered. 48 | /// 49 | public decimal SeatPrice { get; set; } 50 | } 51 | } -------------------------------------------------------------------------------- /src/Storefront/Views/Services/Dialog.cshtml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 |
8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/UpdateSubscriptions.css: -------------------------------------------------------------------------------- 1 | #UpdateSubscriptionsContainer { 2 | margin: 20px; 3 | } 4 | 5 | #UpdateSubscriptionsContainer .product-title { 6 | font-size: 40px; 7 | font-weight: 100; 8 | margin-bottom: 10px; 9 | display: inline-block; 10 | } 11 | 12 | #UpdateSubscriptionsContainer .feature-title { 13 | font-size: 24px; 14 | font-weight: 400; 15 | display: inline-block; 16 | } 17 | 18 | #UpdateSubscriptionsContainer #SubmitButton { 19 | margin-top: 20px; 20 | display: inline-block; 21 | } 22 | 23 | #UpdateSubscriptionsContainer Form > table { 24 | margin-bottom: 10px; 25 | margin-top: 10px; 26 | width: 100%; 27 | } 28 | 29 | #UpdateSubscriptionsContainer input[name="FriendlyName"] { 30 | width: 400px; 31 | height: 25px; 32 | } 33 | 34 | #UpdateSubscriptionsContainer input[name="Quantity"] { 35 | margin-left: 10px; 36 | margin-right: 10px; 37 | width: 50px; 38 | } 39 | 40 | #UpdateSubscriptionsContainer .offer-price { 41 | font-size: 24px; 42 | font-weight: 400; 43 | } 44 | 45 | #UpdateSubscriptionsContainer .left-column { 46 | width: 400px; 47 | } 48 | 49 | #UpdateSubscriptionsContainer .right-column { 50 | vertical-align: top; 51 | padding-top: 25px; 52 | } 53 | 54 | #UpdateSubscriptionsContainer .offer-title { 55 | font-size: 20px; 56 | } 57 | 58 | #UpdateSubscriptionsContainer .month-per-user { 59 | font-size: 16px; 60 | } 61 | 62 | #UpdateSubscriptionsContainer .offer-features { 63 | padding-left: 20px; 64 | font-size: 12px; 65 | } 66 | 67 | .dashedTop { 68 | border-top: 1px dashed black; 69 | } 70 | 71 | form > table { 72 | border-collapse: collapse; 73 | } 74 | -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/WebPortal/Dialog.css: -------------------------------------------------------------------------------- 1 | /* The background used to shadow the rest of the page when the dialog is shown */ 2 | #DialogBackgroundOverlay { 3 | display: none; 4 | position: absolute; 5 | top: 0; 6 | left: 0; 7 | width: 100%; 8 | height: 100%; 9 | z-index: 100; 10 | min-width: 1024px; 11 | min-height: 600px; 12 | background-color: lightgray; 13 | opacity: 0.6; 14 | } 15 | 16 | /* Used to shadow the dialog itself to disable interacting with it while an operation is in progress */ 17 | #DialogShader { 18 | z-index: 102; 19 | vertical-align: middle; 20 | text-align: center; 21 | display: none; 22 | opacity: 0.6; 23 | background-color: gray; 24 | } 25 | 26 | /* A metro style dialog implementation */ 27 | .MetroDialog { 28 | position: absolute; 29 | min-height: 300px; 30 | width: 100%; 31 | height: 80%; 32 | top: 10%; 33 | left: 0; 34 | z-index: 101; 35 | vertical-align: middle; 36 | text-align: left; 37 | font-size: 18px; 38 | color: white; 39 | display: none; 40 | background-color: rgba(90, 90, 90, 1.0); 41 | } 42 | 43 | .MetroDialog > table { 44 | position: absolute; 45 | top: 0%; 46 | padding-left: 5px; 47 | padding-right: 5px; 48 | padding-top: 10px; 49 | padding-bottom: 10px; 50 | width: 100%; 51 | height: 100%; 52 | vertical-align: middle; 53 | } 54 | 55 | #DialogProgressIndicator { 56 | width: 400px; 57 | height: 30px; 58 | position: absolute; 59 | top: 50%; 60 | left: 50%; 61 | margin-left: -200px; 62 | margin-top: -15px; 63 | z-index: 103; 64 | display: none; 65 | } 66 | 67 | #DialogContentContainer { 68 | } 69 | 70 | #DialogContent { 71 | height: 100%; 72 | width: 100%; 73 | font-size: 18px; 74 | font-weight: normal; 75 | overflow: auto; 76 | } 77 | -------------------------------------------------------------------------------- /src/Storefront/Scripts/WebPortal/Infrastructure/Settings.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.Infrastructure.Settings = { 2 | /// 3 | /// Defines common portal settings. This class just groups there settings together and is different from configuration since 4 | /// the elements here are not meant to change. 5 | /// 6 | 7 | Ids: { 8 | SplashScreen: "#SplashScreen", 9 | HeaderBar: "#HeaderBar", 10 | PrimaryNavigation: "#PrimaryNavigation", 11 | ExtraActionsMenuItem: "Extra1983", 12 | ControlPanel: "#ControlPanel", 13 | ContentPanelContent: "#ContentPanel > div", 14 | ContextualControl: "#ContextualControlArea", 15 | ContentPanel: "#ContentPanel", 16 | BackButton: ".Backbutton", 17 | PortalContent: "#PortalContent", 18 | NotificationsSection: "NotificationsSection", 19 | ActionsSection: "ActionsSection", 20 | Dialog: "#Dialog", 21 | DialogShader: "#DialogShader", 22 | DialogBackgroundOverlay: "#DialogBackgroundOverlay", 23 | DialogProgressIndicator: "#DialogProgressIndicator" 24 | }, 25 | 26 | Plugins: { 27 | Expenses: { 28 | Template: "/Template/Expenses/", 29 | ExpensesHeaderSelector: "#ExpensesHeader", 30 | ExpensesListVisualizationSelector: "#ExpensesListVisualization", 31 | ExpensesChartVisualizationSelector: "#ExpensesChartVisualization", 32 | ExpensesContainerSelector: "#ExpensesContainer", 33 | NewExpenseTemplate: "newExpense-template" 34 | } 35 | }, 36 | 37 | List: { 38 | Template: "list-template", 39 | DefaultEmptyListTemplate: "defaultEmptyList-template", 40 | DefaultColumnHeaderTemplate: "defaultColumnHeader-template", 41 | ListHeaderSelector: " #ListHeaders", 42 | ListBodySelector: " .ListBodyContainer", 43 | ListFooterSelector: " #ListFooter" 44 | } 45 | }; -------------------------------------------------------------------------------- /src/Storefront/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | using System.Reflection; 8 | using System.Resources; 9 | using System.Runtime.InteropServices; 10 | 11 | // General Information about an assembly is controlled through the following 12 | // set of attributes. Change these attribute values to modify the information 13 | // associated with an assembly. 14 | [assembly: AssemblyTitle("Partner Center Storefront")] 15 | [assembly: AssemblyDescription("Storefront for partners to resell Cloud Solution Provider offers.")] 16 | [assembly: AssemblyConfiguration("")] 17 | [assembly: AssemblyCompany("Microsoft Corporation")] 18 | [assembly: AssemblyProduct("Partner Center Storefront")] 19 | [assembly: AssemblyCopyright("Copyright © 2018")] 20 | [assembly: AssemblyTrademark("")] 21 | [assembly: AssemblyCulture("")] 22 | 23 | // Setting ComVisible to false makes the types in this assembly not visible 24 | // to COM components. If you need to access a type in this assembly from 25 | // COM, set the ComVisible attribute to true on that type. 26 | [assembly: ComVisible(false)] 27 | 28 | // The following GUID is for the ID of the typelib if this project is exposed to COM 29 | [assembly: Guid("c7c5d95f-1358-418d-bb3b-42a33bb4363d")] 30 | 31 | // Version information for an assembly consists of the following four values: 32 | // 33 | // Major Version 34 | // Minor Version 35 | // Build Number 36 | // Revision 37 | // 38 | // You can specify all the values or you can default the Revision and Build Numbers 39 | // by using the '*' as shown below: 40 | [assembly: AssemblyVersion("1.0.0.0")] 41 | [assembly: AssemblyFileVersion("1.0.0.0")] 42 | [assembly: NeutralResourcesLanguage("en")] 43 | 44 | -------------------------------------------------------------------------------- /src/Storefront/Filters/WebApi/PortalAuthorizeAttribute.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Filters.WebApi 8 | { 9 | using System; 10 | using System.Web.Http; 11 | using System.Web.Http.Controllers; 12 | using BusinessLogic; 13 | 14 | /// 15 | /// Implements portal authorization for Web API controllers. 16 | /// 17 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] 18 | public class PortalAuthorizeAttribute : AuthorizeAttribute 19 | { 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The user role to give access to. 24 | public PortalAuthorizeAttribute(UserRole userRole = UserRole.Any) 25 | { 26 | this.UserRole = userRole; 27 | } 28 | 29 | /// 30 | /// Gets or sets the user role which is allowed access. 31 | /// 32 | public UserRole UserRole { get; set; } 33 | 34 | /// 35 | /// Authorizes an incoming request based on the user role. 36 | /// 37 | /// The action context. 38 | /// True if authorized, false otherwise. 39 | protected override bool IsAuthorized(HttpActionContext actionContext) 40 | { 41 | var principal = actionContext.RequestContext.Principal as CustomerPortalPrincipal; 42 | return new AuthorizationPolicy().IsAuthorized(principal, this.UserRole); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/Storefront/Scripts/WebPortal/Views/List/Column.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.Views.List.Column = function (field, style, sortable, clickable, title, tooltip, headerTemplate, cellTemplate) { 2 | /// 3 | /// Defines a list column. 4 | /// 5 | /// The field name this column is attached to. This is used to identify the column and to bind the row property to the list user interface. Required. 6 | /// The column style. You can set css styles such as width, color, etc... for this column. 7 | /// A boolean that specifies if the column supports sorting or not. 8 | /// A boolean that specifies if the column supports clicking or not. Clickable columns will generate events that can be handled. 9 | /// The column header title. If not specified, the field will be used as the title. 10 | /// The field's header tooltip. If not specified then the title will be used as the tooltip. 11 | /// An optional custom header knockout template. The default template (text) will be used if not provided. 12 | /// An optional custom cell knockout template. The default template (text) will be used if not provided. 13 | 14 | $WebPortal.Helpers.throwIfNotSet(field, "field", "Microsoft.WebPortal.Views.List.Column"); 15 | 16 | this.field = ko.observable(field); 17 | this.style = ko.observable(style || ""); 18 | this.sortable = ko.observable(sortable === true); 19 | this.clickable = ko.observable(clickable === true); 20 | this.title = ko.observable(title || this.field()); 21 | this.tooltip = ko.observable(tooltip || this.title()); 22 | this.headerTemplate = ko.observable(headerTemplate || $WebPortal.Settings.List.DefaultColumnHeaderTemplate); 23 | this.cellTemplate = ko.observable(cellTemplate || null); 24 | }; 25 | 26 | //@ sourceURL=Column.js -------------------------------------------------------------------------------- /src/Storefront/Telemetry/ITelemetryProvider.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Telemetry 8 | { 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | /// 13 | /// Represents a telemetry provider utilized capturing and logging data. 14 | /// 15 | public interface ITelemetryProvider 16 | { 17 | /// 18 | /// Sends an event for display in the diagnostic search and aggregation in the metrics explorer. 19 | /// 20 | /// A name for the event. 21 | /// Named string values you can use to search and classify events. 22 | /// Measurements associated with this event. 23 | void TrackEvent(string eventName, IDictionary properties = null, IDictionary metrics = null); 24 | 25 | /// 26 | /// Sends an exception for display the in diagnostic search. 27 | /// 28 | /// The exception to log. 29 | /// Named string values you can use to classify and search for this exception. 30 | /// Additional values associated with this exception. 31 | void TrackException(Exception exception, IDictionary properties = null, IDictionary metrics = null); 32 | 33 | /// 34 | /// Send a trace message for display in the diagnostic search. 35 | /// 36 | /// The message to display 37 | void TrackTrace(string message); 38 | } 39 | } -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/WebPortal/Notifications.css: -------------------------------------------------------------------------------- 1 | #NotificationsPanel { 2 | width: 100%; 3 | min-width: 1024px; 4 | position: absolute; 5 | z-index: 100; 6 | left: 0px; 7 | top: 41px; 8 | vertical-align: middle; 9 | font-size: 13px; 10 | color: white; 11 | display: none; 12 | overflow-y: auto; 13 | max-height: 600px; 14 | } 15 | 16 | #NotificationsPanel table { 17 | border-collapse: collapse; 18 | width: 100%; 19 | } 20 | 21 | #NotificationsPanel td { 22 | height: 48px; 23 | } 24 | 25 | #NotificationsPanel img { 26 | vertical-align: middle; 27 | } 28 | 29 | #NotificationsPanel span { 30 | vertical-align: middle; 31 | } 32 | 33 | .Notification { 34 | background-color: rgba(29,29,29, 0.97); 35 | border-bottom: 1px solid rgba(255, 255, 255, 0.3); 36 | display: none; 37 | } 38 | 39 | .Notification:last-child { 40 | border-bottom: none; 41 | } 42 | 43 | .NotificationIcon { 44 | padding-right: 2px; 45 | vertical-align: middle; 46 | width: 30px; 47 | } 48 | 49 | .NotificationButtons { 50 | text-align: right; 51 | width: 1px; 52 | white-space: nowrap; 53 | } 54 | 55 | .NotificationButtons img { 56 | padding-right: 3px; 57 | } 58 | 59 | .NotificationButtons > div { 60 | display: inline-block; 61 | vertical-align: middle; 62 | padding: 10px; 63 | } 64 | 65 | .NotificationButton { 66 | padding-left: 10px; 67 | padding-right: 10px; 68 | border: 1px solid rgba(255, 255, 255, 0); 69 | text-align: center; 70 | height: 15%; 71 | } 72 | 73 | .NotificationButton:hover { 74 | border: 1px solid rgba(255, 255, 255, 0.4); 75 | background: rgba(48,48,48,0.5); 76 | cursor: pointer; 77 | } 78 | 79 | .NotificationButton img { 80 | vertical-align: middle; 81 | } 82 | 83 | .NotificationButton span { 84 | vertical-align: middle; 85 | } 86 | 87 | .Spacer { 88 | padding-left: 1px; 89 | } -------------------------------------------------------------------------------- /src/Storefront/Scripts/WebPortal/Services/HeaderBar/NotificationsSection.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.Services.NotificationsSection = function (webPortal) { 2 | /// 3 | /// Renders the notifications icon and number if there are pending notifications. 4 | /// 5 | /// The web portal instance. 6 | 7 | this.base.constructor.call(this, webPortal, webPortal.Settings.Ids.NotificationsSection, "notificationsHeaderBarSection-template"); 8 | 9 | this.onNotificationsSectionClicked = function () { 10 | // toggle between showing and hiding the notification panel 11 | if (this.webPortal.Services.Notifications && this.webPortal.Services.Notifications.isRunning) { 12 | this.webPortal.Services.Notifications.toggle(); 13 | } 14 | }; 15 | 16 | this.notificationsCount = ko.computed(function () { 17 | if (this.webPortal.Services.Notifications && this.webPortal.Services.Notifications.isRunning) { 18 | return this.webPortal.Services.Notifications.notifications().length; 19 | } else { 20 | return 0; 21 | } 22 | }, this); 23 | 24 | // display the notifications flag only if there are active notifications 25 | this.notificationsSectionVisible = ko.computed(function () { 26 | if (this.webPortal.Services.Notifications && this.webPortal.Services.Notifications.isRunning) { 27 | return this.webPortal.Services.Notifications.notifications().length > 0 ? "table" : "none"; 28 | } else { 29 | return false; 30 | } 31 | }, this); 32 | 33 | this.onHover = function (elementId, model) { 34 | $(elementId).css("background-color", webPortal.activeTile().AlternateColor); 35 | }; 36 | 37 | this.onUnhover = function (elementId, model) { 38 | $(elementId).css("background-color", ""); 39 | }; 40 | }; 41 | 42 | $WebPortal.Helpers.inherit(Microsoft.WebPortal.Services.NotificationsSection, Microsoft.WebPortal.Services.HeaderBarSection); 43 | 44 | //@ sourceURL=NotificationsSection.js -------------------------------------------------------------------------------- /src/Storefront/Filters/AuthorizationPolicy.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Filters 8 | { 9 | using BusinessLogic; 10 | 11 | /// 12 | /// Implements authorization policy based on the required role and the logged in user. 13 | /// 14 | public class AuthorizationPolicy 15 | { 16 | /// 17 | /// Determines if the given user principal is authorized based on the require user role or not. 18 | /// 19 | /// The logged in user. 20 | /// The required user role. 21 | /// True if authorized, false otherwise. 22 | public bool IsAuthorized(CustomerPortalPrincipal principal, UserRole requiredUserRole) 23 | { 24 | principal.AssertNotNull(nameof(principal)); 25 | 26 | bool isAuthorized = false; 27 | 28 | switch (requiredUserRole) 29 | { 30 | case UserRole.Customer: 31 | isAuthorized = principal.IsPartnerCenterCustomer && !principal.IsPortalAdmin; 32 | break; 33 | case UserRole.Partner: 34 | isAuthorized = !principal.IsPartnerCenterCustomer && principal.IsPortalAdmin; 35 | break; 36 | case UserRole.Any: 37 | isAuthorized = principal.IsPartnerCenterCustomer || principal.IsPortalAdmin; 38 | break; 39 | case UserRole.None: 40 | isAuthorized = !principal.IsPartnerCenterCustomer && !principal.IsPortalAdmin; 41 | break; 42 | } 43 | 44 | return isAuthorized; 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/Commerce/ICommerceOperations.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.Commerce 8 | { 9 | using System.Threading.Tasks; 10 | using Models; 11 | 12 | /// 13 | /// A contract for components implementing commerce operations. 14 | /// 15 | public interface ICommerceOperations 16 | { 17 | /// 18 | /// Gets the customer ID who owns the transaction. 19 | /// 20 | string CustomerId { get; } 21 | 22 | /// 23 | /// Gets the payment gateway used to process payments. 24 | /// 25 | IPaymentGateway PaymentGateway { get; } 26 | 27 | /// 28 | /// Purchases one or more partner offers. 29 | /// 30 | /// The order to execute. 31 | /// A transaction result which summarizes its outcome. 32 | Task PurchaseAsync(OrderViewModel order); 33 | 34 | /// 35 | /// Purchases additional seats for an existing subscription the customer has already bought. 36 | /// 37 | /// The order to execute. 38 | /// A transaction result which summarizes its outcome. 39 | Task PurchaseAdditionalSeatsAsync(OrderViewModel order); 40 | 41 | /// 42 | /// Renews an existing subscription for a customer. 43 | /// 44 | /// The order to execute. 45 | /// A transaction result which summarizes its outcome. 46 | Task RenewSubscriptionAsync(OrderViewModel order); 47 | } 48 | } -------------------------------------------------------------------------------- /src/Storefront/Models/TransactionResult.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Linq; 12 | 13 | /// 14 | /// Holds summary information for a commerce transaction result. 15 | /// 16 | public class TransactionResult 17 | { 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | /// A collection of line items bundled in the transaction. 22 | /// The time at which the transaction took place. 23 | public TransactionResult(IEnumerable lineItems, DateTime timeStamp) 24 | { 25 | // we don't validate amount charged since a transaction may result in a negative amount 26 | if (lineItems == null || !lineItems.Any()) 27 | { 28 | throw new ArgumentException("lineItems must at least have one line item", nameof(lineItems)); 29 | } 30 | 31 | foreach (TransactionResultLineItem lineItem in lineItems) 32 | { 33 | lineItem.AssertNotNull("lineItems has an empty entry"); 34 | } 35 | 36 | LineItems = lineItems; 37 | TimeStamp = timeStamp; 38 | } 39 | 40 | /// 41 | /// Gets the result line items associated with the transaction. 42 | /// 43 | public IEnumerable LineItems { get; private set; } 44 | 45 | /// 46 | /// Gets the time at which the transaction took place. 47 | /// 48 | public DateTime TimeStamp { get; private set; } 49 | } 50 | } -------------------------------------------------------------------------------- /src/Storefront/Filters/WebApi/AuthenticationFilterAttribute.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Filters.WebApi 8 | { 9 | using System; 10 | using System.Threading; 11 | using System.Threading.Tasks; 12 | using System.Web; 13 | using System.Web.Http.Filters; 14 | using BusinessLogic; 15 | 16 | /// 17 | /// Augments Web API authentication by replacing the principal with a more usable custom principal object. 18 | /// 19 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] 20 | public sealed class AuthenticationFilterAttribute : ActionFilterAttribute, IAuthenticationFilter 21 | { 22 | /// 23 | /// Authenticates a web API incoming request. 24 | /// 25 | /// The authentication context. 26 | /// A cancellation token. 27 | /// A task. 28 | public Task AuthenticateAsync(HttpAuthenticationContext context, CancellationToken cancellationToken) 29 | { 30 | context.Principal = new CustomerPortalPrincipal(HttpContext.Current.User as System.Security.Claims.ClaimsPrincipal); 31 | 32 | return Task.CompletedTask; 33 | } 34 | 35 | /// 36 | /// Challenges the caller. 37 | /// 38 | /// The authentication context. 39 | /// A cancellation token. 40 | /// A task. 41 | public Task ChallengeAsync(HttpAuthenticationChallengeContext context, CancellationToken cancellationToken) 42 | { 43 | // Do nothing 44 | return Task.CompletedTask; 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /src/Storefront/Views/Shared/Home.cshtml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | @if (ViewBag.HeaderImage != null) 8 | { 9 | 10 | 13 | 14 | } 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 56 | 57 | 58 |
11 | 12 |
19 | 20 |
34 | 35 | 36 | @if (ViewBag.IsPortalAdmin) 37 | { 38 | 39 | } 40 |
-------------------------------------------------------------------------------- /src/Storefront/Models/CustomerLicensesModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// The customer licenses view model. 11 | /// 12 | public class CustomerLicensesModel 13 | { 14 | /// 15 | /// Gets or sets the customer license Id. 16 | /// 17 | public string Id { get; set; } 18 | 19 | /// 20 | /// Gets or sets the offer name. 21 | /// 22 | public string OfferName { get; set; } 23 | 24 | /// 25 | /// Gets or sets the customer license status like None, Active, Suspended or Deleted 26 | /// 27 | public string Status { get; set; } 28 | 29 | /// 30 | /// Gets or sets the total number of licenses for this customer license. 31 | /// 32 | public string Quantity { get; set; } 33 | 34 | /// 35 | /// Gets or sets the license creation date. 36 | /// 37 | public string CreationDate { get; set; } 38 | 39 | /// 40 | /// Gets or sets a value indicating whether subscription is renewable. 41 | /// 42 | public bool IsRenewable { get; set; } 43 | 44 | /// 45 | /// Gets or sets a value indicating whether subscription is editable. 46 | /// 47 | public bool IsEditable { get; set; } 48 | 49 | /// 50 | /// Gets or sets the subscription's portal offer Id. 51 | /// 52 | public string PortalOfferId { get; set; } 53 | 54 | /// 55 | /// Gets or sets the remaining days to expiry for this subscription. 56 | /// 57 | public decimal SubscriptionProRatedPrice { get; set; } 58 | } 59 | } -------------------------------------------------------------------------------- /src/Deployment/Deployment.deployproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8 | 9 | Release 10 | AnyCPU 11 | 12 | 13 | 14 | 0b962fe3-e103-4c00-bfad-cd35f22a2c19 15 | 16 | 17 | true 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | False 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | Build;Package 40 | PackageLocation=..\Deployment\$(ProjectReferencesOutputPath)\Storefront\package.zip 41 | $(ProjectReferencesOutputPath)\Storefront\package.zip 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/Storefront/Models/CustomerSubscriptionModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | /// 10 | /// The customer subscription model 11 | /// 12 | public class CustomerSubscriptionModel 13 | { 14 | /// 15 | /// Gets or sets the customer license Id. 16 | /// 17 | public string SubscriptionId { get; set; } 18 | 19 | /// 20 | /// Gets or sets the offer name. 21 | /// 22 | public string FriendlyName { get; set; } 23 | 24 | /// 25 | /// Gets or sets the customer license status like None, Active, Suspended or Deleted 26 | /// 27 | public string Status { get; set; } 28 | 29 | /// 30 | /// Gets or sets the total number of licenses for this customer license. 31 | /// 32 | public string LicensesTotal { get; set; } 33 | 34 | /// 35 | /// Gets or sets the license creation date. 36 | /// 37 | public string CreationDate { get; set; } 38 | 39 | /// 40 | /// Gets or sets a value indicating whether subscription is renewable. 41 | /// 42 | public bool IsRenewable { get; set; } 43 | 44 | /// 45 | /// Gets or sets a value indicating whether subscription is editable. 46 | /// 47 | public bool IsEditable { get; set; } 48 | 49 | /// 50 | /// Gets or sets the subscription's portal offer Id. 51 | /// 52 | public string PortalOfferId { get; set; } 53 | 54 | /// 55 | /// Gets or sets the remaining days to expiry for this subscription. 56 | /// 57 | public decimal SubscriptionProRatedPrice { get; set; } 58 | } 59 | } -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/HomePage.css: -------------------------------------------------------------------------------- 1 | .offers-header { 2 | margin: auto; 3 | position: relative; 4 | vertical-align: top; 5 | height: 1px; 6 | } 7 | 8 | .banner { 9 | max-height: 250px; 10 | } 11 | 12 | .office-title { 13 | left: calc(50% - 430px); 14 | top: 100px; 15 | text-align: center; 16 | position: absolute; 17 | } 18 | 19 | .offers-main-title { 20 | padding: 20px; 21 | } 22 | 23 | .most-popular-cell { 24 | border: 1px solid black; 25 | border-image: none; 26 | height: 50px; 27 | border-collapse: collapse; 28 | background-color: gray; 29 | border-bottom-width: 0px; 30 | color: white; 31 | font-size: 18px; 32 | } 33 | 34 | .spacer-cell { 35 | width: 25px; 36 | } 37 | 38 | .offer-cell { 39 | width: 225px; 40 | vertical-align: top; 41 | padding: 40px 20px 40px 20px; 42 | text-align: center; 43 | border: solid black 1px; 44 | } 45 | 46 | .offer-main-title { 47 | display: inline-block; 48 | margin-bottom: 15px; 49 | } 50 | 51 | .offer-subtitle { 52 | display: inline-block; 53 | margin-bottom: 15px; 54 | } 55 | 56 | .learn-more { 57 | display: inline-block; 58 | margin-top: 20px; 59 | margin-bottom: 50px; 60 | } 61 | 62 | .offer-icon { 63 | margin-bottom: 50px; 64 | height: 34px; 65 | } 66 | 67 | .offer-features { 68 | height: 250px; 69 | } 70 | 71 | .offer-price { 72 | display: inline-block; 73 | margin-top: 20px; 74 | margin-bottom: 20px; 75 | } 76 | 77 | .buy-now { 78 | display: inline-block; 79 | margin-top: 20px; 80 | margin-bottom: 50px; 81 | font-weight: 700; 82 | } 83 | 84 | .footer { 85 | width: 100%; 86 | height: 50px; 87 | color: white; 88 | background-color: #3D3C3A; 89 | position: relative; 90 | } 91 | 92 | .footer .rightAlignedElement { 93 | float: right; 94 | padding-right: 20px; 95 | color: white !important; 96 | } 97 | 98 | .PortalNotConfigured { 99 | padding-top: 50px; 100 | vertical-align: top; 101 | } 102 | 103 | #PartnerOffersCatalogView { 104 | display: inline-block; 105 | margin: auto; 106 | } 107 | -------------------------------------------------------------------------------- /src/Storefront/Models/PartnerOffer.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | /// 13 | /// Represents partner offers. 14 | /// 15 | public class PartnerOffer 16 | { 17 | /// 18 | /// Gets or sets the unique ID of the partner offer. 19 | /// 20 | public string Id { get; set; } 21 | 22 | /// 23 | /// Gets or sets the Microsoft offer ID associated with the partner offer. 24 | /// 25 | public string MicrosoftOfferId { get; set; } 26 | 27 | /// 28 | /// Gets or sets a value indicating whether the offer is active or has been inactivated by the partner. 29 | /// 30 | public bool IsInactive { get; set; } 31 | 32 | /// 33 | /// Gets or sets the partner offer title. 34 | /// 35 | public string Title { get; set; } 36 | 37 | /// 38 | /// Gets or sets the partner offer subtitle. 39 | /// 40 | public string Subtitle { get; set; } 41 | 42 | /// 43 | /// Gets or sets a detailed list of features the offer provides to its customers. 44 | /// 45 | public IEnumerable Features { get; set; } 46 | 47 | /// 48 | /// Gets or sets a summary list of the offer. 49 | /// 50 | public IEnumerable Summary { get; set; } 51 | 52 | /// 53 | /// Gets or sets the offer's monthly price as per the license. 54 | /// 55 | public decimal Price { get; set; } 56 | 57 | /// 58 | /// Gets or sets the offer's thumbnail image. 59 | /// 60 | public Uri Thumbnail { get; set; } 61 | } 62 | } -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/Commerce/PaymentGateways/PayUMoney/RefundResponse.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.Commerce.PaymentGateways.PayUMoney 8 | { 9 | /// 10 | /// Refund response class 11 | /// 12 | public class RefundResponse 13 | { 14 | /// 15 | /// Gets or sets error code. Always Null from PayUMoney documentation. 16 | /// 17 | public string ErrorCode { get; set; } 18 | 19 | /// 20 | /// Gets or sets Guid. 21 | /// 22 | public string Guid { get; set; } 23 | 24 | /// 25 | /// Gets or sets message. 26 | /// Message string for both success and failure cases 27 | /// Refund Initiated : Refund successfully Initiated 28 | /// PaymentId is not valid for this merchant : When PaymentID is not linked with the merchantID passed 29 | /// Payment is not allowed for refund as status is: refunding progress : Refund on this sub order is already initiated 30 | /// 31 | public string Message { get; set; } 32 | 33 | /// 34 | /// Gets or sets result. 35 | /// if Success then it has RefundId. 36 | /// if Failure then it will be NULL. 37 | /// 38 | public string Result { get; set; } 39 | 40 | /// 41 | /// Gets or sets rows. 42 | /// 43 | public string Rows { get; set; } 44 | 45 | /// 46 | /// Gets or sets session ID. 47 | /// 48 | public string SessionId { get; set; } 49 | 50 | /// 51 | /// Gets or sets status. 52 | /// Status will be 0 if API call is a success, Status will be -1 in case of failure you'll get system handled failure reasons in this case. 53 | /// 54 | public int Status { get; set; } 55 | } 56 | } -------------------------------------------------------------------------------- /src/Storefront/Content/Styles/Plugins/OfferList.css: -------------------------------------------------------------------------------- 1 | #OfferListContainer { 2 | height: 100%; 3 | width: 100%; 4 | } 5 | 6 | #OfferListContainer #offerList { 7 | display: none; 8 | height: 100%; 9 | width: 100%; 10 | } 11 | 12 | #OfferListContainer #offerList .MicrosoftOfferDetails { 13 | font-size: 14px; 14 | color: black; 15 | } 16 | 17 | #OfferListContainer #offerList .MicrosoftOfferDetails .Name { 18 | font-size: 20px; 19 | font-weight: 500; 20 | } 21 | 22 | #OfferListContainer #offerList .MicrosoftOfferDetails .Id { 23 | font-size: 16px; 24 | } 25 | 26 | #OfferListContainer #offerList .MicrosoftOfferDetails .Category { 27 | display: inline-block; 28 | margin-top: 10px; 29 | } 30 | 31 | #OfferListContainer #offerList .MicrosoftOfferDetails .Billing { 32 | } 33 | 34 | #OfferListContainer #offerList .MicrosoftOfferDetails .Description { 35 | font-size: 12px; 36 | font-style: oblique; 37 | display: inline-block; 38 | margin-top: 10px; 39 | } 40 | 41 | #OfferListContainer #offerList .MicrosoftOfferDetails label { 42 | cursor: pointer; 43 | } 44 | 45 | #OfferListContainer #offerList .PartnerOfferDetails { 46 | font-size: 14px; 47 | } 48 | 49 | #OfferListContainer #offerList .PartnerOfferDetails .Title { 50 | font-size: 20px; 51 | font-weight: 500; 52 | } 53 | 54 | #OfferListContainer #offerList .PartnerOfferDetails .SubTitle { 55 | font-size: 16px; 56 | } 57 | 58 | #OfferListContainer #offerList .PartnerOfferDetails table { 59 | width: 100%; 60 | } 61 | 62 | #OfferListContainer #offerList .PartnerOfferDetails table td { 63 | width: 50%; 64 | vertical-align: top; 65 | } 66 | 67 | #OfferListContainer #offerList .PartnerOfferDetails ul { 68 | margin: 0px; 69 | } -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/Commerce/PaymentGateways/PayUMoney/Constant.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.Commerce.PaymentGateways.PayUMoney 8 | { 9 | /// 10 | /// Constant class 11 | /// 12 | public static class Constant 13 | { 14 | /// 15 | /// PaymentResponseUrl url. 16 | /// 17 | public const string PaymentResponseUrl = "https://www.payumoney.com/payment/op/getPaymentResponse?merchantKey={0}&merchantTransactionIds={1}"; 18 | 19 | /// 20 | /// PaymentStatusUrl url. 21 | /// 22 | public const string PaymentStatusUrl = "https://www.payumoney.com/payment/payment/chkMerchantTxnStatus?merchantKey={0}&merchantTransactionIds={1}"; 23 | 24 | /// 25 | /// PaymentRefundUrl url. 26 | /// 27 | public const string PaymentRefundUrl = "https://www.payumoney.com/treasury/merchant/refundPayment?merchantKey={0}&paymentId={1}&refundAmount={2}"; 28 | 29 | /// 30 | /// MoneyWithPayU url. 31 | /// 32 | public const string MoneyWithPayU = "Money with Payumoney"; 33 | 34 | /// 35 | /// Test url. 36 | /// 37 | public static readonly string TESTPAYUURL = "https://test.payu.in/_payment"; 38 | 39 | /// 40 | /// Live url. 41 | /// 42 | public static readonly string LIVEPAYUURL = "https://secure.payu.in/_payment"; 43 | 44 | /// 45 | /// Hash sequence. 46 | /// 47 | public static readonly string HASHSEQUENCE = "key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|udf6|udf7|udf8|udf9|udf10"; 48 | 49 | /// 50 | /// Maintains the payment id for the payment gateway. 51 | /// 52 | public static readonly string PAYUPAISASERVICEPROVIDER = "payu_paisa"; 53 | } 54 | } -------------------------------------------------------------------------------- /src/Storefront/Views/Services/Notifications.cshtml: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 51 | -------------------------------------------------------------------------------- /src/Storefront/Telemetry/EmptyTelemetryProvider.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Telemetry 8 | { 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | /// 13 | /// Telemetry provider that does not log any data. This is utilized when 14 | /// Application Insights is not enabled and for testing. 15 | /// 16 | public class EmptyTelemetryProvider : ITelemetryProvider 17 | { 18 | /// 19 | /// Sends an event for display in the diagnostic search and aggregation in the metrics explorer. 20 | /// 21 | /// A name for the event. 22 | /// Named string values you can use to search and classify events. 23 | /// Measurements associated with this event. 24 | public void TrackEvent(string eventName, IDictionary properties = null, IDictionary metrics = null) 25 | { 26 | // Method intentionally left empty. 27 | } 28 | 29 | /// 30 | /// Sends an exception for display the in diagnostic search. 31 | /// 32 | /// The exception to log. 33 | /// Named string values you can use to classify and search for this exception. 34 | /// Additional values associated with this exception. 35 | public void TrackException(Exception exception, IDictionary properties = null, IDictionary metrics = null) 36 | { 37 | // Method intentionally left empty. 38 | } 39 | 40 | /// 41 | /// Send a trace message for display in the diagnostic search. 42 | /// 43 | /// The message to display 44 | public void TrackTrace(string message) 45 | { 46 | // Method intentionally left empty. 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/Storefront/Models/CustomerSubscriptionEntity.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System; 10 | 11 | /// 12 | /// Represents a unique subscription purchased by a customer. 13 | /// 14 | public class CustomerSubscriptionEntity 15 | { 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | /// The ID of the customer who owns the subscription. 20 | /// The subscription ID. 21 | /// The partner offer ID associated with the subscription. 22 | /// The subscription's expiry date. 23 | public CustomerSubscriptionEntity(string customerId, string subscriptionId, string partnerOfferId, DateTime expiryDate) 24 | { 25 | customerId.AssertNotEmpty(nameof(customerId)); 26 | subscriptionId.AssertNotEmpty(nameof(subscriptionId)); 27 | partnerOfferId.AssertNotEmpty(nameof(partnerOfferId)); 28 | 29 | this.CustomerId = customerId; 30 | this.SubscriptionId = subscriptionId; 31 | this.PartnerOfferId = partnerOfferId; 32 | this.ExpiryDate = expiryDate; 33 | } 34 | 35 | /// 36 | /// Gets the customer ID who owns the subscription. 37 | /// 38 | public string CustomerId { get; private set; } 39 | 40 | /// 41 | /// Gets the subscription ID. 42 | /// 43 | public string SubscriptionId { get; private set; } 44 | 45 | /// 46 | /// Gets the partner offer ID associated with the subscription. 47 | /// 48 | public string PartnerOfferId { get; private set; } 49 | 50 | /// 51 | /// Gets the subscription's expiry date. 52 | /// 53 | public DateTime ExpiryDate { get; private set; } 54 | } 55 | } -------------------------------------------------------------------------------- /src/Storefront/Models/BrandingConfiguration.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System; 10 | using System.IO; 11 | 12 | /// 13 | /// Holds the website's branding configuration. 14 | /// 15 | public class BrandingConfiguration 16 | { 17 | /// 18 | /// Gets or sets the user identifier to be associated with the acceptance of the MCA. 19 | /// 20 | public string AgreementUserId { get; set; } 21 | 22 | /// 23 | /// Gets or sets the contact sales information. 24 | /// 25 | public ContactUsInformation ContactSales { get; set; } 26 | 27 | /// 28 | /// Gets or sets the contact us information. 29 | /// 30 | public ContactUsInformation ContactUs { get; set; } 31 | 32 | /// 33 | /// Gets or sets the header image. 34 | /// 35 | public Uri HeaderImage { get; set; } 36 | 37 | /// 38 | /// Gets or sets the binary content of the header image. 39 | /// 40 | public Stream HeaderImageContent { get; set; } 41 | 42 | /// 43 | /// Gets or sets the Application Insights instrumentation key. 44 | /// 45 | public string InstrumentationKey { get; set; } 46 | 47 | /// 48 | /// Gets or sets the organization name. 49 | /// 50 | public string OrganizationName { get; set; } 51 | 52 | /// 53 | /// Gets or sets the organization logo. 54 | /// 55 | public Uri OrganizationLogo { get; set; } 56 | 57 | /// 58 | /// Gets or sets the binary content of the organization logo. 59 | /// 60 | public Stream OrganizationLogoContent { get; set; } 61 | 62 | /// 63 | /// Gets or sets a privacy link for using the portal. 64 | /// 65 | public Uri PrivacyAgreement { get; set; } 66 | } 67 | } -------------------------------------------------------------------------------- /src/Storefront/Scripts/WebPortal/Utilities/Throttler.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.Utilities.Throttler = function (throttlingPeriod, resourceName) { 2 | /// 3 | /// Throttles access to resources based on a given period. Any incoming requests within the throttling period since the last request 4 | /// will be denied. 5 | /// 6 | /// The period in which to deny incoming requests after accepting a request. 7 | /// The resource name used in logging. 8 | 9 | this.reset(); 10 | 11 | this.throttlingPeriod = throttlingPeriod || $WebPortal.Configuration.DefaultThrottlingDuration; 12 | this.resourceName = resourceName || "Unknown resource"; 13 | }; 14 | 15 | Microsoft.WebPortal.Utilities.Throttler.prototype.throttle = function (callbackFunction, callbackObject) { 16 | /// 17 | /// Throttles incoming requests. 18 | /// 19 | /// The function to invoke. You can pass by optional arguments to the callback function after the first 2 arguments. 20 | /// e.g. tp call your function and send it 1 and "Hello" as arguments you can do something like: throttler.throttle(yourFunction, yourObject, 1, "Hello"); 21 | /// 22 | /// The object on which to invoke the function. Optional. 23 | 24 | $WebPortal.Helpers.throwIfNotSet(callbackFunction, "callbackFunction", "Microsoft.WebPortal.Utilities.Throttler.throttle"); 25 | 26 | var currentTime = new Date(); 27 | 28 | if (currentTime - this.lastProcessedRequestTimeStamp < this.throttlingPeriod) { 29 | $WebPortal.Diagnostics.warningLocal(this.resourceName + ": throttled an incoming request."); 30 | } else { 31 | this.lastProcessedRequestTimeStamp = currentTime; 32 | 33 | // convert the arguments into an array 34 | var args = Array.prototype.slice.call(arguments); 35 | 36 | // call the function and pass the rest of the arguments to it 37 | return callbackFunction.call(callbackObject, args.slice(2)); 38 | } 39 | }; 40 | 41 | Microsoft.WebPortal.Utilities.Throttler.prototype.reset = function () { 42 | /// 43 | /// Resets the throttler. 44 | /// 45 | 46 | // reset the time stamp of the last request accepted 47 | this.lastProcessedRequestTimeStamp = new Date(1983, 8, 8); 48 | }; 49 | 50 | //@ sourceURL=Throttler.js -------------------------------------------------------------------------------- /src/Storefront/Views/Shared/AdminConsole.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 57 | 58 | 59 | 60 |
5 | 8 |
15 |
16 | 17 |
25 | 26 |
32 | 35 | 36 |
42 | 45 | 46 |
52 | 55 | 56 |
-------------------------------------------------------------------------------- /Partner-Center-Storefront.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2036 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{345764CB-D256-42E4-9D32-1101588F542D}" 7 | ProjectSection(SolutionItems) = preProject 8 | .editorconfig = .editorconfig 9 | azuredeploy.json = azuredeploy.json 10 | azuredeploy.param.json = azuredeploy.param.json 11 | CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md 12 | CONTRIBUTING.md = CONTRIBUTING.md 13 | LICENSE = LICENSE 14 | README.md = README.md 15 | EndProjectSection 16 | EndProject 17 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3CD8EE7C-5C97-49ED-9EAA-90AF670FD41A}" 18 | EndProject 19 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storefront", "src\Storefront\Storefront.csproj", "{07C22DE5-B22A-474D-B593-9F5DA84C6DD8}" 20 | EndProject 21 | Project("{151D2E53-A2C4-4D7D-83FE-D05416EBD58E}") = "Deployment", "src\Deployment\Deployment.deployproj", "{0B962FE3-E103-4C00-BFAD-CD35F22A2C19}" 22 | EndProject 23 | Global 24 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 25 | Debug|Any CPU = Debug|Any CPU 26 | Release|Any CPU = Release|Any CPU 27 | EndGlobalSection 28 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 29 | {07C22DE5-B22A-474D-B593-9F5DA84C6DD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {07C22DE5-B22A-474D-B593-9F5DA84C6DD8}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {07C22DE5-B22A-474D-B593-9F5DA84C6DD8}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {07C22DE5-B22A-474D-B593-9F5DA84C6DD8}.Release|Any CPU.Build.0 = Release|Any CPU 33 | {0B962FE3-E103-4C00-BFAD-CD35F22A2C19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 34 | {0B962FE3-E103-4C00-BFAD-CD35F22A2C19}.Debug|Any CPU.Build.0 = Debug|Any CPU 35 | {0B962FE3-E103-4C00-BFAD-CD35F22A2C19}.Release|Any CPU.ActiveCfg = Release|Any CPU 36 | {0B962FE3-E103-4C00-BFAD-CD35F22A2C19}.Release|Any CPU.Build.0 = Release|Any CPU 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | GlobalSection(NestedProjects) = preSolution 42 | {07C22DE5-B22A-474D-B593-9F5DA84C6DD8} = {3CD8EE7C-5C97-49ED-9EAA-90AF670FD41A} 43 | {0B962FE3-E103-4C00-BFAD-CD35F22A2C19} = {3CD8EE7C-5C97-49ED-9EAA-90AF670FD41A} 44 | EndGlobalSection 45 | GlobalSection(ExtensibilityGlobals) = postSolution 46 | SolutionGuid = {51E97A25-EEAA-4F88-A98B-9AE3DCE2057B} 47 | EndGlobalSection 48 | EndGlobal 49 | -------------------------------------------------------------------------------- /src/Storefront/BusinessLogic/Commerce/PaymentGateways/PaymentGatewayConfig.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.Commerce.PaymentGateways 8 | { 9 | using System; 10 | 11 | /// 12 | /// Payment configuration class 13 | /// 14 | public static class PaymentGatewayConfig 15 | { 16 | /// 17 | /// country code 18 | /// 19 | private static string countryCode = ApplicationDomain.Instance.PortalLocalization.CountryIso2Code; 20 | 21 | /// 22 | /// this method is use to get the payment configuration page 23 | /// 24 | /// return view name 25 | public static string GetPaymentConfigView() 26 | { 27 | if (countryCode.Equals("in", StringComparison.InvariantCultureIgnoreCase)) 28 | { 29 | return "PayUPaymentSetup"; 30 | } 31 | 32 | return "PaymentSetup"; 33 | } 34 | 35 | /// 36 | /// Get web configuration path 37 | /// 38 | /// returns web configuration name 39 | public static string GetWebConfigPath() 40 | { 41 | if (countryCode.Equals("in", StringComparison.InvariantCultureIgnoreCase)) 42 | { 43 | return "WebPortalConfigurationPayU.json"; 44 | } 45 | 46 | return "WebPortalConfiguration.json"; 47 | } 48 | 49 | /// 50 | /// creates a payment gateway instance 51 | /// 52 | /// Application domain 53 | /// the description 54 | /// returns payment gateway instance 55 | public static IPaymentGateway GetPaymentGatewayInstance(ApplicationDomain applicationDomain, string description) 56 | { 57 | if (countryCode.Equals("in", StringComparison.InvariantCultureIgnoreCase)) 58 | { 59 | return new PayUGateway(applicationDomain, description); 60 | } 61 | 62 | return new PayPalGateway(applicationDomain, description); 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /src/Storefront/Views/Services/Actions.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/Storefront/Filters/Mvc/AuthorizeAttribute.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Filters.Mvc 8 | { 9 | using System; 10 | using System.Web; 11 | using System.Web.Mvc; 12 | using BusinessLogic; 13 | 14 | /// 15 | /// Implements portal authorization for MVC controllers. 16 | /// 17 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] 18 | public sealed class PortalAuthorizeAttribute : AuthorizeAttribute 19 | { 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The user role to give access to. 24 | public PortalAuthorizeAttribute(UserRole userRole = UserRole.Any) 25 | { 26 | this.UserRole = userRole; 27 | } 28 | 29 | /// 30 | /// Gets or sets the user role which is allowed access. 31 | /// 32 | public UserRole UserRole { get; set; } 33 | 34 | /// 35 | /// Authorizes an incoming request based on the user role. 36 | /// 37 | /// The HTTP context. 38 | /// True if authorized, false otherwise. 39 | protected override bool AuthorizeCore(HttpContextBase httpContext) 40 | { 41 | var principal = httpContext.User as CustomerPortalPrincipal; 42 | return new AuthorizationPolicy().IsAuthorized(principal, this.UserRole); 43 | } 44 | 45 | /// 46 | /// Deals with unauthorized requests. 47 | /// 48 | /// The filter context. 49 | protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext) 50 | { 51 | if (filterContext.HttpContext.Request.IsAjaxRequest()) 52 | { 53 | // send back a 403 54 | filterContext.HttpContext.Response.StatusCode = 403; 55 | } 56 | else 57 | { 58 | // use the default handling for web pages 59 | base.HandleUnauthorizedRequest(filterContext); 60 | } 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /src/Storefront/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront 8 | { 9 | using System; 10 | using System.Runtime.InteropServices; 11 | using System.Security; 12 | 13 | /// 14 | /// Provides extension functions for the string class. 15 | /// 16 | public static class StringExtensions 17 | { 18 | /// 19 | /// Converts the string value to an instance of . 20 | /// 21 | /// The string value to be converted. 22 | /// An instance of that represents the string. 23 | /// 24 | /// is empty or null. 25 | /// 26 | public static SecureString ToSecureString(this string value) 27 | { 28 | SecureString secureValue = new SecureString(); 29 | 30 | value.AssertNotEmpty(nameof(value)); 31 | 32 | foreach (char c in value) 33 | { 34 | secureValue.AppendChar(c); 35 | } 36 | 37 | secureValue.MakeReadOnly(); 38 | 39 | return secureValue; 40 | } 41 | 42 | /// 43 | /// Converts an instance of to a . 44 | /// 45 | /// Secure string to be converted. 46 | /// An instance of that represents the value. 47 | /// 48 | /// is null. 49 | /// 50 | public static string ToUnsecureString(this SecureString secureString) 51 | { 52 | IntPtr unmanagedString = IntPtr.Zero; 53 | 54 | secureString.AssertNotNull(nameof(secureString)); 55 | 56 | try 57 | { 58 | unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(secureString); 59 | return Marshal.PtrToStringUni(unmanagedString); 60 | } 61 | finally 62 | { 63 | Marshal.ZeroFreeGlobalAllocUnicode(unmanagedString); 64 | } 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /src/Storefront/Models/SubscriptionViewModel.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace Microsoft.Store.PartnerCenter.Storefront.Models 8 | { 9 | using System.Collections.Generic; 10 | 11 | /// 12 | /// The subscription view model. 13 | /// 14 | public class SubscriptionViewModel 15 | { 16 | /// 17 | /// Gets or sets the subscription's Id. 18 | /// 19 | public string SubscriptionId { get; set; } 20 | 21 | /// 22 | /// Gets or sets the subscription's portal offer Id. 23 | /// 24 | public string PortalOfferId { get; set; } 25 | 26 | /// 27 | /// Gets or sets the subscription's portal offer Price. 28 | /// 29 | public string PortalOfferPrice { get; set; } 30 | 31 | /// 32 | /// Gets or sets the subscription's friendly name. 33 | /// 34 | public string FriendlyName { get; set; } 35 | 36 | /// 37 | /// Gets or sets a value indicating whether subscription is renewable. 38 | /// 39 | public bool IsRenewable { get; set; } 40 | 41 | /// 42 | /// Gets or sets a value indicating whether subscription is editable. 43 | /// 44 | public bool IsEditable { get; set; } 45 | 46 | /// 47 | /// Gets or sets the total number of licenses for this subscription. 48 | /// 49 | public string LicensesTotal { get; set; } 50 | 51 | /// 52 | /// Gets or sets the total amount for this subscription. 53 | /// 54 | public string SubscriptionTotal { get; set; } 55 | 56 | /// 57 | /// Gets or sets the annual commitment expiration date for this subscription. 58 | /// 59 | public string SubscriptionExpiryDate { get; set; } 60 | 61 | /// 62 | /// Gets or sets the remaining days to expiry for this subscription. 63 | /// 64 | public decimal SubscriptionProRatedPrice { get; set; } 65 | 66 | /// 67 | /// Gets or sets the subscription's order history. 68 | /// 69 | public IEnumerable SubscriptionOrderHistory { get; set; } 70 | } 71 | } -------------------------------------------------------------------------------- /src/Storefront/Scripts/Plugins/ErrorCode.js: -------------------------------------------------------------------------------- 1 | Microsoft.WebPortal.ErrorCode = { 2 | /// 3 | /// The server had a failure it can't understand. 4 | /// 5 | ServerError: 0, 6 | 7 | /// 8 | /// The resource already exists. 9 | /// 10 | AlreadyExists: 1, 11 | 12 | /// 13 | /// An invalid set of inputs was provided. 14 | /// 15 | InvalidInput: 2, 16 | 17 | /// 18 | /// A dependent service has failed. 19 | /// 20 | DownstreamServiceError: 3, 21 | 22 | /// 23 | /// The given subscription could not be found. 24 | /// 25 | SubscriptionNotFound: 4, 26 | 27 | /// 28 | /// The subscription is expired. 29 | /// 30 | SubscriptionExpired: 5, 31 | 32 | /// 33 | /// The subscription could not be updated. 34 | /// 35 | SubscriptionUpdateFailure: 6, 36 | 37 | /// 38 | /// The requested partner offer was not found. 39 | /// 40 | PartnerOfferNotFound: 7, 41 | 42 | /// 43 | /// Failure in accessing persistence. 44 | /// 45 | PersistenceFailure: 8, 46 | 47 | /// 48 | /// Unexpected file type. 49 | /// 50 | InvalidFileType: 9, 51 | 52 | /// 53 | /// Failure in payment gateway. 54 | /// 55 | PaymentGatewayFailure: 10, 56 | 57 | /// 58 | /// A failure due to an attempt to update the Microsoft offer associated with a partner offer. 59 | /// 60 | MicrosoftOfferImmutable: 11, 61 | 62 | /// 63 | /// Maximum request size exceeded error. 64 | /// 65 | MaximumRequestSizeExceeded: 12, 66 | 67 | /// 68 | /// Invalid address. 69 | /// 70 | InvalidAddress: 13, 71 | 72 | /// 73 | /// Domain not available. 74 | /// 75 | DomainNotAvailable: 14, 76 | 77 | /// 78 | /// Purchasing a deleted offer is not allowed. 79 | /// 80 | PurchaseDeletedOfferNotAllowed: 15, 81 | 82 | /// 83 | /// Failure in payment gateway authentication during configuration. 84 | /// 85 | PaymentGatewayIdentityFailureDuringConfiguration: 16, 86 | 87 | /// 88 | /// Failure in payment gateway authentication during payment. 89 | /// 90 | PaymentGatewayIdentityFailureDuringPayment: 17, 91 | 92 | /// 93 | /// Failure in payment gateway during payment. 94 | /// 95 | PaymentGatewayPaymentError: 18 96 | }; 97 | 98 | //@ sourceURL=ErrorCode.js -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /src/Storefront/Views/Shared/RegistrationConfirmation.cshtml: -------------------------------------------------------------------------------- 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 | @Resources.Submit 70 |
71 |
--------------------------------------------------------------------------------