public async Task CreateSubscriptionTest()
        {
            // Arrange
            var args = new SubscriptionCreateArguments
            {
                CustomerId = "customer-id"
            };
            _stripe.Post(
                Arg.Is<StripeRequest<SubscriptionCreateArguments, Sdk.Models.Subscription>>(
                    a => a.UrlPath == "customers/" + args.CustomerId + "/subscriptions" && a.Model == args),
                _cancellationToken).Returns(Task.FromResult(new StripeResponse<Sdk.Models.Subscription>()));

            // Act
            var response = await _client.CreateSubscription(args, _cancellationToken);

            // Assert
            response.Should().NotBeNull();
        }
Ejemplo n.º 2
0
 public async Task<StripeResponse<Models.Subscription>> CreateSubscription(SubscriptionCreateArguments arguments,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new StripeRequest<SubscriptionCreateArguments, Models.Subscription>
     {
         UrlPath = PathHelper.GetPath(Paths.Customers, arguments.CustomerId, Paths.Subscriptions),
         Model = arguments
     };
     return await _client.Post(request, cancellationToken);
 }
 public void Init()
 {
     _args = GenFu.GenFu.New<SubscriptionCreateArguments>();
 }