ToutiaoAlipay.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 2017/3/23
  6. * Time: 上午11:03
  7. */
  8. /**
  9. * 手机WAP端支付宝支付功能
  10. */
  11. namespace app\common\services\alipay;
  12. use app\common\exceptions\AppException;
  13. use app\common\services\AliPay;
  14. class ToutiaoAlipay extends AliPay
  15. {
  16. public function __construct()
  17. {
  18. //todo
  19. }
  20. public function doPay($data = [],$payType = 52)
  21. {
  22. $isnewalipay = \Setting::get('shop.pay.alipay_pay_api');
  23. if (isset($isnewalipay) && $isnewalipay == 1) {
  24. \Log::info('-------test-------', print_r($data,true));
  25. $uniacid = substr($data['body'], strrpos($data['body'], ':')+1);
  26. $content = [
  27. 'body' => $uniacid,
  28. 'subject' => $data['subject'],
  29. 'out_trade_no' => \YunShop::app()->uniacid.'_'.$data['order_no'],
  30. 'total_amount' => $data['amount'],
  31. 'product_code' => 'QUICK_MSECURITY_PAY',
  32. ];
  33. // 跳转到支付页面。
  34. $result = app('alipay.toutiao')->sdkExecute(json_encode($content));
  35. return $result;
  36. }
  37. throw new AppException('未开启支付宝新接口');
  38. }
  39. }