VB   发布时间:2022-04-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了vb.net – 为什么Stripe.com返回错误(402)需要付款?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我没有看到条纹API中描述的这个特定错误.有谁知道发生了什么事?

这是我创建客户的VB.net代码:

Function CreateStripeCustomer(ByVal Token As String) As String
    ''  The Stripe Account API Token - change this for tesTing 
    Dim STR_Stripe_API_Token As String = "sk_test_SECRET_test_KEY" '<-- test secret key. Change to live later.
    ''The Stripe API URL
    Dim STR_Stripe_API_URL As String = "https://api.Stripe.com/v1/customers"
    ''Creates a Web Client
    Dim OBJ_Webclient As New System.Net.WebClient()
    ''Creates Credentials
    Dim OBJ_Credentials As New System.Net.NetworkCredential(STR_Stripe_API_Token,"MY_StriPE.COM_password")
    ''Sets the Credentials on the Web Client
    OBJ_Webclient.Credentials = OBJ_Credentials
    ''Creates a transaction with Data that Will be Sent to Stripe
    Dim OBJ_transaction As New System.Collections.Specialized.NameValueCollection()
    OBJ_transaction.Add("email","PERFECTLY_VALID_EMAIL")
    OBJ_transaction.Add("card","PERFECTLY VALID TOKEN RETURNED BY StriPE.JS")
    ''The Stripe Response String
    Dim STR_Response As String = Encoding.ASCII.GetString(OBJ_Webclient.UploadValues(STR_Stripe_API_URL,OBJ_transaction))
    Return STR_Response
End Function

402“需要付款”错误发生在线上:

Dim STR_Response As String = Encoding.ASCII.GetString(OBJ_Webclient.UploadValues(STR_Stripe_API_URL,OBJ_transaction))
如果你现场看到这个,卡号也可能是不正确的,例如:如果你检查402响应的正文:

大佬总结

以上是大佬教程为你收集整理的vb.net – 为什么Stripe.com返回错误(402)需要付款?全部内容,希望文章能够帮你解决vb.net – 为什么Stripe.com返回错误(402)需要付款?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。