微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

STRIPE API Payment Intent 未完成支付

如何解决STRIPE API Payment Intent 未完成支付

我一直在使用 Stripe。结帐时 X 将在每次客户到达结帐时创建付款意图。这将导致“不完整”付款。

enter image description here

我在我的 .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 举报,一经查实,本站将立刻删除。