加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

vb.net – 为什么Stripe.com返回错误(402)需要付款?

发布时间:2020-12-17 00:22:14 所属栏目:大数据 来源:网络整理
导读:我没有看到条纹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
我没有看到条纹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响应的正文:

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读