Driver.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <?php
  2. /**
  3. * Basepay.php UTF-8
  4. * 基础支付
  5. *
  6. * @date : 2018/2/27 21:52
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : wuyonghong <wyh@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace huolib\withdraw;
  13. abstract class Driver {
  14. protected $notify_url = '';
  15. protected $return_url = '';
  16. protected $show_url = '';
  17. protected $order_id = '';
  18. protected $product_id = '';
  19. protected $product_price = '0.00';
  20. protected $product_name = '';
  21. protected $product_desc = '';
  22. protected $real_amount = 0.00;
  23. protected $ip = '';
  24. protected $payway = 'alipay';
  25. protected $order_class = '';
  26. protected $func = '';
  27. protected $open_id = '';
  28. protected $mem_id = '';
  29. /* 时间戳 */
  30. protected $mem_reg_time = '';
  31. protected $mem_real_name = '';
  32. protected $mem_mobile = '';
  33. protected $payee_account = ''; //提现的支付宝账号
  34. protected $payee_real_name = ''; //账号的真实姓名
  35. protected $payer_show_name = ''; //支付宝显示名称
  36. protected $remark = ''; //备注
  37. protected $check_name = 'NO_CHECK'; //微信校验用户姓名选项 NO_CHECK:不校验真实姓名 FORCE_CHECK:强校验真实姓名
  38. /**
  39. * 提现
  40. *
  41. * @access public
  42. *
  43. */
  44. abstract public function withDraw();
  45. abstract public function orderQuery($order_id, $ext = null);
  46. /**
  47. * http://doc.1tsdk.com/138?page_id=2955
  48. * @param string $payway 支付方式
  49. * @param string $token 支付token
  50. * @param int $status 1 表示未支付 2 表示支付成功
  51. * @param int $is_native 2 原生 1 非原生
  52. * @param int $cp_status 1 待通知 2 通知成功 3 通知失败
  53. *
  54. * @return bool array pay_type 支付方式名称* pay_type 支付方式名称
  55. * order_id 支付的订单ID
  56. * real_amount 实际支付金额
  57. * status 玩家支付状态
  58. * cp_status 玩家支付状态
  59. * is_native 是否跳转原生
  60. * token 跳转地址
  61. */
  62. public function clientAjax($payway, $token, $status = 1, $is_native = 1, $cp_status = 1) {
  63. if (empty($token)) {
  64. return false;
  65. }
  66. $_rdata['pay_type'] = $payway;
  67. $_rdata['order_id'] = $this->order_id;
  68. $_rdata['product_price'] = $this->product_price;
  69. $_rdata['real_amount'] = $this->real_amount;
  70. $_rdata['token'] = $token;
  71. $_rdata['is_native'] = $is_native;
  72. $_rdata['status'] = $status;
  73. $_rdata['cp_status'] = $cp_status;
  74. return $_rdata;
  75. }
  76. /**
  77. * @return string
  78. */
  79. public function getNotifyUrl() {
  80. return $this->notify_url;
  81. }
  82. /**
  83. * @param string $notify_url
  84. */
  85. public function setNotifyUrl($notify_url) {
  86. $this->notify_url = $notify_url;
  87. }
  88. /**
  89. * @return string
  90. */
  91. public function getReturnUrl() {
  92. return $this->return_url;
  93. }
  94. /**
  95. * @param string $return_url
  96. */
  97. public function setReturnUrl($return_url) {
  98. $this->return_url = $return_url;
  99. }
  100. /**
  101. * @return string
  102. */
  103. public function getShowUrl() {
  104. return $this->show_url;
  105. }
  106. /**
  107. * @param string $show_url
  108. */
  109. public function setShowUrl($show_url) {
  110. $this->show_url = $show_url;
  111. }
  112. /**
  113. * @return string
  114. */
  115. public function getOrderId() {
  116. return $this->order_id;
  117. }
  118. /**
  119. * @param string $order_id
  120. */
  121. public function setOrderId($order_id) {
  122. $this->order_id = $order_id;
  123. }
  124. /**
  125. * @return string
  126. */
  127. public function getProductName() {
  128. return $this->product_name;
  129. }
  130. /**
  131. * @param string $product_name
  132. */
  133. public function setProductName($product_name) {
  134. $this->product_name = $product_name;
  135. }
  136. /**
  137. * @return string
  138. */
  139. public function getProductDesc() {
  140. return $this->product_desc;
  141. }
  142. /**
  143. * @param string $product_desc
  144. */
  145. public function setProductDesc($product_desc) {
  146. $this->product_desc = $product_desc;
  147. }
  148. /**
  149. * @return string
  150. */
  151. public function getRealAmount() {
  152. return $this->real_amount;
  153. }
  154. /**
  155. * @param float $real_amount
  156. */
  157. public function setRealAmount($real_amount) {
  158. $this->real_amount = $real_amount;
  159. }
  160. /**
  161. * @return string
  162. */
  163. public function getProductId() {
  164. return $this->product_id;
  165. }
  166. /**
  167. * @param string $product_id
  168. */
  169. public function setProductId($product_id) {
  170. $this->product_id = $product_id;
  171. }
  172. /**
  173. * @return string
  174. */
  175. public function getProductPrice() {
  176. return $this->product_price;
  177. }
  178. /**
  179. * @param string $product_price
  180. */
  181. public function setProductPrice($product_price) {
  182. $this->product_price = $product_price;
  183. }
  184. /**
  185. * @return string
  186. */
  187. public function getIp() {
  188. return $this->ip;
  189. }
  190. /**
  191. * @param string $ip
  192. */
  193. public function setIp($ip) {
  194. $this->ip = $ip;
  195. }
  196. /**
  197. * @return string
  198. */
  199. public function getPayway() {
  200. return $this->payway;
  201. }
  202. /**
  203. * @param string $payway
  204. */
  205. public function setPayway($payway) {
  206. $this->payway = $payway;
  207. }
  208. /**
  209. * @return string
  210. */
  211. public function getOrderClass() {
  212. return $this->order_class;
  213. }
  214. /**
  215. * @param string $order_class
  216. */
  217. public function setOrderClass($order_class) {
  218. $this->order_class = $order_class;
  219. }
  220. /**
  221. * @return string
  222. */
  223. public function getFunc() {
  224. return $this->func;
  225. }
  226. /**
  227. * @param string $func
  228. */
  229. public function setFunc($func) {
  230. $this->func = $func;
  231. }
  232. /**
  233. * @return string
  234. */
  235. public function getOpenId() {
  236. return $this->open_id;
  237. }
  238. /**
  239. * @param string $open_id
  240. */
  241. public function setOpenId($open_id) {
  242. $this->open_id = $open_id;
  243. }
  244. /**
  245. * @return string
  246. */
  247. public function getMemId() {
  248. return $this->mem_id;
  249. }
  250. /**
  251. * @param string $mem_id
  252. */
  253. public function setMemId($mem_id) {
  254. $this->mem_id = $mem_id;
  255. }
  256. /**
  257. * @return string
  258. */
  259. public function getMemRegTime() {
  260. return $this->mem_reg_time;
  261. }
  262. /**
  263. * @param string $mem_reg_time
  264. */
  265. public function setMemRegTime($mem_reg_time) {
  266. $this->mem_reg_time = $mem_reg_time;
  267. }
  268. /**
  269. * @return string
  270. */
  271. public function getMemRealName() {
  272. return $this->mem_real_name;
  273. }
  274. /**
  275. * @param string $mem_real_name
  276. */
  277. public function setMemRealName($mem_real_name) {
  278. $this->mem_real_name = $mem_real_name;
  279. }
  280. /**
  281. * @return string
  282. */
  283. public function getMemMobile() {
  284. return $this->mem_mobile;
  285. }
  286. /**
  287. * @param string $mem_mobile
  288. */
  289. public function setMemMobile($mem_mobile) {
  290. $this->mem_mobile = $mem_mobile;
  291. }
  292. /**
  293. * @return string
  294. */
  295. public function getPayeeAccount() {
  296. return $this->payee_account;
  297. }
  298. /**
  299. * @param string $payee_account
  300. */
  301. public function setPayeeAccount($payee_account) {
  302. $this->payee_account = $payee_account;
  303. }
  304. /**
  305. * @return string
  306. */
  307. public function getPayeeRealName() {
  308. return $this->payee_real_name;
  309. }
  310. /**
  311. * @param string $payee_real_name
  312. */
  313. public function setPayeeRealName($payee_real_name) {
  314. $this->payee_real_name = $payee_real_name;
  315. }
  316. /**
  317. * @return string
  318. */
  319. public function getCheckName() {
  320. return $this->check_name;
  321. }
  322. /**
  323. * @param string $check_name
  324. */
  325. public function setCheckName($check_name) {
  326. $this->check_name = $check_name;
  327. }
  328. /**
  329. * @return string
  330. */
  331. public function getPayerShowName() {
  332. return $this->payer_show_name;
  333. }
  334. /**
  335. * @param string $payer_show_name
  336. */
  337. public function setPayerShowName($payer_show_name) {
  338. $this->payer_show_name = $payer_show_name;
  339. }
  340. /**
  341. * @return string
  342. */
  343. public function getRemark() {
  344. return $this->remark;
  345. }
  346. /**
  347. * @param string $remark
  348. */
  349. public function setRemark($remark) {
  350. $this->remark = $remark;
  351. }
  352. }