问题描述
我一直在使用 Stripe。结帐时 X 将在每次客户到达结帐时创建付款意图。这将导致“不完整”付款。
我在我的 .Net Core 应用程序中集成了 STRIPE。这里的代码如下:
public void Pay(CardInfo cardInfo,double amount)
{
StripeConfiguration.ApiKey = _paramList["secretKey"];
State = PaymentState.Pending;
try
{
var options = new SessionCreateOptions
{
Mode = "payment",SuccessUrl = "https://example.com/success",CancelUrl = "https://example.com/cancel",Customer = cardInfo.Owner,CustomerEmail = cardInfo.ParamList["email"],PaymentMethodTypes = new List<string>
{
"card",},LineItems = new List<SessionLineItemOptions>
{
new SessionLineItemOptions
{
Amount = Convert.ToInt64(amount.ToString().Replace(",","")),Currency = "eur",Quantity = 1,Name = _paramList["account"]
},};
var service = new SessionService();
service.Create(options);
State = PaymentState.Accepted;
}
catch (StripeException error)
{
State = PaymentState.Error;
PaymentReturn = error.Message;
Logger.Write(string.Format("Error STRIPE payment status {0} : ",PaymentReturn));
}
}
在我的表单付款中,我没有使用条纹表单,但我创建了一个表单并检索了我需要的所有信息(卡号、CVV、到期日、电子邮件和金额)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)