I am okay in Classic ASP coding and in the process of learning C#.
On stripe, this documentation is available for .net
I would initially like to create a subscription via classic asp, but get errors in the way I refer/syntax errors!
' returning from https://api.stripe.com/v1/customers
if (oXMLHttp.status = 200) Then
Set oJSON = New aspJSON
oJSON.loadJSON(oXMLHttp.responseText)
stripecustomerid = oJSON.data("id")
Set oXMLHttp = Nothing
url = "https://api.stripe.com/v1/subscriptions"
sendstr = "customer=" & stripecustomerid & **"&items[price].[id]=" & "price_1JZtqEASSxQ8uiR9U5uEZNH9"
Set oXMLHttp=Server.Createobject("MSXML2.ServerXMLHTTP.6.0")
oXMLHttp.open "POST", url,false
oXMLHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXMLHttp.setRequestHeader "Authorization","Bearer " & skey
oXMLHttp.send sendstr
if (oXMLHttp.status = 200) Then
oJSON.loadJSON(oXMLHttp.responseText)
response.write oXMLHttp.responseText
else
response.write oXMLHttp.responseText
end if
this is the error received from Stripe
{ "error": { "message": "Invalid array", "param": "items", "type": "invalid_request_error" } }
Before the call to subscription, I create a new customer and gets the new stripecustomerid back fine. Is there anybody who can guide me in writing the right syntax for calling the subscriptions API from Classic ASP?
Note: price_1JZtqEASSxQ8uiR9U5uEZNH9
is created within the stripe dashboard.