Herkese Merhabalar.
Hayırlı günler diliyorum.
Yemek sepeti delivery hero ile ilgili Webhook sistemine geçişten sonra bir sorun yaşıyorum, Bu konuda geçiş yapan arkadaşlar var ise onlardan yardım rica ediyorum.
Kısaca özetlemek gerekirse yazdığımız webhook sistemine Yemek sepeti siparişleri post edemediğini söylüyor. Çıkan hata : "Pos plugin response not a valid json"
Ama işin ilginç olanı ben de WebModuleBeforeDispatch kısmında istek veya hata görmüyorum.
TCP olarak gelen pakete baktığımda gelen log bu şekilde
11:08:47 [Webhook] === RAW HEADERS ===
11:08:47 [Webhook] POST /order/new HTTP/1.1
11:08:47 [Webhook] Content-Type: application/json
11:08:47 [Webhook] Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtaWRkbGV3YXJlIiwic2VydmljZSI6Im1pZGRsZXdhcmUiLCJpYXQiOjE3NTk3OTM5NzJ9.LJ4mIC_vY9eJv8xskHc3GYp6Z4kitL58fwJAzdEPRdjUyOLoQD6BbUD90QbdUvWv5mpMfk0fpQpi8TWDXhYTPw
11:08:47 [Webhook] User-Agent: PostmanRuntime/7.48.0
11:08:47 [Webhook] Accept: */*
11:08:47 [Webhook] Postman-Token: 35652033-3ea7-4b50-a9e5-9f475a99df6b
11:08:47 [Webhook] Host: http://www.webpages.com:4443
11:08:47 [Webhook] Accept-Encoding: gzip, deflate, br
11:08:47 [Webhook] Connection: keep-alive
11:08:47 [Webhook] Content-Length: 252
11:08:47 [Webhook] === END RAW HEADERS ===
11:08:47 [Webhook] >>> INDY EXCEPTION: Error in parsing command.
11:08:47 [Webhook] Indy Exception: Error in parsing command.,
Bu konuda bilgi ve yorum sunacak herkese şimdiden teşekkür ediyorum.
Hayırlı günler diliyorum.
Yemek sepeti delivery hero ile ilgili Webhook sistemine geçişten sonra bir sorun yaşıyorum, Bu konuda geçiş yapan arkadaşlar var ise onlardan yardım rica ediyorum.
Kısaca özetlemek gerekirse yazdığımız webhook sistemine Yemek sepeti siparişleri post edemediğini söylüyor. Çıkan hata : "Pos plugin response not a valid json"
Ama işin ilginç olanı ben de WebModuleBeforeDispatch kısmında istek veya hata görmüyorum.
procedure TWebBroker.TCPOnExecute(AContext: TIdContext);
var
IO: TIdIOHandler;
ReqLine, HdrLine, Auth, Body: string;
Len: Integer;
begin
IO := AContext.Connection.IOHandler;
// 1. Request line
ReqLine := IO.ReadLn;
FLogger.Log('RAW-REQ: ' + ReqLine);
// 2. Headers
Auth := '';
Len := 0;
repeat
HdrLine := IO.ReadLn;
if HdrLine = '' then Break;
if Pos('AUTHORIZATION:', UpperCase(HdrLine)) = 1 then
Auth := Trim(Copy(HdrLine, 16, MaxInt));
if Pos('CONTENT-LENGTH:', UpperCase(HdrLine)) = 1 then
Len := StrToIntDef(Trim(Copy(HdrLine, 16, MaxInt)), 0);
until False;
// 3. Body
if Len > 0 then
begin
Body := IO.ReadString(Len);
FLogger.Log('RAW-BODY: ' + Body);
end;
// 4. Hemen 202 Accepted
IO.WriteLn('HTTP/1.1 202 Accepted');
IO.WriteLn('Content-Type: application/json');
IO.WriteLn('Authorization: ' + Auth);
IO.WriteLn('');
IO.WriteLn('{"status":"accepted"}');
end;
TCP olarak gelen pakete baktığımda gelen log bu şekilde
11:08:47 [Webhook] === RAW HEADERS ===
11:08:47 [Webhook] POST /order/new HTTP/1.1
11:08:47 [Webhook] Content-Type: application/json
11:08:47 [Webhook] Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtaWRkbGV3YXJlIiwic2VydmljZSI6Im1pZGRsZXdhcmUiLCJpYXQiOjE3NTk3OTM5NzJ9.LJ4mIC_vY9eJv8xskHc3GYp6Z4kitL58fwJAzdEPRdjUyOLoQD6BbUD90QbdUvWv5mpMfk0fpQpi8TWDXhYTPw
11:08:47 [Webhook] User-Agent: PostmanRuntime/7.48.0
11:08:47 [Webhook] Accept: */*
11:08:47 [Webhook] Postman-Token: 35652033-3ea7-4b50-a9e5-9f475a99df6b
11:08:47 [Webhook] Host: http://www.webpages.com:4443
11:08:47 [Webhook] Accept-Encoding: gzip, deflate, br
11:08:47 [Webhook] Connection: keep-alive
11:08:47 [Webhook] Content-Length: 252
11:08:47 [Webhook] === END RAW HEADERS ===
11:08:47 [Webhook] >>> INDY EXCEPTION: Error in parsing command.
11:08:47 [Webhook] Indy Exception: Error in parsing command.,
Bu konuda bilgi ve yorum sunacak herkese şimdiden teşekkür ediyorum.

