Notifications

Notifications are the basic web services for the Payguru API integration. They are used to transmit the information to the merchant for all the "accepted payments" from the Payguru Platform. The merchant receives all the information about payments done by their customers through those notifications.

>URL
 http://yoursite.com/PhsNotifyService
>HTTP Method
GET yada POST/JSON

If request true then only give response "OK".

Notify Key: md5( Service code + Merchant ID + Transaction ID + Transaction Code + Order RefNo + Amount + Merchant Private Key + Service Private Key)

>Parameters
FieldTypeDescription
txidInteger - RequiredTransaction ID
codeString - RequiredPayguru Order
orderString - RequiredMerchant Order
statusInteger - RequiredTransaction Status #See Transaction Status
amountFloat - RequiredTransaction Amount
transaction_dateDate - RequiredTransaction Time
bankString - RequiredBank Code
keyString - RequiredNotify Key #See Notify Key

GET

>Sample Codes
<?
$data = $_GET;
//$data["txid"] = Transaction ID
//$data["code"] = Transaction Code
//$data["order"] = Order Refno
//$data["status"] = Transaction Status
//$data["amount"] = Transaction amount
//$data["transaction_date"] = Transaction Date
//$data["bank"] = Bank Code
//$data["key"] = Notify Key
$localKey = md5("Service Code"."Merchant ID".$data["txid"].$data["code"].$data["order"].$data["amount"]."Merchant Private Key"."Service Private Key");
if($localKey = $data["key"]){
     echo "OK";//If you accept this request, you must response with "OK"
//find transaction with order
}else{
    echo "Wrong Data";
}

POST/JSON

>Örnek Kodlar
<?
$data = json_decode(file_get_contents("php://input"),true);
//$data["txid"] = Transaction ID
//$data["code"] = Transaction Code
//$data["order"] = Order Refno
//$data["status"] = Transaction Status
//$data["amount"] = Transaction amount
//$data["transaction_date"] = Transaction Date
//$data["bank"] = Bank Code
//$data["key"] = Notify Key
$localKey = md5("XXX".123.$data["txid"].$data["code"].$data["order"].$data["amount"]."Merchant Key + Service Key");
if($localKey = $data["key"]){
     echo "OK";//If you accept this request, you must response with "OK"
//find transaction with order
}else{
echo "Wrong Data";
}

Test Transaction

You can try this method for testing a transaction. You receives a notification. It only works on sandbox mod.

>URL
 https://sandbox.payguru.com/phs/transaction/test
>HTTP Method
GET or POST
>Headers
FieldTypeDescription
merchantInteger - RequiredMerchant ID
tokenString - RequiredToken
>Parameters
FieldTypeDescription
codeString - RequiredService Code
refString - RequiredPayguru Reference Code(You can get orderLookup/Check)
amountAmount - RequiredAmount of Transaction
nameString - OptionalUser name
descriptionString - OptionalDescription of Transaction
ibanString - OptionalIBAN
tcknoNumeric - OptionalT.C No

>Success

Gives Your Response