* @version : HUOSDK 8.0 */ namespace huolib\pay; abstract class Driver { protected $notify_url = ''; protected $return_url = ''; protected $show_url = ''; protected $order_id = ''; protected $product_id = ''; protected $product_price = '0.00'; protected $product_name = ''; protected $product_desc = ''; protected $real_amount = 0.00; protected $ip = ''; protected $payway = 'alipay'; protected $order_class = ''; protected $func = ''; protected $open_id = ''; protected $mem_id = ''; /* 时间戳 */ protected $mem_reg_time = ''; protected $mem_real_name = ''; protected $mem_mobile = ''; protected $use_protocol = false; /** * 移动APP支付函数 * * @access public * */ abstract public function clientPay(); /** * 移动端支付函数 * * @access public * * */ abstract public function mobilePay(); /** * PC端支付函数 * * @access public * * */ abstract public function pcPay(); /** * 异步回调函数 * * @access public * * */ abstract public function notifyUrl(); /** * 返回接收页面 * * @access public * * */ abstract public function returnUrl(); /** * 查询订单 * * @access public * * @param string $order_id 商户系统内部订单号 * @param string $transaction_id 第三方支付的订单号 * @param null $ext 扩展信息 * */ abstract public function orderQuery($order_id, $transaction_id, $ext = null); /** * http://doc.1tsdk.com/138?page_id=2955 * @param string $payway 支付方式 * @param string $token 支付token * @param int $status 1 表示未支付 2 表示支付成功 * @param int $is_native 2 原生 1 非原生 * @param int $cp_status 1 待通知 2 通知成功 3 通知失败 * * @return bool array pay_type 支付方式名称* pay_type 支付方式名称 * order_id 支付的订单ID * real_amount 实际支付金额 * status 玩家支付状态 * cp_status 玩家支付状态 * is_native 是否跳转原生 * token 跳转地址 */ public function clientAjax($payway, $token, $status = 1, $is_native = 1, $cp_status = 1, $btoken = '') { if (empty($token)) { return false; } $_rdata['pay_type'] = $payway; $_rdata['order_id'] = $this->order_id; $_rdata['product_price'] = $this->product_price; $_rdata['real_amount'] = $this->real_amount; $_rdata['token'] = $token; $_rdata['is_native'] = $is_native; $_rdata['status'] = $status; $_rdata['cp_status'] = $cp_status; $_rdata['btoken'] = $btoken; /*备用返回跳转链接*/ return $_rdata; } /** * @return string */ public function getNotifyUrl() { return $this->notify_url; } /** * @param string $notify_url */ public function setNotifyUrl($notify_url) { $this->notify_url = $notify_url; } /** * @return string */ public function getReturnUrl() { return $this->return_url; } /** * @param string $return_url */ public function setReturnUrl($return_url) { $this->return_url = $return_url; } /** * @return string */ public function getShowUrl() { return $this->show_url; } /** * @param string $show_url */ public function setShowUrl($show_url) { $this->show_url = $show_url; } /** * @return string */ public function getOrderId() { return $this->order_id; } /** * @param string $order_id */ public function setOrderId($order_id) { $this->order_id = $order_id; } /** * @return string */ public function getProductName() { return $this->product_name; } /** * @param string $product_name */ public function setProductName($product_name) { $this->product_name = $product_name; } /** * @return string */ public function getProductDesc() { return $this->product_desc; } /** * @param string $product_desc */ public function setProductDesc($product_desc) { $this->product_desc = $product_desc; } /** * @return string */ public function getRealAmount() { return $this->real_amount; } /** * @param float $real_amount */ public function setRealAmount($real_amount) { $this->real_amount = $real_amount; } /** * @return string */ public function getProductId() { return $this->product_id; } /** * @param string $product_id */ public function setProductId($product_id) { $this->product_id = $product_id; } /** * @return string */ public function getProductPrice() { return $this->product_price; } /** * @param string $product_price */ public function setProductPrice($product_price) { $this->product_price = $product_price; } /** * @return string */ public function getIp() { return $this->ip; } /** * @param string $ip */ public function setIp($ip) { $this->ip = $ip; } /** * @return string */ public function getPayway() { return $this->payway; } /** * @param string $payway */ public function setPayway($payway) { $this->payway = $payway; } /** * @return string */ public function getOrderClass() { return $this->order_class; } /** * @param string $order_class */ public function setOrderClass($order_class) { $this->order_class = $order_class; } /** * @return string */ public function getFunc() { return $this->func; } /** * @param string $func */ public function setFunc($func) { $this->func = $func; } /** * @return string */ public function getOpenId() { return $this->open_id; } /** * @param string $open_id */ public function setOpenId($open_id) { $this->open_id = $open_id; } /** * @return string */ public function getMemId() { return $this->mem_id; } /** * @param string $mem_id */ public function setMemId($mem_id) { $this->mem_id = $mem_id; } /** * @return string */ public function getMemRegTime() { return $this->mem_reg_time; } /** * @param string $mem_reg_time */ public function setMemRegTime($mem_reg_time) { $this->mem_reg_time = $mem_reg_time; } /** * @return string */ public function getMemRealName() { return $this->mem_real_name; } /** * @param string $mem_real_name */ public function setMemRealName($mem_real_name) { $this->mem_real_name = $mem_real_name; } /** * @return string */ public function getMemMobile() { return $this->mem_mobile; } /** * @param string $mem_mobile */ public function setMemMobile($mem_mobile) { $this->mem_mobile = $mem_mobile; } /** * @return bool */ public function getUseProtocol() { return $this->use_protocol; } /** * @param bool $use_protocol */ public function setUseProtocol($use_protocol) { $this->use_protocol = $use_protocol; } }