Merge pull request #32 from microsoft/sankargo/091220193PPActivation
Included sample for Sandbox 3PP Subscription activation.
This commit is contained in:
Коммит
c47bb9609f
|
@ -356,7 +356,8 @@ namespace Microsoft.Store.PartnerCenter.Samples
|
|||
new AddSubscriptionAddOn(context),
|
||||
new ConvertTrialSubscription(context),
|
||||
new CancelSaaSSubscription(context),
|
||||
new ToggleSubscriptionAutoRenew(context)
|
||||
new ToggleSubscriptionAutoRenew(context),
|
||||
new ActivateSandboxThirdPartySubscription(context),
|
||||
};
|
||||
|
||||
return new AggregatePartnerScenario("Subscription samples", subscriptionScenarios, context);
|
||||
|
|
|
@ -243,6 +243,7 @@
|
|||
<Compile Include="ServiceRequests\GetPartnerServiceRequestDetails.cs" />
|
||||
<Compile Include="ServiceRequests\GetServiceRequestSupportTopics.cs" />
|
||||
<Compile Include="ServiceRequests\UpdatePartnerServiceRequest.cs" />
|
||||
<Compile Include="Subscriptions\ActivateSandboxThirdPartySubscription.cs" />
|
||||
<Compile Include="Subscriptions\CancelSaaSSubscription.cs" />
|
||||
<Compile Include="Subscriptions\ConvertTrialSubscription.cs" />
|
||||
<Compile Include="Subscriptions\GetSubscription.cs" />
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
// -----------------------------------------------------------------------
|
||||
// <copyright file="ActivateSandboxThirdPartySubscription.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Store.PartnerCenter.Samples.Subscriptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Activate Sandbox 3PP subscription.
|
||||
/// </summary>
|
||||
public class ActivateSandboxThirdPartySubscription : BasePartnerScenario
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActivateSandboxThirdPartySubscription"/> class.
|
||||
/// </summary>
|
||||
/// <param name="context">The scenario context.</param>
|
||||
public ActivateSandboxThirdPartySubscription(IScenarioContext context) : base("Activate Sandbox third party subscription", context)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes the scenario.
|
||||
/// </summary>
|
||||
protected override void RunScenario()
|
||||
{
|
||||
var partnerOperations = this.Context.UserPartnerOperations;
|
||||
var customerId = this.ObtainCustomerId();
|
||||
var subscriptionId = this.ObtainSubscriptionId(customerId, "Enter the ID of the subscription to activate");
|
||||
var subscriptionOperations = partnerOperations.Customers.ById(customerId).Subscriptions.ById(subscriptionId);
|
||||
|
||||
this.Context.ConsoleHelper.StartProgress("Activating subscription");
|
||||
var subscriptionActivationResult = subscriptionOperations.Activate();
|
||||
this.Context.ConsoleHelper.StopProgress();
|
||||
|
||||
this.Context.ConsoleHelper.WriteObject(subscriptionActivationResult, "Subscription activation result");
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче