示例#1
0
 public function PayWithVerifyCode($cardInfo)
 {
     $now = time();
     $logger = Logger::getLogger('yibaopay');
     $logger->info("开始使用短信验证码支付({$now}) : " . print_r($cardInfo, true));
     $paramList = array("p0_Cmd" => "EposVerifySale", "p1_MerId" => YiBaoPay::$merId, "p2_Order" => $cardInfo["orderId"], "pb_VerifyCode" => $cardInfo["verifyCode"]);
     $hmac = YiBaoPay::GetHmacString($paramList);
     $logger->debug("正在使用短信验证码支付({$now}) : 生成的签名为({$hmac})");
     $paramList["hmac"] = $hmac;
     $url = YiBaoPay::BuildQueryString($paramList);
     $logger->debug("正在使用短信验证码支付({$now}) : url({$url})");
     if (YiBaoPay::$MODE != "TEST") {
         $returnValue = YiBaoPay::Request($url);
     } else {
         $returnValue = YiBaoPay::RandomPayWithVerifyCodeResult($cardInfo["orderId"]);
     }
     $returnValue = YiBaoPay::Feedback($returnValue, "", "");
     $logger->debug("结束使用短信验证码支付({$now}) : 返回" . print_r($returnValue, true));
     return $returnValue;
 }
示例#2
0
<?php

// 20140728
require_once "../../include/config.inc.php";
require_once "../../class/Logger.php";
Logger::configure("../../class/Logger.ini");
$now = time();
$logger = Logger::getLogger('yibaopay');
$logger->info("开始处理易宝异步返回的数据({$now}) : " . $_SERVER["QUERY_STRING"]);
echo "success";
require_once "YiBaoPay.php";
$payResult = YiBaoPay::Feedback($_GET, "", "", true);
$logger->info("正在处理易宝异步返回的数据({$now}) : " . print_r($payResult, true));
if ($payResult["r6_Order"] != "") {
    $orderId = $payResult["r6_Order"];
    $payType = substr($orderId, 3, 3);
    switch ($payType) {
        case "mrc":
            // 手机充值业务
            require_once "../../class/mobilerecharge.php";
            $logger->info("正在处理易宝异步返回的数据({$now}) : 开始手机充值业务");
            MobileRecharge::YiBaoPayFeedback($payResult, $orderId);
            $logger->info("正在处理易宝异步返回的数据({$now}) : 完成手机充值业务");
            break;
    }
}