use Yansongda\Pay\Pay;
use Illuminate\Http\Request;
use Zhongchuan\Payment\PaymentModeType;
use Zhongchuan\Payment\UserPaymentService;
class Alipay_notify_controller extends Payment_Base_Controller
{
public function construct()
{
parent::construct();
$this->load->model('paymentrequest/Payment_request_model');
}
public function notify(Request $request)
{
file_put_contents('notify.txt', $request, FILE_APPEND);
$pay = new Pay($this->alipay_config);
if ($pay->driver('alipay')->gateway('app')->verify($request->all())) {
file_put_contents('notify.txt', $request, FILE_APPEND);
}
}
}
报错详情
Severity: 4096
Message: Argument 1 passed to Alipay_notify_controller::notify() must be an instance of Illuminate\Http\Request, none given
问题描述
使用你列子中的回调方法,支付宝回调用回调地址后数据是以POST方式返回回来的,请问你的notify 函数规定了类型,导致我一直接收不到支付宝回调信息,我改为了$_POST去接收,但是这样就需要修改你封装好的文件里面的东西,所以想问一下,是我这边有什么代码没有配置上还是怎么回事
代码
<?php
use Yansongda\Pay\Pay; use Illuminate\Http\Request; use Zhongchuan\Payment\PaymentModeType; use Zhongchuan\Payment\UserPaymentService;
class Alipay_notify_controller extends Payment_Base_Controller { public function construct() { parent::construct(); $this->load->model('paymentrequest/Payment_request_model'); }
}
报错详情
Severity: 4096
Message: Argument 1 passed to Alipay_notify_controller::notify() must be an instance of Illuminate\Http\Request, none given
Filename: controllers/Alipay_notify_controller.php
Line Number: 16