Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatura nasıl imzalanır/ onaylanır? #63

Closed
etkidesign opened this issue Dec 25, 2021 · 2 comments
Closed

Fatura nasıl imzalanır/ onaylanır? #63

etkidesign opened this issue Dec 25, 2021 · 2 comments

Comments

@etkidesign
Copy link

Bu yazılım için çok teşekkürler. Fakat aşamadığım bir sıkıntı faturanın nasıl imzalanacağı?

Örnek bir kodla yardımcı olabilirseniz çok sevinirim.
toplu için denediğim :

    $client = new InvoiceManager();
    $client->setCredentials("xxx", "xxx");
    $client->getCredentials();
    $client->connect();
    $veri = $client->getInvoicesFromAPI("25/12/2021", "25/12/2021");
    echo $client->sendSMSVerification("xxx");

tekil için denediğim:

    $client = new InvoiceManager();
    $client->setCredentials("xxx", "xxxx");
    $client->getCredentials();
    $client->connect();

    $oldInvoice = new Invoice();
    $oldInvoice->setUuid($fatura_id);
    $client->setInvoice($oldInvoice)->getInvoiceFromAPI();
    echo $client->sendSMSVerification("xxx");

sms onaylamak için yaptığım:

    $sms = post("kod"); // sms kodu
    $opi = post("id"); // operasyon id

    $client = new InvoiceManager();
    $client->setCredentials("xxx", "xxx");
    $client->getCredentials();
    $client->connect();
    echo $client->verifySMSCode($sms, $opi);
@muratcesmecioglu
Copy link
Collaborator

Merhaba
Öncelikle SMS kodu almak için öncesinde faturayı set etmeye gerek yok. İlginç ancak portal bu şekilde yapılmış.

$client = new InvoiceManager();
$client->setCredentials("xxx", "xxx");
$client->connect();
$operasyon_id = $client->sendSMSVerification();

Bu şekilde telefona SMS onay kodu gönderip operasyon kodunu alabilirsiniz. Operasyon kodunu aldıktan sonra, faturaları getEttnInvoiceFromAPIArray fonksiyonunu ile çekerek imzaya göndermek gerekiyor. Bu fonksiyonun ilk iki parametresi tarih aralığı, üçüncü parametresi ise ettn numarasına göre filtreleyip dönmesini sağlıyor.

$ettn="423423-432423-4-234-2";
$client->getEttnInvoiceFromAPIArray(date("d\/m\/Y"), date("d\/m\/Y"),[$ettn]);
$cevap = $client->verifySMSCode("SMSKODU",$operasyon_id );

Bu şekilde onaylayabilirsiniz.


Adım adım tekil fatura onaylayabileceğiniz bir örneğin kodları şurada mevcut:
https://gist.github.com/muratcesmecioglu/a37c1b9ca843d0117f2b3bd3cb02cc14

@etkidesign
Copy link
Author

etkidesign commented Dec 29, 2021

Merhaba hocam. Çok teşekkür ederim. Elinize sağlık.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants