1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace app\common\service;
- use addons\epay\library\Service;
- use app\common\model\Payment;
- use com\unionpay\acp\sdk\AcpService;
- use com\unionpay\acp\sdk\UnionQuery;
- use fast\Arr;
- use think\App;
- class PayReturnService{
- /** @var Payment */
- protected $payment;
- /**
- * @param Payment $payment
- */
- public function setPayment(Payment $payment): void
- {
- $this->payment = $payment;
- }
- public function companyBank(){
- }
- public function wechat(){
- $payed=Service::checkNotify('wechat');
- return [
- $payed!==false,
- 'success'
- ];
- }
- public function returnUrl(){
- return request()->root(true);
- }
- public function alipay(){
- $payed=Service::checkNotify('alipay');
- return [
- $payed!==false,
- 'success'
- ];
- }
- public function bankUnion(){
- require __DIR__.'/../library/upacp_demo_b2c/sdk/acp_service.php';
- $postData=input();
- $isPay=AcpService::validate($_POST);
- $queryPay=UnionQuery::query($postData['orderId'],$this->payment->create_time);
- user_log('PayReturnService.bankUnion',compact('isPay','queryPay'));
- return [
- $isPay && $queryPay,
- 'success'
- ];
- }
- public function otherUser(){}
- public function offline(){}
- public function process(){
- $method=Arr::get(OrderPayService::$methods,$this->payment->pay_type);
- return App::invokeMethod([$this,$method]);
- }
- }
|