Я пытаюсь интегрировать полосу в мое приложение asp.net. Я использую Visual Studio 17 и целевой .Net Framework является 4.6.1
Пост, за которым я следовал в точности
Ниже код моего контроллера:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Stripe;
namespace DonationProgram.Controllers
{
public class DonationController : Controller
{
// GET: Donation
public ActionResult Index()
{
var stripePublishKey = ConfigurationManager.AppSettings["pk_test_Ih2IeiHk6PmK19pdh7UPijhr"];
ViewBag.StripePublishKey = stripePublishKey;
return View();
}
public ActionResult Charge(string stripeEmail, string stripeToken)
{
var customers = new StripeCustomerService();
var charges = new StripeChargeService();
var customer = customers.Create(new StripeCustomerCreateOptions
{
Email = stripeEmail,
SourceToken = stripeToken
});
var charge = charges.Create(new StripeChargeCreateOptions
{
Amount = 500,//charge in cents
Description = "Sample Charge",
Currency = "usd",
CustomerId = customer.Id
});
// further application specific code goes here
return View();
}
}
}
Но в new StripeCustomerService()
, new StripeChargeService()
& new StripeCustomerCreateOptions
есть ошибки, говорящие о том, что «тип или пространство имен не может быть найдено», хотя я использую пространство имен Stripe.