WechatTradePay.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 2017/3/17
  6. * Time: 下午12:00
  7. */
  8. namespace app\common\services;
  9. use app\common\events\payment\ChargeComplatedEvent;
  10. use app\common\exceptions\AppException;
  11. use app\common\exceptions\ShopException;
  12. use app\common\facades\EasyWeChat;
  13. use app\common\helpers\Client;
  14. use app\common\helpers\Url;
  15. use app\common\models\McMappingFans;
  16. use app\common\models\Member;
  17. use app\common\models\OrderPay;
  18. use app\common\models\PayOrder;
  19. use app\common\models\PayType;
  20. use app\common\services\finance\Withdraw;
  21. use app\frontend\modules\member\services\factory\MemberFactory;
  22. use app\frontend\modules\order\services\OrderPaySuccessService;
  23. use app\frontend\modules\order\services\OrderService;
  24. //这个类之前继承app\common\services\WechatPay的,但是没有什么鬼用啊都把方法全复写了还不如直接继承 Pay
  25. class WechatTradePay extends Pay
  26. {
  27. private $pay_type;
  28. private static $attach_type = 'account';
  29. public function __construct()
  30. {
  31. // parent::__construct();
  32. $this->pay_type = config('app.pay_type');
  33. }
  34. public function doPay($data = [], $payType = 1)
  35. {
  36. }
  37. /**
  38. * 微信退款
  39. *
  40. * @param 订单号 $out_trade_no
  41. * @param 订单总金额 $totalmoney
  42. * @param 退款金额 $refundmoney
  43. * @return array
  44. */
  45. public function doRefund($out_trade_no, $totalmoney, $refundmoney)
  46. {
  47. if (request()->is_wechat_trade) {
  48. return true;
  49. }
  50. return false;
  51. }
  52. /**
  53. * 微信提现
  54. *
  55. * @param int 提现者用户ID $member_id
  56. * @param int 提现金额 $money
  57. * @param string $desc
  58. * @param int $type
  59. */
  60. public function doWithdraw($member_id, $out_trade_no, $money, $desc = '', $type = 1)
  61. {
  62. }
  63. /**
  64. * 构造签名
  65. *
  66. * @var void
  67. */
  68. public function buildRequestSign()
  69. {
  70. // TODO: Implement buildRequestSign() method.
  71. }
  72. }