[GH-ISSUE #91] tekrarlanan odeme durum sorgulama #43

Closed
opened 2026-03-03 15:42:25 +03:00 by kerem · 6 comments
Owner

Originally created by @lansas on GitHub (Sep 19, 2022).
Original GitHub issue: https://github.com/mewebstudio/pos/issues/91

$account = AccountFactory::createEstPosAccount('teb', '1111111', 'apiuser', 'apipass',  AbstractGateway::TX_STATUS, 'storekey123456', AbstractGateway::LANG_TR);
$order = ['id' => {order_id}, 'RECURRINGID' => {recurring_id}];

   $pos = \Mews\Pos\Factory\PosFactory::createPosGateway($account);
                    $pos->prepare($order, \Mews\Pos\Gateways\AbstractGateway::TX_STATUS);
                    $pos->status();
                    $pos = $pos->getResponse();
<Extra>
<ORDERSTATUS>QUERY</ORDERSTATUS>
<RECURRINGID>15210MWwD180004</RECURRINGID>
</Extra>

Yukarıdaki gibi extra bilgiye RECURRINGID yi sorgulama biçimi nasıl? Kodlara baktığımda extra nın içinde sadece ORDERSTATUS mevcut. Ekli mi değil yoksa yanlış yere mi bakıyorum?
recurring_id

Originally created by @lansas on GitHub (Sep 19, 2022). Original GitHub issue: https://github.com/mewebstudio/pos/issues/91 ``` $account = AccountFactory::createEstPosAccount('teb', '1111111', 'apiuser', 'apipass', AbstractGateway::TX_STATUS, 'storekey123456', AbstractGateway::LANG_TR); $order = ['id' => {order_id}, 'RECURRINGID' => {recurring_id}]; $pos = \Mews\Pos\Factory\PosFactory::createPosGateway($account); $pos->prepare($order, \Mews\Pos\Gateways\AbstractGateway::TX_STATUS); $pos->status(); $pos = $pos->getResponse(); ``` ``` <Extra> <ORDERSTATUS>QUERY</ORDERSTATUS> <RECURRINGID>15210MWwD180004</RECURRINGID> </Extra> ``` Yukarıdaki gibi extra bilgiye RECURRINGID yi sorgulama biçimi nasıl? Kodlara baktığımda extra nın içinde sadece ORDERSTATUS mevcut. Ekli mi değil yoksa yanlış yere mi bakıyorum? <img width="929" alt="recurring_id" src="https://user-images.githubusercontent.com/1222507/191005427-2414808f-5d01-46fe-afe5-1bc45162424d.PNG">
kerem 2026-03-03 15:42:25 +03:00
Author
Owner

@lansas commented on GitHub (Sep 20, 2022):

3 class da değişiklik lazım.
Bunlardan bir tanesi

public function createStatusRequestData(AbstractPosAccount $account, $order): array
    {
       
        return isset($order->RECURRINGID) ?
            $this->getRequestAccountData($account) +

            [

                'Extra' => [
                    $this->mapTxType(AbstractGateway::TX_STATUS) => 'QUERY',
                    'RECURRINGID' => $order->RECURRINGID
                ],
            ]
            :
            $this->getRequestAccountData($account) +  [
                'OrderId'  => $order->id,
                'Extra' => [
                    $this->mapTxType(AbstractGateway::TX_STATUS) => 'QUERY',
                ],
            ]
        ;
    }
<!-- gh-comment-id:1252277040 --> @lansas commented on GitHub (Sep 20, 2022): 3 class da değişiklik lazım. Bunlardan bir tanesi ``` public function createStatusRequestData(AbstractPosAccount $account, $order): array { return isset($order->RECURRINGID) ? $this->getRequestAccountData($account) + [ 'Extra' => [ $this->mapTxType(AbstractGateway::TX_STATUS) => 'QUERY', 'RECURRINGID' => $order->RECURRINGID ], ] : $this->getRequestAccountData($account) + [ 'OrderId' => $order->id, 'Extra' => [ $this->mapTxType(AbstractGateway::TX_STATUS) => 'QUERY', ], ] ; } ```
Author
Owner

@nuryagdym commented on GitHub (Sep 29, 2022):

Merhabalar, 2 hafta sonra soruna bakabilirim

<!-- gh-comment-id:1262269339 --> @nuryagdym commented on GitHub (Sep 29, 2022): Merhabalar, 2 hafta sonra soruna bakabilirim
Author
Owner

@lansas commented on GitHub (Sep 30, 2022):

Statüs için classlarınızda düzenleme yaptım. Çözdüm. İptal recurring i de curl ile xml yaptım class ınızı kullanmadım. Yalnız QNB stabil çalışmıyor banka ile sorunu inceliyoruz.

Windows için Postahttps://go.microsoft.com/fwlink/?LinkId=550986 ile gönderildi

Kimden: @.>
Gönderilme: Thursday, 29 September 2022 4:18 PM
Kime: @.
>
Bilgi: gunes @.>; @.>
Konu: Re: [mewebstudio/pos] status RECURRINGID (Issue #91)

Merhabalar, 2 hafta sonra soruna bakabilirim


Reply to this email directly, view it on GitHubhttps://github.com/mewebstudio/pos/issues/91#issuecomment-1262269339, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJKO2YCL4C6A6NBTHBF74TWAWJLVANCNFSM6AAAAAAQQABYSU.
You are receiving this because you authored the thread.Message ID: @.***>

<!-- gh-comment-id:1263200092 --> @lansas commented on GitHub (Sep 30, 2022): Statüs için classlarınızda düzenleme yaptım. Çözdüm. İptal recurring i de curl ile xml yaptım class ınızı kullanmadım. Yalnız QNB stabil çalışmıyor banka ile sorunu inceliyoruz. Windows için Posta<https://go.microsoft.com/fwlink/?LinkId=550986> ile gönderildi Kimden: ***@***.***> Gönderilme: Thursday, 29 September 2022 4:18 PM Kime: ***@***.***> Bilgi: gunes ***@***.***>; ***@***.***> Konu: Re: [mewebstudio/pos] status RECURRINGID (Issue #91) Merhabalar, 2 hafta sonra soruna bakabilirim — Reply to this email directly, view it on GitHub<https://github.com/mewebstudio/pos/issues/91#issuecomment-1262269339>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAJKO2YCL4C6A6NBTHBF74TWAWJLVANCNFSM6AAAAAAQQABYSU>. You are receiving this because you authored the thread.Message ID: ***@***.***>
Author
Owner

@nuryagdym commented on GitHub (Oct 9, 2022):

Merhabalar, hangi guncellemeri yaptiginizi paylasir misiniz. Ben paylastiginiz koda gore guncellemeyi yaptim, baska nerelerde yapilmasi gerektigini de paylasir misiniz

<!-- gh-comment-id:1272536560 --> @nuryagdym commented on GitHub (Oct 9, 2022): Merhabalar, hangi guncellemeri yaptiginizi paylasir misiniz. Ben paylastiginiz koda gore guncellemeyi yaptim, baska nerelerde yapilmasi gerektigini de paylasir misiniz
Author
Owner

@lansas commented on GitHub (Oct 10, 2022):

[cid:a1eafc80-c7b9-430f-aaf4-57a4f1850538]

[cid:9aa147a0-36e0-409b-bdf0-9998a377f441]

[cid:c3a4eff5-f96a-4023-9b27-a24712293dcd]

Değikilikler bu şekilde. orderid ile query yaptırmıyor payten. İlla RECURRINGID istiyor. Bir de ben Payten'e recurring i API ile iptalini eklemesini istemiştim onu da düz CURL ile geçtim. Kodu da şu şekil.

   $meta['Extra']['RECORDTYPE'] = "Order";
if ($s_cancel_type === null) {
$meta['Extra']['RECORDID'] = $s_order_id;
} else if ($s_cancel_type == "recurring_taksit") {
$meta['Extra']['RECURRINGOPERATION'] = "Cancel";
$meta['Extra']['RECORDID'] = $s_order_id . "-" . $i_vade_taksit;
}

            $xml_extra_creator = "<Extra>";
            foreach ($meta['Extra'] as $key_meta => $value) {
                $xml_extra_creator .= "<" . $key_meta . ">" . $value;
                $xml_extra_creator .= "</" . $key_meta . ">";
            }
            $xml_extra_creator .= "</Extra>";
            $xml_data = "<?xml version='1.0' encoding='UTF-8'?><CC5Request><Name>" . st_pos_users::$TEB["kullaniciAdi"] . "</Name><Password>" . st_pos_users::$TEB["password"] . "</Password><ClientId>" . st_pos_users::$TEB["clientId"] . "</ClientId>" . $xml_extra_creator . "</CC5Request>";

            $URL = "https://sanalpos.teb.com.tr/fim/api";
            $ch = curl_init($URL);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
            curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);
            curl_setopt($ch, CURLOPT_TIMEOUT, 4);
            $output = curl_exec($ch);
            curl_close($ch);

Gunes Erdemi

Senior Software Developer

Resge.com

GSM: 00 90 536 436 89 53 (Turkey)

GSM: 00 90 542 875 40 64 (North Cyprus)


Gönderen: nuryagdym @.>
Gönderildi: 9 Ekim 2022 Pazar 15:54
Kime: mewebstudio/pos @.
>
Bilgi: gunes erdemi @.>; Author @.>
Konu: Re: [mewebstudio/pos] tekrarlanan odeme durum sorgulama (Issue #91)

Merhabalar, hangi guncellemeri yaptiginizi paylasir misiniz. Ben paylastiginiz koda gore guncellemeyi yaptim, baska nerelerde yapilmasi gerektigini de paylasir misiniz


Reply to this email directly, view it on GitHubhttps://github.com/mewebstudio/pos/issues/91#issuecomment-1272536560, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJKO2565OMGTXFNQ4DMX3DWCK6ADANCNFSM6AAAAAAQQABYSU.
You are receiving this because you authored the thread.Message ID: @.***>

<!-- gh-comment-id:1272888009 --> @lansas commented on GitHub (Oct 10, 2022): [cid:a1eafc80-c7b9-430f-aaf4-57a4f1850538] [cid:9aa147a0-36e0-409b-bdf0-9998a377f441] [cid:c3a4eff5-f96a-4023-9b27-a24712293dcd] Değikilikler bu şekilde. orderid ile query yaptırmıyor payten. İlla RECURRINGID istiyor. Bir de ben Payten'e recurring i API ile iptalini eklemesini istemiştim onu da düz CURL ile geçtim. Kodu da şu şekil.    $meta['Extra']['RECORDTYPE'] = "Order"; if ($s_cancel_type === null) { $meta['Extra']['RECORDID'] = $s_order_id; } else if ($s_cancel_type == "recurring_taksit") { $meta['Extra']['RECURRINGOPERATION'] = "Cancel"; $meta['Extra']['RECORDID'] = $s_order_id . "-" . $i_vade_taksit; } $xml_extra_creator = "<Extra>"; foreach ($meta['Extra'] as $key_meta => $value) { $xml_extra_creator .= "<" . $key_meta . ">" . $value; $xml_extra_creator .= "</" . $key_meta . ">"; } $xml_extra_creator .= "</Extra>"; $xml_data = "<?xml version='1.0' encoding='UTF-8'?><CC5Request><Name>" . st_pos_users::$TEB["kullaniciAdi"] . "</Name><Password>" . st_pos_users::$TEB["password"] . "</Password><ClientId>" . st_pos_users::$TEB["clientId"] . "</ClientId>" . $xml_extra_creator . "</CC5Request>"; $URL = "https://sanalpos.teb.com.tr/fim/api"; $ch = curl_init($URL); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4); curl_setopt($ch, CURLOPT_TIMEOUT, 4); $output = curl_exec($ch); curl_close($ch); ------------------- Gunes Erdemi Senior Software Developer Resge.com GSM: 00 90 536 436 89 53 (Turkey) GSM: 00 90 542 875 40 64 (North Cyprus) ________________________________ Gönderen: nuryagdym ***@***.***> Gönderildi: 9 Ekim 2022 Pazar 15:54 Kime: mewebstudio/pos ***@***.***> Bilgi: gunes erdemi ***@***.***>; Author ***@***.***> Konu: Re: [mewebstudio/pos] tekrarlanan odeme durum sorgulama (Issue #91) Merhabalar, hangi guncellemeri yaptiginizi paylasir misiniz. Ben paylastiginiz koda gore guncellemeyi yaptim, baska nerelerde yapilmasi gerektigini de paylasir misiniz — Reply to this email directly, view it on GitHub<https://github.com/mewebstudio/pos/issues/91#issuecomment-1272536560>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAJKO2565OMGTXFNQ4DMX3DWCK6ADANCNFSM6AAAAAAQQABYSU>. You are receiving this because you authored the thread.Message ID: ***@***.***>
Author
Owner

@nuryagdym commented on GitHub (Oct 15, 2022):

Merhaba @lansas,
Islem iptali kisminda sorun yasiyorum.

$meta['Extra']['RECORDTYPE'] = "Order";
if ($s_cancel_type === null) {
    $meta['Extra']['RECORDID'] = $s_order_id;
} else if ($s_cancel_type == "recurring_taksit") {
    $meta['Extra']['RECURRINGOPERATION'] = "Cancel";
    $meta['Extra']['RECORDID'] = $s_order_id . "-" . $i_vade_taksit;
}

burda ilk if block'ta gibi veri gonderdigimde hata veriyor. ornegin su sekilde veri gonderiyorum:

[
  "Name" => "ISBANKAPI",
  "Password" => "ISBANK07",
  "ClientId" => "123456789494",
  "Extra" => [
    "RECORDTYPE" => "Order",
    "RECORDID" => "202210152B59", //siparis id
    "RECURRINGOPERATION" => "Cancel", // bu senin sagladigin kodda yok, ama saglamayinca _islem tipi yok_ diye hata veriyor.
  ]
];

else if block calisiyor, burda anladigim kadariyla tekrarlanan odemenin taksidini iptal ediyoruz:

[
  "Name" => "ISBANKAPI",
  "Password" => "ISBANK07",
  "ClientId" => "123456789494",
  "Extra" => [
    "RECORDTYPE" => "Order",
    "RECORDID" => "202210152B59-3", // <siparis-id>-<taksit-no>
    "RECURRINGOPERATION" => "Cancel",
  ]
];

Bu Recurring islemler icin dokumantasyon veya ornek kodlar var midir elinde, varsa paylasir misin.
Birinci if block calismadigi icin neyi iptal etmeye calisiyoruz onu da anlamadim.
RECORDTYPE hep ORDER mi olacak?

<!-- gh-comment-id:1279724962 --> @nuryagdym commented on GitHub (Oct 15, 2022): Merhaba @lansas, Islem iptali kisminda sorun yasiyorum. ``` $meta['Extra']['RECORDTYPE'] = "Order"; if ($s_cancel_type === null) { $meta['Extra']['RECORDID'] = $s_order_id; } else if ($s_cancel_type == "recurring_taksit") { $meta['Extra']['RECURRINGOPERATION'] = "Cancel"; $meta['Extra']['RECORDID'] = $s_order_id . "-" . $i_vade_taksit; } ``` burda **ilk if block'ta** gibi veri gonderdigimde hata veriyor. ornegin su sekilde veri gonderiyorum: ``` [ "Name" => "ISBANKAPI", "Password" => "ISBANK07", "ClientId" => "123456789494", "Extra" => [ "RECORDTYPE" => "Order", "RECORDID" => "202210152B59", //siparis id "RECURRINGOPERATION" => "Cancel", // bu senin sagladigin kodda yok, ama saglamayinca _islem tipi yok_ diye hata veriyor. ] ]; ``` **else if block** calisiyor, burda anladigim kadariyla tekrarlanan odemenin taksidini iptal ediyoruz: ``` [ "Name" => "ISBANKAPI", "Password" => "ISBANK07", "ClientId" => "123456789494", "Extra" => [ "RECORDTYPE" => "Order", "RECORDID" => "202210152B59-3", // <siparis-id>-<taksit-no> "RECURRINGOPERATION" => "Cancel", ] ]; ``` Bu Recurring islemler icin dokumantasyon veya ornek kodlar var midir elinde, varsa paylasir misin. Birinci if block calismadigi icin neyi iptal etmeye calisiyoruz onu da anlamadim. RECORDTYPE hep ORDER mi olacak?
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/pos#43
No description provided.