Exemplo n.º 1
0
 public function preparePayment()
 {
     $obj_prepareResult = new \PHPpayments\Common\PrepareResult();
     $sisow = new Sisow($this->arr_settings['account'], $this->arr_settings['secret']);
     $sisow->purchaseId = $this->arr_order['id'];
     $sisow->description = "order: " . $this->arr_order['id'];
     $sisow->amount = $this->arr_order['total'];
     //$sisow->payment = "mistercash";
     $bank = $this->paymentoption;
     if ($bank == "mc") {
         $sisow->payment = "mistercash";
     } else {
         $sisow->payment = "";
         $sisow->issuerId = $bank;
     }
     $sisow->returnUrl = $this->url_return_success;
     $sisow->cancelUrl = $this->url_return_cancel;
     $sisow->notifyUrl = $this->url_callback;
     $sisow->callbackUrl = $this->url_callback;
     if (($ex = $sisow->TransactionRequest()) < 0) {
         $obj_prepareResult->success = false;
         $obj_prepareResult->text = $ex;
     } else {
         $obj_prepareResult->success = true;
         $obj_prepareResult->text = $sisow->issuerUrl;
         $this->url_integration = $sisow->issuerUrl;
     }
     return $obj_prepareResult;
 }
Exemplo n.º 2
0
 private function getDirectory()
 {
     $diff = 24 * 60 * 60;
     if (self::$lastcheck) {
         $diff = time() - self::$lastcheck;
     }
     if ($diff < 24 * 60 * 60) {
         return 0;
     }
     if (!$this->send("DirectoryRequest")) {
         return -1;
     }
     $search = $this->parse("directory");
     if (!$search) {
         $this->error();
         return -2;
     }
     self::$issuers = array();
     $iss = explode("<issuer>", str_replace("</issuer>", "", $search));
     foreach ($iss as $k => $v) {
         $issuerid = $this->parse("issuerid", $v);
         $issuername = $this->parse("issuername", $v);
         if ($issuerid && $issuername) {
             self::$issuers[$issuerid] = $issuername;
         }
     }
     self::$lastcheck = time();
     return 0;
 }
Exemplo n.º 3
0
 $mtkey = Yii::app()->functions->getOption('merchant_sandbox_sisow_pub_key', $merchant_id);
 $mtshopid = Yii::app()->functions->getOption('merchant_sandbox_sisow_shopid', $merchant_id);
 $mode = Yii::app()->functions->getOption('merchant_sisow_mode', $merchant_id);
 /*COMMISSION*/
 if (Yii::app()->functions->isMerchantCommission($merchant_id)) {
     $mtid = Yii::app()->functions->getOptionAdmin('admin_sanbox_sisow_secret_key');
     $mtkey = Yii::app()->functions->getOptionAdmin('admin_sandbox_sisow_pub_key');
     $mtshopid = Yii::app()->functions->getOptionAdmin('admin_sandbox_sisow_shopid');
     $mode = Yii::app()->functions->getOptionAdmin('admin_sisow_mode');
 }
 $amount_to_pay = isset($data['total_w_tax']) ? Yii::app()->functions->standardPrettyFormat($data['total_w_tax']) : '';
 $amount_to_pay = is_numeric($amount_to_pay) ? unPrettyPrice($amount_to_pay) : '';
 if (empty($mtid) || empty($mtkey)) {
     $error = Yii::t("default", "This payment method is not properly configured");
 } else {
     $sisow = new Sisow($mtid, $mtkey, $mtshopid);
 }
 if (empty($error)) {
     if (isset($_POST["issuerid"])) {
         $data_post = $_POST;
         $return_url = Yii::app()->getBaseUrl(true) . "/store/sisowinit/id/" . $data_get['id'];
         $sisow->purchaseId = $payment_ref;
         $sisow->description = $payment_description;
         $sisow->amount = $amount_to_pay;
         $sisow->payment = $data_post['payment_method'];
         $sisow->issuerId = $data_post["issuerid"];
         $sisow->returnUrl = $return_url;
         $sisow->notifyUrl = $sisow->returnUrl;
         if (($ex = $sisow->TransactionRequest()) < 0) {
             $error = $sisow->errorCode . " " . $sisow->errorMessage;
         } else {
Exemplo n.º 4
0
<?php

require_once "sisow.cls5.php";
$merchantid = "";
$merchantkey = "";
$shopid = "";
$sisow = new Sisow($merchantid, $merchantkey, $shopid);
if (isset($_POST["issuerid"])) {
    $sisow->purchaseId = $_POST["purchaseid"];
    $sisow->description = $_POST["description"];
    $sisow->amount = $_POST["amount"];
    $sisow->payment = $_POST["payment"];
    $sisow->issuerId = $_POST["issuerid"];
    $sisow->returnUrl = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
    $sisow->notifyUrl = $sisow->returnUrl;
    if (($ex = $sisow->TransactionRequest()) < 0) {
        header("Location: payment.php?ex=" . $ex . "&ec=" . $sisow->errorCode . "&em=" . $sisow->errorMessage);
        exit;
    }
    header("Location: " . $sisow->issuerUrl);
} else {
    if (isset($_GET["trxid"])) {
        if (isset($_GET['notify']) || isset($_GET['callback'])) {
            $sisow->StatusRequest($_GET["trxid"]);
            if ($sisow->status == "Success") {
                //verwerk order in database
            }
        } else {
            //stuur klant naar de juiste pagina
            if ($_GET['status'] == "Success") {
                $url = "succesurl";