<?php
namespace Payment\Charge\Wx; use Payment\Common\Weixin\Data\Charge\WapChargeData; use Payment\Common\Weixin\WxBaseStrategy; class WxWapCharge extends WxBaseStrategy { public function getBuildDataClass() { $this->config->tradeType = 'MWEB'; return WapChargeData::class; } protected function retData(array $ret) { if ($this->config->returnRaw) { return $ret; } $wabUrl = $ret['mweb_url']; if ($this->config->returnUrl) { $wabUrl .= '&redirect_url=' . urlencode($this->config->returnUrl); } return $wabUrl; } }