Non-Automatic Order Matching Services

Payguru Platformlarında eşleşmeyen İşlem Koduna sahip ödemeler için, Payguru'nun üye iş yerine açmış olduğu "manuel ödeme bildirimi" süreçlerinin metodlarıdır. Üye iş yeri kendi sitesinde açmış olduğu arayüz aracılığı ile müşteriden ödeme bilgisini toplar ve aşağıdaki bilgilendirmeler aracılığı ile Payguru Platformunu sorgular ve ödeme bilgisini iletir.

Get

Üye iş yeri tarafından müşterinin verdiği bilgiler aracılığı ile oluşuturulmuş olan bildirime ait bir bildirim kodu ile üye iş yeri'nin Payguru platformunu sorgulamasını sağlayan servistir.

>URL
 https://api.payguru.com/phs/paymentNotification/get
>HTTP Method
GET yada POST
>Headers
FieldTypeDescription
merchantInteger - RequiredMerchant ID
tokenString - RequiredToken
>Parameters
FieldTypeDescription
idInteger - RequiredPayment Notification ID

>Success
FieldTypeDescription
statusStringStatus Code: 000
messageStringMessage
paymentNotificationArray[]PaymentNotification Detail
-idStringID
-codeStringCode
-bank_idStringBank ID
-bank_codeStringBank Code
-bank_nameStringBank Name
-merchantStringMerchant ID
-merchant_nameStringMerchant Name
-service_idStringService ID
-service_codeStringService Code
-service_nameStringService Name
-transaction_idStringTransaction ID
-order_refnoStringOrder RefNo
-tc_noStringTCNO
-nameStringName
-emailStringEmail
-phoneStringPhone
-amountStringAmount
-descriptionStringDescription
-user_ipStringUser IP
-create_timeStringCreate Time Format:YYYY-MM-DD HH:II:SS
-apply_timeStringApply Time Format:YYYY-MM-DD HH:II:SS
-statusStringPayment Notification Status #See

>Error
FieldTypeDescription
statusStringStatus Code: #See
messageStringMessage

>Örnek Cevaplar
{
    "status": "000",
    "message": "Success",
    "paymentNotification": {
        "id": 15,
        "code": "12345678",
        "bank_id": 3,
        "bank_code": "yapikredibank",
        "merchant": 123,
        "merchant_name": "XXXX",
        "service_id": 1,
        "service_name": "XXXXX", 
        "service_code": "xxxxx", 
        "transaction_id": 12345, 
        "order_refno": "123456789", 
        "tc_no": "12345678911", 
        "name": "Hello", 
        "email": "test@payguru.com", 
        "phone": "5123456789", 
        "amount": "2.00",
        "user_ip": "000.000.000.000",
        "create_time": "2017-03-06 17:47:54",
        "apply_time": "2017-02-20 13:41:42",
        "description": "test 123456",
        "status": 10
    }
}
{
    "status": "ERR_005",
    "message": "Invalid Service"
}

