11
11
11

paygateway

C paygateway POST- http(s)- -

.

:

(. III.1) , -

:

. III.1.: 

            
opertype pay
amount, amountcurr, currency, number, description, trtype, recurringFrequency, recurringEndDate, account, paytoken, backURL ,  
transID *) 15431522
datetime / 2015-03-23 12:33:06.46976300
signature **)  

. III.1.:

            
opertype pay
PANmasked , 400000******0000
cardholder, amount, amountcurr, number, description, trtype, account, paytoken, backURL ,  
transID *) 15431522
datetime / 2015-03-23 12:33:06.46976300
signature
***)  


*) . (, - ) ( ), - **) : "" opertype, amount, amountcurr, currency, number, description, trtype, account, paytoken, backURL, transID, datetime, __1 ( ), __2 ( ). , paytoken, backURL , , . : 1) md5; 2) HMAC sha256 (, : __1, __2). *) .

(, - ) ( ), -


(. III.8)

  :

            
opertype unblock
account paygateway  
transID 15431522
datetime / 2015-03-23 12:33:06.46976300
signature *)  

(. III.9)

:
            
opertype terminate
amountterminate 50.52
account paygateway  
transID 15431522
datetime / 2015-03-23 12:33:06.46976300
signature **)  

(. III.10)

***) : ""

PANmasked, cardholder, opertype, amount, amountcurr, number, description, trtype, account, paytoken, backURL, transID, datetime, __1 ( ), __2 ( ). , paytoken, backURL , , . : 1) md5; 2) HMAC sha256 (, : __1, __2).  

*) : "" opertype, account, transID, datetime, __1 ( ), __2 ( ). : 1) md5; 2) HMAC sha256 (, : __1, __2).  

**) : "" opertype, amountterminate, account, transID, datetime, __1 ( ), __2 ( ). : 1) md5; 2) HMAC sha256 (, : __1, __2).


:

            
opertype reversal
amountreversal 50.52
account paygateway  
transID 15431522
datetime / 2015-03-23 12:33:06.46976300
signature *)  

! , - transID. , paygateway .

  (. III.11)

  :
           
opertype recurrring
amountrecurring 50.52
account paygateway  
transIDparent , 15431522
recurringID 11311211312
numberrecurring ( ) 54321
descriptionrecurring , URL- encoded ( ) %37%31+%56%77
transIDrecurring 15431525
datetime / 2015-03-23 12:33:06.46976300
signature *)  


*) : "" opertype, amountreversal, account, transID, datetime, __1 ( ), __2 ( ). : 1) md5; 2) HMAC sha256 (, : __1, __2).


! , - transIDrecurring. , paygateway .

. - (opertype=pay).
PHP

					 <?
$opertype = $_POST["opertype"];

switch($opertype)
{
case "pay":
$amount = $_POST["amount"]; $amountcurr = $_POST["amountcurr"]; $currency = $_POST["currency"]; $number = $_POST["number"]; $description = $_POST["description"]; $account = $_POST["account"]; $transID = $_POST["transID"]; $signature = $_POST["signature"];

//	     
//	  
$testsig = "$opertype:$amount:$amountcurr:"; $testsig .= "$currency:$number:$description:"; $testsig .= "$account:$transID:";
$testsig .= "__1:__2"; $testsig = strtoupper(md5($testsig));

if ($signature==$testsig)
{
if (  )
{
print $transID; exit(-1);
}
}
print "No, thanks"; //     //     //  
break;
case "terminate":
...
case "reversal":
...
}