laravel-crypto-payment-gateway
laravel-crypto-payment-gateway copied to clipboard
Invalid Order ID - . Max: 50 symbols
After following all the required steps and setting up my payment controller, once I click the submit button, I get the error message Invalid Order ID - . Max: 50 symbols
`public static function ipn ($cryptoPaymentModel, $payment_details, $box_status) { if($cryptoPaymentModel){ $userOrder = Payment::where('payment_id', $cryptoPaymentModel->payment_id)->first(); if(!$userOrder){ Payment::create([ 'payment_id' => $cryptoPaymentModel->payment_id, 'user_id' => Auth::user()->id, 'amount' => floatval($payment_details['amount']), 'amountusd' => floatval($payment_details['amountusd']), 'coinlabel' => $payment_details['coinlabel'], 'txconfirm' => $payment_details['confirmed'], 'status' => $payment_details['status'], ]); } if($userOrder && $box_status == "cryptobox_updated"){ $userOrder->txconfirm = $payment_details['confirmed']; $userOrder->save(); } if(!$cryptoPaymentModel->processed && $payment_details['confirmed']){ // add custom logic here
$cryptoPaymentModel->setStatusAsProcessed();
}
}
return true;
}`
payment Form
<div class="contact-form"> <form id="contact-form" class="form" name="payment" method="POST" action="{{ route('payments.crypto.pay') }}"> @csrf <div class="row"> <div class="form-group col-12 mb-3"> <label>Choose Plan:</label> <select class="form-select form-control" id="" name="plan"> <option value="starter">Starter</option> <option value="gold" selected>Gold</option> <option value="premium">Premium</option> </select> </div> <input type="hidden" name="user_id" value="{{ Auth::user()->id }}"> <div class="form-group col-12 mb-3"> <label>Enter your Amount:</label> <input name="amount" class="form-control" id="amountusd" required="required" type="text"> </div> <input type="hidden" name="redirect" value="{{ url()->full() }}"> <div class="form-group col-lg-12 mb-0 text-center"> <div class="actions"> <input value="Place Order" name="submit" id="submitButton" class="btn btn-contact-bg" type="submit"> <img src="assets/img/ajax-loader.gif" id="loader" style="display:none" alt="loading" width="16" height="16"> </div> </div> </div> </form> </div>
Route:
Route::get('/payment-process', [UserController::class, 'paymentProcessing'])->name('payment-process')->middleware('auth'); Route::match(['get', 'post'], '/payments/crypto/pay', Victorybiz\LaravelCryptoPaymentGateway\Http\Controllers\CryptoPaymentController::class)->name('payments.crypto.pay'); Route::post('/payments/crypto/callback', [App\Http\Controllers\Payment\PaymentController::class, 'callback'])->withoutMiddleware(['web', 'auth']);
Where is your order id in the form? you have to add the order id as hidden input