>Örnek Kodlar
curl -X GET -H "token: {3E53E639-5173-D1B6-9368-68FCBCF72342}" -H "merchant: 123" --globoff "https://api.payguru.com/phs/paymentNotification/get/12345678"
<?php
$curl = curl_init();
$url = "https://api.payguru.com/phs/paymentNotification/get";
$data = [
    "id"=>"123456789",
];
$headers = [
    "token: {3E53E639-5173-D1B6-9368-68FCBCF72342}",
    "merchant: 123"
];
curl_setopt_array($curl, array(
  CURLOPT_URL => $url."?".http_build_query($data),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => $headers,
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
var client = new RestClient("https://api.payguru.com/phs/paymentNotification/get?id=12345678");
var request = new RestRequest(Method.GET);
request.AddHeader("merchant", "123");
request.AddHeader("token", "{3E53E639-5173-D1B6-9368-68FCBCF72342}");
IRestResponse response = client.Execute(request);
var o = JObject.Parse(response);
if (o["status"] == "000") {
    MessageBox.Show((string)o["paymentNotification"]["id"]);
} else {
    MessageBox.Show((string)o["message"]);
}
import requests,json
url = "https://api.payguru.com/phs/paymentNotification/create"
querystring = {"id":"12345678"}
headers = {
    "token": "{3E53E639-5173-D1B6-9368-68FCBCF72342}",
    "merchant": "123"
}
response = requests.request("GET", url, headers=headers, params=querystring)
if response.status_code == 200:
    o = json.loads(response.text)
    if o["status"] == "000":
        print o["paymentNotification"]["code"]
    else:
        print o["message"]
else:
    print "Request Error"

Create

Üye iş yeri tarafından müşterinin verdiği bilgiler aracılığı ile manuel ödeme bildiriminin başlatıldığı servistir.

>URL
 https://api.payguru.com/phs/paymentNotification/create
>HTTP Method
GET yada POST
>Headers
FieldTypeDescription
merchantInteger - RequiredMerchant ID
tokenString - RequiredToken
>Parameters
FieldTypeDescription
codeString - RequiredService Code
amountString - RequiredAmount
bankString - RequiredBank Code
orderString - RequiredMerchant Order
PaymentNotificationArray[]PaymentNotification Fields
-tc_noStringTCKN
-nameStringName
-emailStringEmail
-phoneStringMobile Phone
-user_ipStringUser IP
-apply_timeDateApply Time Format:YYYY-MM-DD HH:II:SS
-descriptionStringDescription

>Success
FieldTypeDescription
statusStringStatus Code: 000
messageStringMessage
codeStringPaymentNotification Code

Please forward to "https://cp.payguru.com/phs/yonlendir/{CODE}?redirect=SUCCESS_URL&backUrl=BACK_URL" with the code in response.
Redirect parameters are optional


>Error
FieldTypeDescription
statusStringStatus Code: #See
messageStringMessage

>Örnek Cevaplar
{
    "status": "000",
    "message": "Success",
    "code": "1234567890"
}
{
    "status": "ERR_005",
    "message": "Invalid Service"
}

>Örnek Kodlar
curl -X GET -H "token: {3E53E639-5173-D1B6-9368-68FCBCF72342}" -H "merchant: 123" --globoff "https://api.payguru.com/phs/paymentNotification/create?amount=123.12&bank=000&order=XXXXXXX&code=XXX&PaymentNotification[name]=Hello&PaymentNotification[tc]=123456789"
<?php
$curl = curl_init();
$url = "https://api.payguru.com/phs/paymentNotification/create";
$id = "72824979";
$data = [
    "amount" => "123.12",
    "bank" => "000",
    "order" => "XXXXXXX",
    "code" => "XXX",
    "PaymentNotification" => [
        "name" => "Hello",
        "tc" => 123456789,
    ]
];
$headers = [
    "token: {3E53E639-5173-D1B6-9368-68FCBCF72342}",
    "merchant: 123"
];
curl_setopt_array($curl, array(
  CURLOPT_URL => $url."?".http_build_query($data),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => $headers,
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo $o["code"];
  }else{
      echo $o["message"];
  }
}
var client = new RestClient("https://api.payguru.com/phs/paymentNotification/create
                    ?amount=123.12&bank=000&order=XXXXXXX&code=XXX&PaymentNotification%5Bname%5D=Hello&PaymentNotification%5Btc%5D=123456789");
var request = new RestRequest(Method.GET);
request.AddHeader("merchant", "123");
request.AddHeader("token", "{3E53E639-5173-D1B6-9368-68FCBCF72342}");
IRestResponse response = client.Execute(request);
var o = JObject.Parse(response);
if (o["status"] == "000") {
    MessageBox.Show((string)o["code"]);
} else {
    MessageBox.Show((string)o["message"]);
}
import requests,json
url = "https://api.payguru.com/phs/paymentNotification/create"
querystring = {"amount":"123.12","bank":"000","order":"XXXXXXX","code":"XXX","PaymentNotification[name]":"Hello","PaymentNotification[tc]":"123456789"}
headers = {
    "token": "{3E53E639-5173-D1B6-9368-68FCBCF72342}",
    "merchant": "123"
}
response = requests.request("GET", url, headers=headers, params=querystring)
if response.status_code == 200:
    o = json.loads(response.text)
    if o["status"] == "000":
        print o["code"]
    else:
        print o["message"]
else:
    print "Request Error"