12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace Tool\MayouTool;
- use Tool\MayouTool\Bean\Pay\GetCodePayUrlParamBean;
- use Tool\MayouTool\Exception\PayException;
- use Tool\MayouTool\Pay\PayService;
- /**
- * 支付工具类
- * Class PayTool
- * @package Tool
- */
- class PayTool
- {
- /**
- * 获取支付二维码接口
- * @param GetCodePayUrlParamBean $bean
- * @return array ["qrcode_url"=>"支付二维码","qr"=>"支付二维码","order_number"=>"订单编号"]
- * @throws PayException
- */
- public static function getCodePayUrl(GetCodePayUrlParamBean $bean)
- {
- return PayService::getCodePayUrlService($bean);
- }
- /**
- * 根据官方订单编号获取订单
- * @param $token string token
- * @param $trade_sn string 官方订单编号
- * @param $amount int 金额(单位为分)
- * @return ["order_sn"=>"淘象订单编号","price"=>"支付金额(单位为分)"]
- */
- public static function getOfficialOrderByOrderNumber($token, $trade_sn, $amount)
- {
- return PayService::getOfficialOrderByOrderNumberService($token,$trade_sn,$amount);
- }
- /**
- * 获取支付方式
- * @param $appKey
- * @param $appSecret
- */
- public static function getPayMethod($appKey, $appSecret)
- {
- return PayService::getPayMethodService($appKey,$appSecret);
- }
- }
|