<?php
namespace Payment\Charge\Ali; use Payment\Common\Ali\AliBaseStrategy; use Payment\Common\Ali\Data\Charge\BarChargeData; use Payment\Common\PayException; class AliBarCharge extends AliBaseStrategy { protected $method = 'alipay.trade.pay'; public function getBuildDataClass() { $this->config->method = $this->method; return BarChargeData::class; } protected function retData(array $ret) { $reqData = parent::retData($ret); try { $data = $this->sendReq($reqData); } catch (PayException $e) { throw $e; } if ($data['code'] !== '10000') { new PayException($data['sub_msg']); } return $data; } } 