#sébastien

1 messages · Page 1 of 1 (latest)

stark bayBOT
placid lagoon
#

hi! no, we don't have any specific examples in ASP. https://stripe.com/docs/webhooks/quickstart would be the guide for setting up endpoints to receive webhooks from Stripe about successful payments for backend reconcilation; there's an example there in .NET using our .NET library at least.

#

fundamentally though a webhook endpoint is just a normal route on your server that accept an incoming HTTP POST request so it's mostly the same as any other such route you have on your server. The Stripe-specific parts only come in when parsing the JSON send in that POST request

uncut storm
#

Thank you for the answer. Yes, I tried with json but I can't get the data, I only get the error: "message": "Must provide source or customer."

placid lagoon
uncut storm
#

I have this :
État
400 ERR
ID
req_NjFZr4DgNbeQk4
Date et heure
18/11/2022 10:34:15
Adresse IP
141.94.196.90
Version de l'API
2022-08-01
La plus récente
Source
Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)

#

I'm using aspJSON1.18.asp (https://github.com/gerritvankuipers/aspjson) which I adapted with "Content-Type", "application/x-www-form-urlencoded" and setRequestHeader "Authorization", "Bearer sk_test..." and on my page:

Set oJSON = New aspJSON
jsonstring = "https://api.stripe.com/v1/charges"
oJSON.loadJSON(jsonstring)
Response.Write oJSON.JSONoutput()

GitHub

Classic ASP JSON Class Reading/Writing. Contribute to gerritvankuipers/aspjson development by creating an account on GitHub.

placid lagoon
#

you can't send JSON to our API, that's why.

#

POST requests you send to us have to be using x-form-www-urlencoded . Our responses are in JSON, but you POST to us in x-form-www-urlencoded

#

you also should not be using the legacy /v1/charges API and should not write your own code to call our API, you should use our libraries like https://github.com/stripe/stripe-dotnet and our official guides like https://stripe.com/docs/payments/accept-a-payment . I do appreciate it's difficult if you're using something like Classic ASP though, we don't really have great support for that so you'd need be very comfortable with using our API directly if you want to take this approach.

uncut storm
#

Yes, absolutely, it's very complicated, that's why I came here looking for some help. I can hardly mix languages and was looking for a solution in classic asp to adapt our current IPN pages as simply as possible.
I am just testing with no-code payment but I need to be notified that an order has gone through to update my database

placid lagoon
#

you can use webhooks for the notification part as mentioned above. That is unrelated to the code you shared or request you made though(a webhook doesn't involve calling our API as the first step, it involves setting up a HTTP endpoint on your server to receive incoming requests/calls that Stripe makes to you). We might be able to help if you have more clarity on that part of the integration and what you're having trouble with.

uncut storm
#

Tank you. Something escapes me indeed in the Stripe logic. With Paypal, I indicate in the dashboard a notification page (like the endpoint of Stripe, right?) and Paypal, once an order has been received, calls this page and sends it all the variables that I can automaticly extract and process to update update my database and notify my client that his subscription is up to date. I'm lost between the webhook and the endpoint... I just want to retrieve the info that the order went well, its amount and my customer's ID...

placid lagoon
#

yep that's what our webhooks are , it's the same thing

#

you say "here is a URL https://example.com/webhook" and enter it on your Stripe dashboard. When something happens on your Stripe account, like a successful payment, we send a HTTP POST request to that URL. We call that request a webhook. The POST body of that request contains an JSON "Event" object from our API. The code on your server parses/extracts information from that Event to get all the details like amount paid and such, and update your databases. That's fundamentally the same thing as what Paypal calls an IPN I think, just different terminology and modern web approaches like JSON instead of SOAP :p

#

it might help if you could share some specific code of the endpoint you've attempted to write or specific questions where you're stuck or had problems after reading all the docs and guides!

uncut storm
#

I have shared the code with you but it seems that I am using the wrong method. It's the json that I don't know very well. I will continue to dig into the question and come back here to be more specific. Thank you for you precious help