Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
Yemek Sepeti Delivery Hero
#1
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.

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.
Cevapla


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
  Delphi Trendyol Yemek Entegrasyonu narkotik 22 7.426 12-12-2022, Saat: 10:07
Son Yorum: slyurt
  Yemek Sepeti Entegrasyonu - Authentication Failed (401) hatası meko 12 6.949 23-10-2021, Saat: 00:01
Son Yorum: tmrksmt



Konuyu Okuyanlar: 1 Ziyaretçi