Libcurl and Stripe


#1

Hello
I also asked Mike Duglas for help but maybe someone here know the answer.
I’m using Stripe API and second call looks like this:

curl https://api.stripe.com/v1/charges \
  -u sk_test_xqpWDTDwbnbfbVYVVpet70mp: \
  -d amount=999 \
  -d currency=usd \
  -d description="Example charge" \
  -d source=tok_visa

I meant to use something like this:

loc:link = https://api.stripe.com/v1/charges

loc:postParams = ‘amount=999&currency=usd&description=“Example charge”&source=tok_visa’

res = curl.SendRequestStr(loc:link, loc:PostParams, respBuffer)

but I don’t know how to use first parameter:

-u sk_test_xqpWDTDwbnbfbVYVVpet70mp:

Thank you


#2

I highly recommend prototyping in something like Postman and then, once you figure out the correct incantations, you will have a huge headstart on implementing it. Postman even generates code for you, libcurl being one of the target languages.


#3

-u switch means user:pwd pair, so you should call

curl.SetUserPwd(‘sk_test_xqpWDTDwbnbfbVYVVpet70mp’, ‘’)

in this case.


#4

Ok, thank you so much, I will do that.


#5