[GH-ISSUE #146] $client->createDraftBasicInvoice(); // bu adımda hata alıyorum. #115

Closed
opened 2026-03-02 04:06:57 +03:00 by kerem · 4 comments
Owner

Originally created by @kozmoCode on GitHub (Jan 31, 2025).
Original GitHub issue: https://github.com/furkankadioglu/efatura/issues/146

Merhaba , proje üzerinde emeği geçen herkese teşekkür ediyorum.

Projeyi test ortamında çalıştırıyorum ve herhangi bir hata almıyorum ancak gerçek ortamda çalıştırdığımda , $client->createDraftBasicInvoice(); adımında Bu mükellef (VKN/TCKN:xxxxxxxxxxx) e-Fatura kullanıcısı. Hatası alıyorum. hatanın oluştuğu fonksiyonunun detaylarını aşağıda paylaştım.

   public function createDraftBasicInvoice(Invoice $invoice = null)
    {
        if ($invoice != null) {
            $this->invoice = $invoice;
        }

        if ($this->invoice == null) {
            throw new NullDataException("Invoice variable not exist");
        }
        $parameters = [
            "cmd" => "EARSIV_PORTAL_FATURA_OLUSTUR",
            "callid" => Uuid::uuid1()->toString(),
            "pageName" => "RG_BASITFATURA",
            "token" => $this->token,
            "jp" => "" . json_encode($this->invoice->export()) . ""
        ];

        $body = $this->sendRequestAndGetBody(self::DISPATCH_PATH, $parameters);

        $this->checkError($body);


        if ($body["data"] != "Faturanız başarıyla oluşturulmuştur. Düzenlenen Belgeler menüsünden faturanıza ulaşabilirsiniz.") {

            $responseData = [
                'error' => $body['data'] 
            ];

            die(json_encode($responseData)); // hatanın geldiği yer burası
        }

        return $this;
    }

Yardımcı olabilirseniz çok sevinirim. Şimdiden teşekkürler.

Originally created by @kozmoCode on GitHub (Jan 31, 2025). Original GitHub issue: https://github.com/furkankadioglu/efatura/issues/146 Merhaba , proje üzerinde emeği geçen herkese teşekkür ediyorum. Projeyi test ortamında çalıştırıyorum ve herhangi bir hata almıyorum ancak gerçek ortamda çalıştırdığımda , $client->createDraftBasicInvoice(); adımında Bu mükellef (VKN/TCKN:xxxxxxxxxxx) e-Fatura kullanıcısı. Hatası alıyorum. hatanın oluştuğu fonksiyonunun detaylarını aşağıda paylaştım. ``` public function createDraftBasicInvoice(Invoice $invoice = null) { if ($invoice != null) { $this->invoice = $invoice; } if ($this->invoice == null) { throw new NullDataException("Invoice variable not exist"); } $parameters = [ "cmd" => "EARSIV_PORTAL_FATURA_OLUSTUR", "callid" => Uuid::uuid1()->toString(), "pageName" => "RG_BASITFATURA", "token" => $this->token, "jp" => "" . json_encode($this->invoice->export()) . "" ]; $body = $this->sendRequestAndGetBody(self::DISPATCH_PATH, $parameters); $this->checkError($body); if ($body["data"] != "Faturanız başarıyla oluşturulmuştur. Düzenlenen Belgeler menüsünden faturanıza ulaşabilirsiniz.") { $responseData = [ 'error' => $body['data'] ]; die(json_encode($responseData)); // hatanın geldiği yer burası } return $this; } ``` Yardımcı olabilirseniz çok sevinirim. Şimdiden teşekkürler.
kerem closed this issue 2026-03-02 04:06:57 +03:00
Author
Owner

@OrhanYigitDurmaz commented on GitHub (May 14, 2025):

Merhaba , proje üzerinde emeği geçen herkese teşekkür ediyorum.

Projeyi test ortamında çalıştırıyorum ve herhangi bir hata almıyorum ancak gerçek ortamda çalıştırdığımda , $client->createDraftBasicInvoice(); adımında Bu mükellef (VKN/TCKN:xxxxxxxxxxx) e-Fatura kullanıcısı. Hatası alıyorum. hatanın oluştuğu fonksiyonunun detaylarını aşağıda paylaştım.

   public function createDraftBasicInvoice(Invoice $invoice = null)
    {
        if ($invoice != null) {
            $this->invoice = $invoice;
        }

        if ($this->invoice == null) {
            throw new NullDataException("Invoice variable not exist");
        }
        $parameters = [
            "cmd" => "EARSIV_PORTAL_FATURA_OLUSTUR",
            "callid" => Uuid::uuid1()->toString(),
            "pageName" => "RG_BASITFATURA",
            "token" => $this->token,
            "jp" => "" . json_encode($this->invoice->export()) . ""
        ];

        $body = $this->sendRequestAndGetBody(self::DISPATCH_PATH, $parameters);

        $this->checkError($body);


        if ($body["data"] != "Faturanız başarıyla oluşturulmuştur. Düzenlenen Belgeler menüsünden faturanıza ulaşabilirsiniz.") {

            $responseData = [
                'error' => $body['data'] 
            ];

            die(json_encode($responseData)); // hatanın geldiği yer burası
        }

        return $this;
    }

Yardımcı olabilirseniz çok sevinirim. Şimdiden teşekkürler.

cozdunuz sanıyorum ki siz bir e arsiv fatura mukellefi degilsiniz. direkt e fatura mukellefisiniz.

<!-- gh-comment-id:2881538558 --> @OrhanYigitDurmaz commented on GitHub (May 14, 2025): > Merhaba , proje üzerinde emeği geçen herkese teşekkür ediyorum. > > Projeyi test ortamında çalıştırıyorum ve herhangi bir hata almıyorum ancak gerçek ortamda çalıştırdığımda , $client->createDraftBasicInvoice(); adımında Bu mükellef (VKN/TCKN:xxxxxxxxxxx) e-Fatura kullanıcısı. Hatası alıyorum. hatanın oluştuğu fonksiyonunun detaylarını aşağıda paylaştım. > > ``` > public function createDraftBasicInvoice(Invoice $invoice = null) > { > if ($invoice != null) { > $this->invoice = $invoice; > } > > if ($this->invoice == null) { > throw new NullDataException("Invoice variable not exist"); > } > $parameters = [ > "cmd" => "EARSIV_PORTAL_FATURA_OLUSTUR", > "callid" => Uuid::uuid1()->toString(), > "pageName" => "RG_BASITFATURA", > "token" => $this->token, > "jp" => "" . json_encode($this->invoice->export()) . "" > ]; > > $body = $this->sendRequestAndGetBody(self::DISPATCH_PATH, $parameters); > > $this->checkError($body); > > > if ($body["data"] != "Faturanız başarıyla oluşturulmuştur. Düzenlenen Belgeler menüsünden faturanıza ulaşabilirsiniz.") { > > $responseData = [ > 'error' => $body['data'] > ]; > > die(json_encode($responseData)); // hatanın geldiği yer burası > } > > return $this; > } > ``` > > Yardımcı olabilirseniz çok sevinirim. Şimdiden teşekkürler. cozdunuz sanıyorum ki siz bir e arsiv fatura mukellefi degilsiniz. direkt e fatura mukellefisiniz.
Author
Owner

@kozmoCode commented on GitHub (May 15, 2025):

Merhaba , proje üzerinde emeği geçen herkese teşekkür ediyorum.
Projeyi test ortamında çalıştırıyorum ve herhangi bir hata almıyorum ancak gerçek ortamda çalıştırdığımda , $client->createDraftBasicInvoice(); adımında Bu mükellef (VKN/TCKN:xxxxxxxxxxx) e-Fatura kullanıcısı. Hatası alıyorum. hatanın oluştuğu fonksiyonunun detaylarını aşağıda paylaştım.

   public function createDraftBasicInvoice(Invoice $invoice = null)
    {
        if ($invoice != null) {
            $this->invoice = $invoice;
        }

        if ($this->invoice == null) {
            throw new NullDataException("Invoice variable not exist");
        }
        $parameters = [
            "cmd" => "EARSIV_PORTAL_FATURA_OLUSTUR",
            "callid" => Uuid::uuid1()->toString(),
            "pageName" => "RG_BASITFATURA",
            "token" => $this->token,
            "jp" => "" . json_encode($this->invoice->export()) . ""
        ];

        $body = $this->sendRequestAndGetBody(self::DISPATCH_PATH, $parameters);

        $this->checkError($body);


        if ($body["data"] != "Faturanız başarıyla oluşturulmuştur. Düzenlenen Belgeler menüsünden faturanıza ulaşabilirsiniz.") {

            $responseData = [
                'error' => $body['data'] 
            ];

            die(json_encode($responseData)); // hatanın geldiği yer burası
        }

        return $this;
    }

Yardımcı olabilirseniz çok sevinirim. Şimdiden teşekkürler.

cozdunuz sanıyorum ki siz bir e arsiv fatura mukellefi degilsiniz. direkt e fatura mukellefisiniz.

e arsiv fatura ve e fatura mükellefi birbirinden farklı mı? Detay hakkında bir bilgim yok ve maalesef sonrasında tekrar bakmadım ve doğal olarak henüz bir çözüm üretemedim.

<!-- gh-comment-id:2883298711 --> @kozmoCode commented on GitHub (May 15, 2025): > > Merhaba , proje üzerinde emeği geçen herkese teşekkür ediyorum. > > Projeyi test ortamında çalıştırıyorum ve herhangi bir hata almıyorum ancak gerçek ortamda çalıştırdığımda , $client->createDraftBasicInvoice(); adımında Bu mükellef (VKN/TCKN:xxxxxxxxxxx) e-Fatura kullanıcısı. Hatası alıyorum. hatanın oluştuğu fonksiyonunun detaylarını aşağıda paylaştım. > > ``` > > public function createDraftBasicInvoice(Invoice $invoice = null) > > { > > if ($invoice != null) { > > $this->invoice = $invoice; > > } > > > > if ($this->invoice == null) { > > throw new NullDataException("Invoice variable not exist"); > > } > > $parameters = [ > > "cmd" => "EARSIV_PORTAL_FATURA_OLUSTUR", > > "callid" => Uuid::uuid1()->toString(), > > "pageName" => "RG_BASITFATURA", > > "token" => $this->token, > > "jp" => "" . json_encode($this->invoice->export()) . "" > > ]; > > > > $body = $this->sendRequestAndGetBody(self::DISPATCH_PATH, $parameters); > > > > $this->checkError($body); > > > > > > if ($body["data"] != "Faturanız başarıyla oluşturulmuştur. Düzenlenen Belgeler menüsünden faturanıza ulaşabilirsiniz.") { > > > > $responseData = [ > > 'error' => $body['data'] > > ]; > > > > die(json_encode($responseData)); // hatanın geldiği yer burası > > } > > > > return $this; > > } > > ``` > > > > > > > > > > > > > > > > > > > > > > > > Yardımcı olabilirseniz çok sevinirim. Şimdiden teşekkürler. > > cozdunuz sanıyorum ki siz bir e arsiv fatura mukellefi degilsiniz. direkt e fatura mukellefisiniz. e arsiv fatura ve e fatura mükellefi birbirinden farklı mı? Detay hakkında bir bilgim yok ve maalesef sonrasında tekrar bakmadım ve doğal olarak henüz bir çözüm üretemedim.
Author
Owner

@OrhanYigitDurmaz commented on GitHub (May 15, 2025):

Merhaba , proje üzerinde emeği geçen herkese teşekkür ediyorum.
Projeyi test ortamında çalıştırıyorum ve herhangi bir hata almıyorum ancak gerçek ortamda çalıştırdığımda , $client->createDraftBasicInvoice(); adımında Bu mükellef (VKN/TCKN:xxxxxxxxxxx) e-Fatura kullanıcısı. Hatası alıyorum. hatanın oluştuğu fonksiyonunun detaylarını aşağıda paylaştım.

   public function createDraftBasicInvoice(Invoice $invoice = null)
    {
        if ($invoice != null) {
            $this->invoice = $invoice;
        }

        if ($this->invoice == null) {
            throw new NullDataException("Invoice variable not exist");
        }
        $parameters = [
            "cmd" => "EARSIV_PORTAL_FATURA_OLUSTUR",
            "callid" => Uuid::uuid1()->toString(),
            "pageName" => "RG_BASITFATURA",
            "token" => $this->token,
            "jp" => "" . json_encode($this->invoice->export()) . ""
        ];

        $body = $this->sendRequestAndGetBody(self::DISPATCH_PATH, $parameters);

        $this->checkError($body);


        if ($body["data"] != "Faturanız başarıyla oluşturulmuştur. Düzenlenen Belgeler menüsünden faturanıza ulaşabilirsiniz.") {

            $responseData = [
                'error' => $body['data'] 
            ];

            die(json_encode($responseData)); // hatanın geldiği yer burası
        }

        return $this;
    }

Yardımcı olabilirseniz çok sevinirim. Şimdiden teşekkürler.

cozdunuz sanıyorum ki siz bir e arsiv fatura mukellefi degilsiniz. direkt e fatura mukellefisiniz.

e arsiv fatura ve e fatura mükellefi birbirinden farklı mı? Detay hakkında bir bilgim yok ve maalesef sonrasında tekrar bakmadım ve doğal olarak henüz bir çözüm üretemedim.

Evet farklı, sana lazım olan yer burası: https://test.efatura.gov.tr/efatura/login.jsp

<!-- gh-comment-id:2883461599 --> @OrhanYigitDurmaz commented on GitHub (May 15, 2025): > > > Merhaba , proje üzerinde emeği geçen herkese teşekkür ediyorum. > > > Projeyi test ortamında çalıştırıyorum ve herhangi bir hata almıyorum ancak gerçek ortamda çalıştırdığımda , $client->createDraftBasicInvoice(); adımında Bu mükellef (VKN/TCKN:xxxxxxxxxxx) e-Fatura kullanıcısı. Hatası alıyorum. hatanın oluştuğu fonksiyonunun detaylarını aşağıda paylaştım. > > > ``` > > > public function createDraftBasicInvoice(Invoice $invoice = null) > > > { > > > if ($invoice != null) { > > > $this->invoice = $invoice; > > > } > > > > > > if ($this->invoice == null) { > > > throw new NullDataException("Invoice variable not exist"); > > > } > > > $parameters = [ > > > "cmd" => "EARSIV_PORTAL_FATURA_OLUSTUR", > > > "callid" => Uuid::uuid1()->toString(), > > > "pageName" => "RG_BASITFATURA", > > > "token" => $this->token, > > > "jp" => "" . json_encode($this->invoice->export()) . "" > > > ]; > > > > > > $body = $this->sendRequestAndGetBody(self::DISPATCH_PATH, $parameters); > > > > > > $this->checkError($body); > > > > > > > > > if ($body["data"] != "Faturanız başarıyla oluşturulmuştur. Düzenlenen Belgeler menüsünden faturanıza ulaşabilirsiniz.") { > > > > > > $responseData = [ > > > 'error' => $body['data'] > > > ]; > > > > > > die(json_encode($responseData)); // hatanın geldiği yer burası > > > } > > > > > > return $this; > > > } > > > ``` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Yardımcı olabilirseniz çok sevinirim. Şimdiden teşekkürler. > > > > cozdunuz sanıyorum ki siz bir e arsiv fatura mukellefi degilsiniz. direkt e fatura mukellefisiniz. > > e arsiv fatura ve e fatura mükellefi birbirinden farklı mı? Detay hakkında bir bilgim yok ve maalesef sonrasında tekrar bakmadım ve doğal olarak henüz bir çözüm üretemedim. > Evet farklı, sana lazım olan yer burası: https://test.efatura.gov.tr/efatura/login.jsp
Author
Owner

@OrhanYigitDurmaz commented on GitHub (May 15, 2025):

endpointler farklı olabilir nasıl çalıştığından emin değilim

<!-- gh-comment-id:2883480597 --> @OrhanYigitDurmaz commented on GitHub (May 15, 2025): endpointler farklı olabilir nasıl çalıştığından emin değilim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/efatura#115
No description provided.