Aar*_*own 9 vb.net api stripe-payments
我没有看到条纹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
Run Code Online (Sandbox Code Playgroud)
402"需要付款"错误发生在线上:
Dim STR_Response As String = Encoding.ASCII.GetString(OBJ_Webclient.UploadValues(STR_Stripe_API_URL, OBJ_Transaction))
Run Code Online (Sandbox Code Playgroud)
好吧,我切换到我的"LIVE"键而不是我的"TEST"键,并修复了它.我浪费了3个小时试图解决这个问题.希望这有助于其他人.