| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace addons\YunfastPay\common\services\pays\order;
- use addons\YunfastPay\common\services\pays\PayAbstract;
- use addons\YunfastPay\common\services\trans\nocash\H5PayTrans;
- use Yii;
- /**
- * h5支付
- * @package addons\YunfastPay\common\services\pays\order
- */
- class H5Pay extends PayAbstract
- {
- /**
- * @return H5PayTrans
- */
- public function getTrans()
- {
- $app_id = Yii::$app->services->setting->mall->get($this->pay->mall_id, 'mini_program.app_id');
- if (empty($app_id)) {
- throw new \Exception('小程序APPID未配置');
- }
- $trade = $this->pay->getTrade();
- $trans = new H5PayTrans(
- $trade->out_trade_no,
- $trade->pay_fee,
- $app_id,
- $trade->title
- );
- return $trans;
- }
-
- public function getPayData(array $result)
- {
- return [
- 'url' => $result['qrData'],
- ];
- }
- }
|