public function getAccountByUserIdAndOrderId($orderId, $userId) {/*{{{*/ $user = DAL::get()->find('user', $userId); if ($user->isNull()) { $this->setErrorCode(107); return 0; } $source = DAL::get()->find('intention', $orderId); if ($source->isNull()) { // $proposal = DAL::get()->find('proposal', $orderId); $proposal = $this->getRightObj($orderId); if($proposal->isNull()) { $this->setErrorCode(313); return 0; } $source = DAL::get()->find_by_source('serviceorder', $proposal); if($source->isNull()) { $this->setErrorCode(313); return 0; } } if($source->user->id != $user->id) { $this->setErrorCode(322); return 0; } $isToAlipay = 1; if($user->getCashAccount()->amount >= $source->getSalePrice()) { $isToAlipay = 0; } $info = array(); $info['orderId'] = $source->id; $info['userId'] = $user->id; $info['banlance'] = $user->getCashAccount()->amount; $info['price'] = $source instanceof Intention ? $source->getSalePrice() : $source->price; $info['isToAlipay'] = $isToAlipay; $waperAlipay = WaperAlipay::getInstance(); $info['showUrl'] = $waperAlipay->merchant_url; $this->content = $info; }/*}}}*/
public function getCaseRechargeOrderString4ali($caseId, $caseType, $os) {/*{{{*/ $infos = array(); if ($caseType != 'flow' && $caseType != 'Flow') { $this->setErrorCode(335); return false; } $flow = DAL::get()->find('DoctorPatientRef', $caseId); if ($flow->isNull()) { $this->setErrorCode(335); return false; } $product = ProductClient::getInstance()->getDoctorChargeFlowProduct($flow->space); $needPay = XString::calculateBalancePrice($product->salePrice, $flow->user->getCashAccount()->amount); if ($needPay <= 0) { return false; } $serviceOrder = ServiceOrderClient::getInstance()->create($flow, $product, $flow->user); if ($serviceOrder->isNull()) { $this->setErrorCode(307); return false; } //dodo::zhb 创建充值单 $depositeOrder = OrderClient::getInstance()->createDepositeOrder($flow->user, $needPay, DepositeOrder::RECHARGE_TYPE_ALIPAYWAP, array($serviceOrder)); if ($depositeOrder->isNull()) { $this->setErrorCode(3071); return false; } $userName = $flow->user->name; $callBackUrl = WapAlipay::getDefaultNotifyUrl(); $description = $userName."充值购买咨询"; $type = Pay::TYPE_FLOWORDER; $orderString = WapAlipay::getInstance()->encryptOrderInfo($depositeOrder->id, $type, $needPay, $callBackUrl, ServiceDef::getServiceSpec(ServiceDef::TYPE_FLOW)->text, $description); $infos['orderString'] = $orderString; $infos['wapPayUrl'] = WaperAlipay::getPayUrl4rechargeableCase($caseId, $os, $serviceOrder->id, $depositeOrder->id); $infos['wapPayReturnUrl'] = WaperAlipay::getDefaultReturnUrl(); $infos['wapPaySellerUrl'] = WaperAlipay::getDefaultSellerUrl(); $this->content = $infos; }/*}}}*/
</li> </ul> <div class="top_tips">90%当天与医生本人通话</div> </div> <div class="sel_pay_box"> <?php if ($userName) { ?> <div class="dear_user_box"> <p class="dear_user">尊敬的用户,系统已自动为您生成账号,请牢记(短信已发送到您手机)</p> <p><span class="fb">用户名:</span><?=$userName?></p> <p><span class="fb">密码:</span><?=$password?></p> </div> <?php } ?> <p class="pay_money"><span class="fb">服务内容:</span><span class="num"><?=$payable->product->salePrice?></span>元/<?=$payable->product->duration?>分钟以内</p> <p class="sel_pay_title">请选择支付方式:</p> <div class="alipay"> <a href="<?=WaperAlipay::getNoBalancePayUrl4telorder($payable->id)?>"><span>网上支付</span></a> </div> <div class="online_pay_no"> <a href="/touch/tel/paybank?orderid=<?=$payable->id?>"><span>无法网上支付</span></a> </div> <div class="sel_pay_box2"> <p class="title">温馨提示:</p> <div class="desc"> <p>1.与医生通话时间按照订单支付的先后顺序排列</p> <p>2.支付成功后,医生助理会立刻与医生确定最近的通话时间,并发短信通知您。</p> <p>3.如果您半天您未接到通知短信,请致电<span class="tel_number"><?=hdfPhoneNumber::PHONE_400_NUM?></span>咨询客服(晚上9点之后提交的将在第二天处理)</p> </div> </div> </div> <?php include_once dirname(__file__).'/../_innerfooter.php' ?>
<?php include_once dirname(__file__).'/../_header.php'; ?> <div class="head_p"> <?php if (false == $fromOtherHost) { ?> <p class="head_l fl br_b1"><a href="<?='javascript:history.go(-'.(isset($backCnt)?$backCnt:'1').');'?>" title="返回上页"></a></p> <?php } else if (isset($backUrl) && $backUrl) {?> <p class="head_l fl t_b_r"><a href="<?=$backUrl?>" title="返回上页"> </a></p> <?php } ?> <p class="head_c f19 fl"><?=$topTitle?></p> <?php if ($orderStatus == TelStatusDtoBase::STATUS_UNPAY && false == $serviceOrder->isNull()) { ?> <p class="head_r_1 fr t_b_l"><a href="<?=WaperAlipay::getNoBalancePayUrl4telorder($serviceOrder->id)?>" class="orange_1" title="立即支付">立即支付</a></p> <?php } ?> </div> <div class="case_main"> <?php include_once dirname(__file__).'/showtelorderinc/_telorderinfo.php'; ?> <?php include_once dirname(__file__).'/showtelorderinc/_patientinfo.php'; ?> <?php include_once dirname(__file__).'/showtelorderinc/_disease.php'; ?> </div> <?php include_once dirname(__file__).'/../_innerfooter.php'; ?>
public function alipayCallBack4ReturnTouchRecharge() {/*{{{*/ $waperAlipay = WaperAlipay::getInstance(); $verify_result = $waperAlipay->getResponse4return($_GET); if (!$verify_result) { echo '无效访问'; exit; } $orderId = substr($_GET['out_trade_no'], 0, strpos($_GET['out_trade_no'], '_')); $url = "http://".URL_PREFIX."m.haodf.com/touch/useraccount/payresult?orderid=".$orderId; header("Location: $url"); exit; }/*}}}*/
public function applyRecharge($request, $response) {/*{{{*/ $payUrl = WaperAlipay::getPayUrl4Recharge($this->user->id, $request->price); header("Location: $payUrl"); exit(); }/*}}}*/
<?php include_once dirname(__file__).'/../_headernohome.php';?> <div class="mt15 ml10 mr10"> <p class="f19 pt10 pb15 pl5 bb_e5">费用:<span class="or_f40"><?=$price?></span>元</p> <p class="pt15 f17 pl5 black">请选择支付方式:</p> <ul class="pay_list mt10 clearfix"> <li><a href="<?=WaperAlipay::getPayUrl4Zixun($ref->id)?>">支付宝支付</a></li> <li><a href="/touch/tel/paybank?orderid=<?=$ref->id?>&from=<?=Pay::ORDER_TYPE_FLOW?>">无法网上支付</a></li> </ul> <div class="lh180 pt20 f15"> <p class="or_f40 f17">请注意:</p> <div> <p class="pb10">如果您在支付过程中遇到任何问题,请联系我们:客服电话(工作日9:30-19:00)<span class="green_3"><?=HdfPhoneNumber::PHONE_FENZHEN?></span></p> <p>客服邮箱:<a href="mailto:pintaifuwu@haodf.com" class="green_3">pintaifuwu@haodf.com</a></p> </div> </div> </div> <?php include_once dirname(__file__).'/../_innerfooter.php' ?>
public function alipayChannel4Zixun($request, $response) { /*{{{*/ $flow = DAL::get()->find('DoctorPatientRef', $request->refid); DBC::requireFalse($flow->isNull(), '无效订单'); $product = ProductClient::getInstance()->getDoctorChargeFlowProduct($flow->space); $needPay = XString::calculateBalancePrice($product->salePrice, $flow->user->getCashAccount()->amount); DBC::requireTrue($needPay > 0, '价格有错误 或 余额可够支付'); $serviceOrder = ServiceOrderClient::getInstance()->create($flow, $product, $flow->user); DBC::requireFalse($serviceOrder->isNull(), '无效订单'); $depositeOrder = OrderClient::getInstance()->createDepositeOrder($flow->user, $needPay, DepositeOrder::RECHARGE_TYPE_ALIPAYWAP, array($serviceOrder)); DBC::requireFalse($depositeOrder->isNull(), '无效订单!'); $userName = $flow->user->name; $returnUrl = WaperAlipay::getDefaultReturnUrl4TouchZixun(); $notifyUrl = WaperAlipay::getDefaultNotifyUrl(); $sellerUrl = WaperAlipay::getDefaultSellerUrl4TouchZixun($serviceOrder->id); $aliPayUrl = WaperAlipay::getAliWapPayUrl($depositeOrder->id, $this->getPayTypeByOrder($serviceOrder), $needPay, $notifyUrl, $returnUrl, $sellerUrl, ServiceDef::getServiceSpec(ServiceDef::TYPE_FLOW)->text, $this->getPayDescriptionByOrder($serviceOrder, $userName)); $response->setRedirect($aliPayUrl); }
public function getResponse4notify($data, $name) { /*{{{*/ $waperAlipay = $this; $alipay = new wap_alipay_notify($waperAlipay->partner, $waperAlipay->key, $waperAlipay->sec_id, $waperAlipay->_input_charset); $waperAlipayFunction = wap_alipay_function::getInstance(); $verify_result = $alipay->notify_verify($data); if ($verify_result) { $status = $waperAlipayFunction->getDataForXML($data['notify_data'], '/notify/trade_status'); $status = (array) $status; $status = $status[0]; if ($status == 'TRADE_FINISHED' || $status == 'TRADE_SUCCESS') { $waperAlipay = WaperAlipay::getInstance()->initCallBackData($data, $name); if ($waperAlipay->isValid()) { return true; } } } return false; }