Skip to content

Instantly share code, notes, and snippets.

@ahmeti
Last active December 18, 2018 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmeti/b23ee60e7a9b35a77559f80087135e11 to your computer and use it in GitHub Desktop.
Save ahmeti/b23ee60e7a9b35a77559f80087135e11 to your computer and use it in GitHub Desktop.
composer require "ahmeti/ptt-kargo-api:@dev"
PTT_ACT_ID=
PTT_ACT_PASS=
<?php
# pttApi nesnemizi .env değişkenleri ile oluşturuyoruz.
$pttApi = new \Ahmeti\PttKargoApi\PttKargoApi();
<?php
# pttApi nesnemizi parametre ile oluşturuyoruz.
$pttApi = new \Ahmeti\PttKargoApi\PttKargoApi($pttMusteriId, $pttMusteriSifre);
<?php
$result = $pttApi->barkodSorgu('KP02168XXXXXX');
if( is_array($result) ){
// Başarılı
var_dump($result);
}else{
// Hata (SoapFault)
var_dump($result);
}
<?php
$result = $pttApi->gonderiHareketIslemTarihiSorgu('2018-03-01');
if( is_array($result) ){
foreach( $result['dongu'] as $item ){
// Başarılı
var_dump($item);
}
}else{
// Hata (SoapFault)
var_dump($result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment