Sample code for 30+ languages & platforms
Visual FoxPro

PayPal PayFlowPro - Send Transaction to Server

See more HTTP Misc Examples

Sends a simple transaction to the Gateway server.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loHttp
LOCAL loReq
LOCAL loResp

lnSuccess = 0

* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.

loHttp = CreateObject('Chilkat.Http')

* Implements the following CURL command:

* curl https://pilot-payflowpro.paypal.com -d PARTNER=PayPal -d VENDOR=zzz -d USER=zzz -d PWD=zzzzz -d TRXTYPE=S -d AMT=40 -d CREATESECURETOKEN=Y -d SECURETOKENID=XXXEFF0A-XXXX-4585-XXXX-B763B1F1XXXX

* Use the following online tool to generate HTTP code from a CURL command
* Convert a cURL Command to HTTP Source Code

loReq = CreateObject('Chilkat.HttpRequest')
loReq.HttpVerb = "POST"
loReq.Path = "/"
loReq.ContentType = "application/x-www-form-urlencoded"
loReq.AddParam("PARTNER","PayPal")
loReq.AddParam("VENDOR","zzz")
loReq.AddParam("USER","zzz")
loReq.AddParam("PWD","zzzzz")
loReq.AddParam("TRXTYPE","S")
loReq.AddParam("AMT","40")
loReq.AddParam("CREATESECURETOKEN","Y")
loReq.AddParam("SECURETOKENID","XXXEFF0A-XXXX-4585-XXXX-B763B1F1XXXX")

loResp = CreateObject('Chilkat.HttpResponse')
lnSuccess = loHttp.HttpReq("https://pilot-payflowpro.paypal.com",loReq,loResp)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loReq
    RELEASE loResp
    CANCEL
ENDIF

? "Status code: " + STR(loResp.StatusCode)
? "Response body:"
? loResp.BodyStr

RELEASE loHttp
RELEASE loReq
RELEASE loResp