AppPay.php 760 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace addons\YunfastPay\common\services\pays\order;
  3. use addons\YunfastPay\common\services\pays\PayAbstract;
  4. use addons\YunfastPay\common\services\trans\nocash\AppPayTrans;
  5. use Yii;
  6. /**
  7. * app支付
  8. * @package addons\YunfastPay\common\services\pays\order
  9. */
  10. class AppPay extends PayAbstract
  11. {
  12. /**
  13. * @return AppPayTrans
  14. */
  15. public function getTrans()
  16. {
  17. $trade = $this->pay->getTrade();
  18. $trans = new AppPayTrans(
  19. $trade->out_trade_no,
  20. $trade->pay_fee,
  21. $trade->title
  22. );
  23. $trans->setBrowser('alipay');
  24. return $trans;
  25. }
  26. public function getPayData(array $result)
  27. {
  28. return [
  29. 'url' => $result['qrData'],
  30. ];
  31. }
  32. }