You find this example project in your Plugins Download as a Xojo project file within the examples folder: /CURL/WebServices/Stripe WebService
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
// from examples we got this curl command line:
'curl https://api.stripe.com/v1/charges \
'-u sk_test_ your id here: \
'-d amount=400 \
'-d currency=usd \
'-d "description=Charge for test@example.com" \
'-d "source[object]=card" \
'-d "source[number]=4242424242424242" \
'-d "source[exp_month]=12" \
'-d "source[exp_year]=2017" \
'-d "source[cvc]=123"
dim datas() as string
datas.Append "amount=" + EncodeURLComponent("400")
datas.Append "currency=" + EncodeURLComponent("usd")
datas.Append "description=" + EncodeURLComponent("Charge for test@example.com")
datas.Append "source[object]=" + EncodeURLComponent("card")
datas.Append "source[number]=" + EncodeURLComponent("4242424242424242")
datas.Append "source[exp_month]=" + EncodeURLComponent("12")
datas.Append "source[exp_year]=" + EncodeURLComponent("2017")
datas.Append "source[cvc]=" + EncodeURLComponent("123")
dim c as new CURLSMBS
c.OptionVerbose = true
c.OptionURL = "https://api.stripe.com/v1/charges"
c.OptionUsername = "sk_test_ your id here"
c.OptionPost = true
c.OptionPostFields = Join(datas, "&")
c.OptionSSLVersion = c.kSSLVersionTLSv12
dim e as integer = c.Perform
DebugTextArea.Text = c.DebugMessages
ResultTextArea.Text = c.OutputData
End EventHandler
End Control
Control ResultTextArea Inherits TextArea
ControlInstance ResultTextArea Inherits TextArea
End Control
Control DebugTextArea Inherits TextArea
ControlInstance DebugTextArea Inherits TextArea
End Control
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar