Hello friends.
I'm starting a function using cURL and right at the beginning in "CURL_GLOBAL_INIT()" it gives me an error according to the image.
Would anyone know what it can be?
Thanks
#INCLUDE "FIVEWIN.CH"
#INCLUDE "HBCURL.CH"
FUNCTION TESTE()
LOCAL ClientID := "Client_Id_845d87fc2a97b8b4a8aada2f0d9df2aceca50031"
LOCAL ClientSecret := "Client_Secret_57917244d7a42f96ff2c1ec4e6eeb0740f61eb6c"
LOCAL hWebService
CURL_GLOBAL_INIT()
hWebService := CURL_EASY_INIT()
IF !EMPTY(hWebService)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_URL, "https://sandbox.gerencianet.com.br/v1/charge/one-step")
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_RETURNTRANSFER, .T.)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_ENCODING, '')
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_MAXREDIRS, 10)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_TIMEOUT, 0)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_FOLLOWLOCATION, .T.)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_CUSTOMREQUEST, "POST")
// CURL_EASY_SETOPT(hWebService, HB_CURLOPT_POSTFIELDS, {"items": {"name": "Product 1",;
// "value": 500,;
// "amount": 1},;
// "shippings": {"name": "Default Shipping Cost",;
// "value": 100}, ;
// "payment": {"banking_billet": {"expire_at": "2019-10-16",;
// "customer": {"name": "Gorbadoc Oldbuck",;
// "email": "gorb.oldbuck@gerencianet.com.br",;
// "cpf": "14014603059",;
// "birth": "1977-01-15",;
// "phone_number": "62986070247"}}}})
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_HTTPHEADER,array('Authorization: {{Authorization}}','Content-Type: application/json'))
ENDIF
CURL_GLOBAL_CLEANUP()
RETURN NIL
$ response = curl_exec ($ curl);
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 42 guests