namespace integration;
class Kaspi {
var $currency = 398;// Тенге
var $login = '';
public function __construct($login) {
$this->login = $login;
}
public function getPaymentLink($order_id,$amount,$approve_url,$cancel_url,$decline_url){
$soapUrl = "https://epay.fortebank.com/Exec";
$amount *= 100;
// GULMARKET02007489
$xml_post_string = ( "
CreateOrder
RU
Purchase
".$this->login."
$amount
398
Оплата заказа №".$order_id."
$approve_url
$cancel_url
$decline_url
");
/**/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $soapUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
$response1 = str_replace("","",$response);
$response2 = str_replace("","",$response1);
$data = simplexml_load_string($response2);
$res = $data->Response->Order->URL."?OrderID=".$data->Response->Order->OrderID."&SessionID=". $data->Response->Order->SessionID;
return $res;
/**/
}
}