123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <?php
- namespace app\data\controller\api;
- use app\data\service\payment\AlipayPaymentService;
- use app\data\service\payment\JoinpayPaymentService;
- use app\data\service\payment\WechatPaymentService;
- use think\admin\Controller;
- /**
- * 异步通知处理
- * Class Notify
- * @package app\data\controller\api
- */
- class Notify extends Controller
- {
- /**
- * 微信支付开通vip通知
- * @param string $scene 支付场景
- * @param string $param 支付参数
- * @return string
- * @throws \think\admin\Exception
- */
- public function opvipwx(string $scene = 'order', string $param = ''): string
- {
- if (strtolower($scene) === 'order') {
- return WechatPaymentService::instance($param)->opvip();
- } else {
- return 'success';
- }
- }
- /**
- * 支付宝开通vip通知
- * @param string $scene 支付场景
- * @param string $param 支付参数
- * @return string
- * @throws \think\admin\Exception
- */
- public function opvipzfb(string $scene = 'order', string $param = ''): string
- {
- if (strtolower($scene) === 'order') {
- return AlipayPaymentService::instance($param)->opvip();
- } else {
- return 'success';
- }
- }
- /**
- * 微信支付商城通知
- * @param string $scene 支付场景
- * @param string $param 支付参数
- * @return string
- * @throws \think\admin\Exception
- */
- public function orderwx(string $scene = 'order', string $param = ''): string
- {
- if (strtolower($scene) === 'order') {
- return WechatPaymentService::instance($param)->payorder();
- } else {
- return 'success';
- }
- }
- /**
- * 支付宝支付商城通知
- * @param string $scene 支付场景
- * @param string $param 支付参数
- * @return string
- * @throws \think\admin\Exception
- */
- public function orderzfb(string $scene = 'order', string $param = ''): string
- {
- if (strtolower($scene) === 'order') {
- return AlipayPaymentService::instance($param)->payorder();
- } else {
- return 'success';
- }
- }
- /**
- * 微信支付通知
- * @param string $scene 支付场景
- * @param string $param 支付参数
- * @return string
- * @throws \think\admin\Exception
- */
- public function wxpay(string $scene = 'order', string $param = ''): string
- {
- if (strtolower($scene) === 'order') {
- return WechatPaymentService::instance($param)->notify2();
- } else {
- return 'success';
- }
- }
- /**
- * 支付宝支付通知
- * @param string $scene 支付场景
- * @param string $param 支付参数
- * @return string
- * @throws \think\admin\Exception
- */
- public function alipay(string $scene = 'order', string $param = ''): string
- {
- if (strtolower($scene) === 'order') {
- return AlipayPaymentService::instance($param)->notify();
- } else {
- return 'success';
- }
- }
- /**
- * 汇聚支付通知
- * @param string $scene 支付场景
- * @param string $param 支付参数
- * @return string
- * @throws \think\admin\Exception
- */
- public function joinpay(string $scene = 'order', string $param = ''): string
- {
- if (strtolower($scene) === 'order') {
- return JoinpayPaymentService::instance($param)->notify();
- } else {
- return 'success';
- }
- }
- }
|