Sar*_* TS 7 php paypal laravel payone
我已成功实施Payone支付网关(Creditcard,Sofort,Paydirect和Paypal).成功付款后,我得到了回应(指定和支付),一切都很好.但有时我在客户支付使用后没有得到Payone的回复Paypal(我检查了大约60次成功的交易.但是在2或3次交易中没有得到回应而且客户的金额已从他们的账户中扣除).
成功交易后,payone将数据发布到此路线
/* Response from payone */
Route::post('/payment/response', 'PaymentController@response')->name('payment.response');
Run Code Online (Sandbox Code Playgroud)
我认为laravel请求不是从url捕获数据.或使用此方法有问题Schema::hasColumn.
任何帮助将不胜感激.
PaymentController.php
public function response(Request $request)
{
// Here I created to store all request in to table but data is not storing.
/* Testing purpose begin */
$payment = new Payment;
foreach($_POST as $key => $value) {
if(Schema::hasColumn($payment->getTable(), $key)){
if(is_array($value)) {
$payment->{$key} = $value[1];
} else {
$payment->{$key} = $value;
}
}
}
$payment->save();
/* Testing purpose end */
if ($_POST["key"] == hash("md5", env('KEY'))) {
echo "TSOK"; // If key is valid, TSOK notification is for PAYONE
$user = Userlist::where('is_delete', 0)
->where('usrActive', '1')
->where('userid', $_POST["userid"])
->first();
if($user && $_POST["clearingtype"] && $_POST["txaction"]) {
$bookings = Booking::select('_id', 'old_booking_id', 'status', 'payment_status')
->where('user', new \MongoDB\BSON\ObjectID($user->_id))
->whereIn('status', ['5', '8', '10', '11']) //5=>Waiting for payment, 8=>Cart, 10=> Temporary (This status is using in edit booking section), 11=> On processing
->where('is_delete', 0)
->where('txid', $_POST["txid"])
->where('userid', $_POST["userid"])
->get();
if($bookings) {
if ($_POST["txaction"] == "appointed") {
update booking status and sent email
}
else if ($_POST["txaction"] == "paid") {
update paid status
}
else {
update failed status
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
laravel日志
[2018-09-11 09:04:14] production.ERROR: Method [error] does not exist on [App\Http\Controllers\PaymentController]. {"userId":"5afa790212236cc4660ed509","exception":"[object] (BadMethodCallException(code: 0): Method [error] does not exist on [App\\Http\\Controllers\\PaymentController]. at /var/www/vhosts/cabin-holiday.frontend/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:68)
[App\Http\Controllers\PaymentController] 上不存在方法 [错误]。
在 PaymentController 上编写错误方法。尝试查找支付网关文档中提到的错误方法的文档。并阅读何时调用以及为什么调用。这样您就可以了解在 PaymentController 中的错误方法中要处理什么。您可能必须声明路线,或者它可能已经存在于您的路线中,因为它不是抱怨路线而是方法。希望这对您有帮助。