Skip to content

Commit

Permalink
dev: 3.0.1: Add support Tls1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-freitas-gn committed Jul 11, 2019
1 parent 7614880 commit 9429e2f
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/dll-compilada/Call Logs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added src/dll-compilada/GerenciaDemo.exe
Binary file not shown.
Binary file added src/dll-compilada/GerenciaNet.dll
Binary file not shown.
Binary file added src/dll-compilada/MSVCR100.DLL
Binary file not shown.
152 changes: 152 additions & 0 deletions src/dll-compilada/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"URL": {
"production": "https://api.gerencianet.com.br",
"sandbox": "https://sandbox.gerencianet.com.br"
},
"ENDPOINTS": {
"authorize": {
"route": "/v1/authorize",
"method": "post"
},
"createCharge": {
"route": "/v1/charge",
"method": "post"
},
"detailCharge": {
"route": "/v1/charge/:id",
"method": "get"
},
"updateChargeMetadata": {
"route": "/v1/charge/:id/metadata",
"method": "put"
},
"updateBillet": {
"route": "/v1/charge/:id/billet",
"method": "put"
},
"payCharge": {
"route": "/v1/charge/:id/pay",
"method": "post"
},
"cancelCharge": {
"route": "/v1/charge/:id/cancel",
"method": "put"
},
"createCarnet": {
"route": "/v1/carnet",
"method": "post"
},
"detailCarnet": {
"route": "/v1/carnet/:id",
"method": "get"
},
"updateParcel": {
"route": "/v1/carnet/:id/parcel/:parcel",
"method": "put"
},
"updateCarnetMetadata": {
"route": "/v1/carnet/:id/metadata",
"method": "put"
},
"getNotification": {
"route": "/v1/notification/:token",
"method": "get"
},
"getPlans": {
"route": "/v1/plans",
"method": "get"
},
"createPlan": {
"route": "/v1/plan",
"method": "post"
},
"deletePlan": {
"route": "/v1/plan/:id",
"method": "delete"
},
"createSubscription": {
"route": "/v1/plan/:id/subscription",
"method": "post"
},
"detailSubscription": {
"route": "/v1/subscription/:id",
"method": "get"
},
"paySubscription": {
"route": "/v1/subscription/:id/pay",
"method": "post"
},
"cancelSubscription": {
"route": "/v1/subscription/:id/cancel",
"method": "put"
},
"updateSubscriptionMetadata": {
"route": "/v1/subscription/:id/metadata",
"method": "put"
},
"getInstallments": {
"route": "/v1/installments",
"method": "get"
},
"resendBillet": {
"route": "/v1/charge/:id/billet/resend",
"method": "post"
},
"createChargeHistory": {
"route": "/v1/charge/:id/history",
"method": "post"
},
"resendCarnet": {
"route": "/v1/carnet/:id/resend",
"method": "post"
},
"resendParcel": {
"route": "/v1/carnet/:id/parcel/:parcel/resend",
"method": "post"
},
"createCarnetHistory": {
"route": "/v1/carnet/:id/history",
"method": "post"
},
"cancelCarnet": {
"route": "/v1/carnet/:id/cancel",
"method": "put"
},
"cancelParcel": {
"route": "/v1/carnet/:id/parcel/:parcel/cancel",
"method": "put"
},
"linkCharge": {
"route": "/v1/charge/:id/link",
"method": "post"
},
"chargeLink": {
"route": "/v1/charge/:id/link",
"method": "post"
},
"updateChargeLink": {
"route": "/v1/charge/:id/link",
"method": "put"
},
"updatePlan": {
"route": "/v1/plan/:id",
"method": "put"
},
"createSubscriptionHistory": {
"route": "/v1/subscription/:id/history",
"method": "post"
},
"createChargeBalanceSheet": {
"route": "/v1/charge/:id/balance-sheet",
"method": "post"
},
"settleCharge": {
"route": "/v1/charge/:id/settle",
"method": "put"
},
"settleCarnetParcel": {
"route": "/v1/carnet/:id/parcel/:parcel/settle",
"method": "put"
}
}
}
Binary file added src/dll-compilada/libeay32.dll
Binary file not shown.
Binary file added src/dll-compilada/openssl.exe
Binary file not shown.
Binary file added src/dll-compilada/ssleay32.dll
Binary file not shown.
8 changes: 6 additions & 2 deletions src/dll-src/uGerenciaNetIndy.pas
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ function TokenExpired: Boolean;
ProxyPort: Integer;
ExpireDateTime : TDateTime;

const API_SDK = 'delphi-2.0.0';
const API_SDK = 'delphi-3.0.1';

implementation

uses SysUtils, idHTTP, idLogFile, uGerenciaTools, idStackConsts,idSocketHandle;
uses SysUtils, idHTTP, idLogFile, uGerenciaTools, idStackConsts, idSocketHandle, IdSSLOpenSSL, IdIOHandler;

Type

Expand Down Expand Up @@ -51,6 +51,9 @@ function SetupClient: TIdHTTP;

Result.ConnectTimeout := 20000;
Result.HTTPOptions := Result.HTTPOptions + [hoWantProtocolErrorContent]+ [ hoNoProtocolErrorException ];
Result.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
TIdSSLIOHandlerSocketOpenSSL(Result.IOHandler).SSLOptions.SSLVersions := [sslvTLSv1_2];

{$IFDEF DEBUG}
Result.Intercept := HttpLog;
{$ENDIF}
Expand All @@ -74,6 +77,7 @@ function PrepareGerenciaRequest( EndPoint, Body: String;Parameters: TStringList;
else Result.Body := nil;
HttpClient.Request.ContentType := 'application/json';
HttpClient.Request.Accept := 'application/json';
HttpClient.Request.UserAgent := 'User-Agent: Mozilla/3.0 (compatible; Indy Library)';
if IsOAuth then
begin
HttpClient.Request.BasicAuthentication := True;
Expand Down

0 comments on commit 9429e2f

Please sign in to comment.