<?php


$a_chid = $_GET["chid"];


$MerchantID = 'e4e0fbec-9b29-4cda-871b-4f3db888fe76'; //Required

$Amount = 100000;


$Description = 'ارتقای ربات'; // Required
$Email = ''; // Optional
$Mobile = ''; // Optional

$CallbackURL = "https://azimibrothers.ir/dynamic_content/finishpaying.php?chid=$a_chid"; // Required

$zara["encoding"] = "UTF-8";


$client = new SoapClient('https://www.zarinpal.com/pg/services/WebGate/wsdl', $zara);



$zara2["MerchantID"] = "$MerchantID";
$zara2["Amount"] = "$Amount";
$zara2["Description"] = "$Description";
$zara2["Email"] = "$Email";
$zara2["Mobile"] = "$Mobile";
$zara2["CallbackURL"] = "$CallbackURL";



$result = $client->PaymentRequest($zara2);

//Redirect to URL You can do it also by creating a form
if ($result->Status == 100) {
    Header('Location: https://www.zarinpal.com/pg/StartPay/' . $result->Authority);
} else {
    echo 'ERR: ' . $result->Status;
}
