<?php
namespace Payment\Charge\Wx; use Payment\Common\Weixin\Data\BackPubChargeData; use Payment\Common\Weixin\Data\Charge\PubChargeData; use Payment\Common\Weixin\WxBaseStrategy; class WxPubCharge extends WxBaseStrategy { public function getBuildDataClass() { $this->config->tradeType = 'JSAPI'; return PubChargeData::class; } protected function retData(array $ret) { $back = new BackPubChargeData($this->config, $ret); $back->setSign(); $backData = $back->getData(); $backData['paySign'] = $backData['sign']; unset($backData['sign']); return $backData; } } 