pedropaf / saas-ecom

Subscription support for ASP.NET MVC 5 apps using Stripe, including out-of-the-box view helpers. Available via NuGET
http://www.saasecom.org
Apache License 2.0
101 stars 41 forks source link

Missing required param: source. #13

Open smooney1234 opened 8 years ago

smooney1234 commented 8 years ago

Hello,

I keep getting the error message above. I am trying to add the card to stripe before creating the users subscription.

private StripeCard AddCardToStripe(CreditCard card, string stripeCustomerId) { var options = new StripeCardCreateOptions { Source = new StripeSourceOptions { TokenId = card.StripeToken } }; //nothing is picked up here i.e. the token is not being passed in.

        var requestOptions = new StripeRequestOptions
        {
            ApiKey = _apiKeyRequest,
            IdempotencyKey = IdempotencyKey,
            StripeConnectAccountId = StripeConnectAccountId        
        };

        return _cardService.Create(stripeCustomerId, options, requestOptions);
    }

Any help would be great, thanks.