Tampilan verifikasi & perbaikan form transaksi
This commit is contained in:
parent
5db69ecca2
commit
a0100ceb8d
23
app/Http/Controllers/ApiController.php
Normal file
23
app/Http/Controllers/ApiController.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ApiController extends Controller
|
||||||
|
{
|
||||||
|
public function payment_handler(Request $request) {
|
||||||
|
$json = json_decode($request->getContent());
|
||||||
|
|
||||||
|
$signature_key = hash('sha512', $json->order_id . $json->status_code . $json->gross_amount . env('MIDTRANS_SERVER_KEY'));
|
||||||
|
return $signature_key;
|
||||||
|
|
||||||
|
if ($signature_key != $json->signature_key) {
|
||||||
|
return "This is Invalid Signature";
|
||||||
|
}
|
||||||
|
|
||||||
|
// status confirm
|
||||||
|
$payment = Order::where('order_id', $json->order_id)->first();
|
||||||
|
return $payment->update(['status'=>$json->transaction_status]);
|
||||||
|
}
|
||||||
|
}
|
@ -1,36 +1,77 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
// use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
// class pembayaranController extends Controller
|
class pembayaranController extends Controller
|
||||||
// {
|
{
|
||||||
// public function index (request $request) {
|
public function index(Request $request) {
|
||||||
|
return view('user.payment.test');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function payment (request $request) {
|
||||||
|
dd($request);
|
||||||
// Set your Merchant Server Key
|
// Set your Merchant Server Key
|
||||||
// \Midtrans\Config::$serverKey = 'SB-Mid-server-M9ZB8EiNLVtHsciFMUA4RSc8';
|
\Midtrans\Config::$serverKey = env('MIDTRANS_SERVER_KEY');
|
||||||
// Set to Development/Sandbox Environment (default). Set to true for Production Environment (accept real transaction).
|
// Set to Development/Sandbox Environment (default). Set to true for Production Environment (accept real transaction).
|
||||||
// \Midtrans\Config::$isProduction = false;
|
\Midtrans\Config::$isProduction = false;
|
||||||
// Set sanitization on (default)
|
// Set sanitization on (default)
|
||||||
// \Midtrans\Config::$isSanitized = true;
|
\Midtrans\Config::$isSanitized = true;
|
||||||
// Set 3DS transaction for credit card to true
|
// Set 3DS transaction for credit card to true
|
||||||
// \Midtrans\Config::$is3ds = true;
|
\Midtrans\Config::$is3ds = true;
|
||||||
|
|
||||||
// $params = array(
|
$params = array(
|
||||||
// 'transaction_details' => array(
|
'transaction_details' => array(
|
||||||
// 'order_id' => rand(),
|
'order_id' => rand(),
|
||||||
// 'gross_amount' => 10000,
|
'gross_amount' => 10000,
|
||||||
// ),
|
),
|
||||||
// 'customer_details' => array(
|
"item_details" => array(
|
||||||
// 'first_name' => 'nurul prima',
|
[
|
||||||
// 'last_name' => 'annisa',
|
"id" => 'a1',
|
||||||
// 'email' => 'npannisa23@example.com',
|
"price" => "5000",
|
||||||
// 'phone' => '08111222333',
|
"quantity" => '3',
|
||||||
// ),
|
"name" => 'Ayam'
|
||||||
// );
|
],
|
||||||
|
[
|
||||||
|
"id" => 'b1',
|
||||||
|
"price" => "10000",
|
||||||
|
"quantity" => '2',
|
||||||
|
"name" => 'Thai Tea'
|
||||||
|
]
|
||||||
|
|
||||||
// $snapToken = \Midtrans\Snap::getSnapToken($params);
|
),
|
||||||
// return view('user.transaction.pembeli.bayar-transaction', ['snap_token'=>$snapToken]);
|
'customer_details' => array(
|
||||||
// }
|
// 'nama' => 'Nurul Prima Annisa',
|
||||||
// }
|
// "email" => 'npannisa23@gmail.com',
|
||||||
|
// "no hp" => '+6282284964524',
|
||||||
|
'email' => $request->get('email'),
|
||||||
|
'nominal' => $request->get('nominal'),
|
||||||
|
'tujuan' => $request->get('tujuan'),
|
||||||
|
'deskripsi' => $request->get('desk'),
|
||||||
|
|
||||||
|
),
|
||||||
|
|
||||||
|
);
|
||||||
|
$snapToken = \Midtrans\Snap::getSnapToken($params);
|
||||||
|
return view('user.payment.payment', ['snap_token'=>$snapToken]);
|
||||||
|
}
|
||||||
|
public function payment_post(Request $request) {
|
||||||
|
$json = json_decode($request->get('json'));
|
||||||
|
dd($json);
|
||||||
|
$payment = new Payment();
|
||||||
|
$payment->status = $json->transaction_status;
|
||||||
|
$payment->email = $request->get('email');
|
||||||
|
$payment->nominal = $request->get('nominal');
|
||||||
|
$payment->tujuan = $request->get('tujuan');
|
||||||
|
$payment->deskripsi = $request->get('deskripsi');
|
||||||
|
$payment->transaction_id = $json->transaction_id;
|
||||||
|
$payment->order_id = $json->order_id;
|
||||||
|
$payment->gross_amount = $json-> gross_amount;
|
||||||
|
$payment->payment_type = $json ->payment_type;
|
||||||
|
$payment->payment_code =isset($json->payment_code) ? $json->payment_code : null;
|
||||||
|
$payment->pdf_url =isset($json->pdf_url) ? $json->pdf_url : null;
|
||||||
|
return $payment->save() ? redirect(url('test'))->with('alert-succes', 'Payment Berhasil'): redirect(url('test'))->with('alert-failed', 'Terjadi Kesalahan');
|
||||||
|
dd($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
28
app/Http/Requests/StorepaymentRequest.php
Normal file
28
app/Http/Requests/StorepaymentRequest.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class StorepaymentRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*/
|
||||||
|
public function authorize(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string>
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
28
app/Http/Requests/UpdatepaymentRequest.php
Normal file
28
app/Http/Requests/UpdatepaymentRequest.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class UpdatepaymentRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*/
|
||||||
|
public function authorize(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string>
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
12
app/Models/payment.php
Normal file
12
app/Models/payment.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class payment extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
protected $guarded = []; //agar dapat mengisi keseluruhan table
|
||||||
|
}
|
66
app/Policies/PaymentPolicy.php
Normal file
66
app/Policies/PaymentPolicy.php
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Policies;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Models\payment;
|
||||||
|
use Illuminate\Auth\Access\Response;
|
||||||
|
|
||||||
|
class PaymentPolicy
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine whether the user can view any models.
|
||||||
|
*/
|
||||||
|
public function viewAny(User $user): bool
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can view the model.
|
||||||
|
*/
|
||||||
|
public function view(User $user, payment $payment): bool
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can create models.
|
||||||
|
*/
|
||||||
|
public function create(User $user): bool
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can update the model.
|
||||||
|
*/
|
||||||
|
public function update(User $user, payment $payment): bool
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can delete the model.
|
||||||
|
*/
|
||||||
|
public function delete(User $user, payment $payment): bool
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can restore the model.
|
||||||
|
*/
|
||||||
|
public function restore(User $user, payment $payment): bool
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can permanently delete the model.
|
||||||
|
*/
|
||||||
|
public function forceDelete(User $user, payment $payment): bool
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
23
database/factories/PaymentFactory.php
Normal file
23
database/factories/PaymentFactory.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\payment>
|
||||||
|
*/
|
||||||
|
class PaymentFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('payments', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('status');
|
||||||
|
$table->string('email');
|
||||||
|
$table->string('nominal');
|
||||||
|
$table->string('tujuan');
|
||||||
|
$table->string('deskripsi');
|
||||||
|
$table->string('transaction_id');
|
||||||
|
$table->string('order_id');
|
||||||
|
$table->string('gross_amount');
|
||||||
|
$table->string('payment_type');
|
||||||
|
$table->string('payment_code')->nullable();
|
||||||
|
$table->string('pdf_url')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('payments');
|
||||||
|
}
|
||||||
|
};
|
17
database/seeders/PaymentSeeder.php
Normal file
17
database/seeders/PaymentSeeder.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class PaymentSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
@ -52,3 +52,5 @@
|
|||||||
.profile .profile-edit img {
|
.profile .profile-edit img {
|
||||||
max-width: 120px;
|
max-width: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4249,13 +4249,128 @@ body:not(.sidebar-mini) .sidebar-style-2 .sidebar-menu li.active ul.dropdown-men
|
|||||||
background-repeat: no-repeat; /* Menghindari pengulangan gambar */
|
background-repeat: no-repeat; /* Menghindari pengulangan gambar */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.row-divider {
|
.row-divider {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* tracking penjual */
|
||||||
|
.activity {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-icon {
|
||||||
|
flex-shrink: 0;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-detail {
|
||||||
|
flex-grow: 1;
|
||||||
|
margin-left: 15px;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-detail p {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-job {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #6c757d;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* verifikasi */
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 800px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card.card-danger {
|
||||||
|
border: none;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
border-bottom: none;
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #007bff;
|
||||||
|
border-radius: 10px 10px 0 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body p {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body b {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.verification-code {
|
||||||
|
font-size: 3em;
|
||||||
|
color: #640707;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* transaksi */
|
||||||
|
.card-header h2 {
|
||||||
|
border-bottom: 3px solid #000; /* Warna dan ketebalan garis dapat disesuaikan */
|
||||||
|
padding-bottom: 5px; /* Jarak antara teks dan garis */
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashed-line {
|
||||||
|
border-top: 1px dashed #000; /* Garis putus-putus dengan ketebalan 1px dan warna hitam (#000) */
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
flex: 1;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
flex: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.form-row {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
margin-right: 0;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BIN
public/assets/images/google-removebg-preview.png
Normal file
BIN
public/assets/images/google-removebg-preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
59
public/assets/payment.css
Normal file
59
public/assets/payment.css
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
html, body {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
font-family: Roboto, Arial, sans-serif;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
form {
|
||||||
|
border: 5px solid #f1f1f1;
|
||||||
|
}
|
||||||
|
input[type=text], input[type=password] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 16px 8px;
|
||||||
|
margin: 8px 0;
|
||||||
|
display: inline-block;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
font-size: 110px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
color: #4286f4;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
background-color: #4286f4;
|
||||||
|
color: white;
|
||||||
|
padding: 14px 0;
|
||||||
|
margin: 10px 0;
|
||||||
|
border: none;
|
||||||
|
cursor: grab;
|
||||||
|
width: 48%;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
text-align:center;
|
||||||
|
fone-size:18;
|
||||||
|
}
|
||||||
|
button:hover {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
.formcontainer {
|
||||||
|
text-align: center;
|
||||||
|
margin: 24px 50px 12px;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
padding: 16px 0;
|
||||||
|
text-align:left;
|
||||||
|
}
|
||||||
|
span.psw {
|
||||||
|
float: right;
|
||||||
|
padding-top: 0;
|
||||||
|
padding-right: 15px;
|
||||||
|
}
|
||||||
|
/* Change styles for span on extra small screens */
|
||||||
|
@media screen and (max-width: 300px) {
|
||||||
|
span.psw {
|
||||||
|
display: block;
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
}
|
@ -23,6 +23,11 @@
|
|||||||
|
|
||||||
<link rel="stylesheet" href="{{ asset('css/main.css') }}">
|
<link rel="stylesheet" href="{{ asset('css/main.css') }}">
|
||||||
|
|
||||||
|
{{-- verifikasi --}}
|
||||||
|
<link rel="stylesheet" href="assets/css/style.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/components.css">
|
||||||
|
<link rel="stylesheet" href="assets/modules/bootstrap-social/bootstrap-social.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -144,46 +149,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{{-- edit profile --}}
|
{{-- edit profile --}}
|
||||||
<script>
|
|
||||||
document.addEventListener('DOMContentLoaded', function){
|
|
||||||
document.querySelector('form'.addEventListener('submit', function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
val fullName = document.getElementById('fullName').value;
|
|
||||||
val about = document.getElementById('about').value;
|
|
||||||
val company = document.getElementById('company').value;
|
|
||||||
val job = document.getElementById('job').value;
|
|
||||||
val country = document.getElementById('country').value;
|
|
||||||
val address = document.getElementById('address').value;
|
|
||||||
val phone = document.getElementById('phone').value;
|
|
||||||
val email = document.getElementById('email').value;
|
|
||||||
|
|
||||||
var data = {
|
|
||||||
fullName: fullName,
|
|
||||||
about: about,
|
|
||||||
company: company,
|
|
||||||
job: job,
|
|
||||||
country: country,
|
|
||||||
address: address,
|
|
||||||
phone: phone,
|
|
||||||
email: email
|
|
||||||
};
|
|
||||||
|
|
||||||
fetch('url', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
body: JSON.stringify(data)
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
console.log('Data Berhasil Disimpan:', data);
|
|
||||||
})
|
|
||||||
.catch.error('Terjadi Kesalahan:', error);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{{-- sweetalert payment --}}
|
{{-- sweetalert payment --}}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
56
resources/views/user/payment/payment.blade.php
Normal file
56
resources/views/user/payment/payment.blade.php
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
|
||||||
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
|
||||||
|
|
||||||
|
<!-- @TODO: replace SET_YOUR_CLIENT_KEY_HERE with your client key -->
|
||||||
|
<script type="text/javascript" src="https://app.sandbox.midtrans.com/snap/snap.js"
|
||||||
|
data-client-key="SB-Mid-client-dD1qABPfsyhMfqkP"></script>
|
||||||
|
<!-- Note: replace with src="https://app.midtrans.com/snap/snap.js" for Production environment -->
|
||||||
|
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<button id="pay-button">Pay!</button>
|
||||||
|
{{-- memasukkan data ke name dengan lanjutan sbmit formulir--}}
|
||||||
|
<form action="" id="submit_form" method="POST">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" name="json" id="json_callback">
|
||||||
|
</form>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var payButton = document.getElementById('pay-button');
|
||||||
|
payButton.addEventListener('click', function() {
|
||||||
|
window.snap.pay('{{$snap_token}}', {
|
||||||
|
onSuccess: function(result){
|
||||||
|
/* You may add your own implementation here */
|
||||||
|
alert("payment success!"); console.log(result);
|
||||||
|
send_response_to_form(result);
|
||||||
|
},
|
||||||
|
onPending: function(result){
|
||||||
|
/* You may add your own implementation here */
|
||||||
|
alert("wating your payment!"); console.log(result);
|
||||||
|
send_response_to_form(result);
|
||||||
|
},
|
||||||
|
onError: function(result){
|
||||||
|
/* You may add your own implementation here */
|
||||||
|
alert("payment failed!"); console.log(result);
|
||||||
|
send_response_to_form(result);
|
||||||
|
},
|
||||||
|
onClose: function(){
|
||||||
|
/* You may add your own implementation here */
|
||||||
|
alert('you closed the popup without finishing the payment');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
// membuat function
|
||||||
|
function send_response_to_form(result) {
|
||||||
|
document.getElementById('json_callback').value = JSON.stringify(result);
|
||||||
|
$('submit_form').submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
50
resources/views/user/payment/test.blade.php
Normal file
50
resources/views/user/payment/test.blade.php
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="{{ url('assets/payment.css') }}">
|
||||||
|
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<form action="/payment" method="GET">
|
||||||
|
<h1>Lakukan Pembayaran</h1>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="fas fa-user-circle"></i>
|
||||||
|
</div>
|
||||||
|
<div class="formcontainer">
|
||||||
|
<div class="container">
|
||||||
|
<label for="email"><strong>Email</strong></label>
|
||||||
|
<input type="text" placeholder="Enter Email" name="email" required>
|
||||||
|
|
||||||
|
<label for="nominal"><strong>Nominal</strong></label>
|
||||||
|
<input type="text" placeholder="Enter Nominal" name="nominal" required>
|
||||||
|
|
||||||
|
<label for="tujuan"><strong>Tujuan</strong></label>
|
||||||
|
<input type="text" placeholder="Enter Tujuan" name="tujuan" required>
|
||||||
|
|
||||||
|
<label for="desk"><strong>Deskripsi</strong></label>
|
||||||
|
<input type="text" placeholder="Enter Deskripsi" name="desk" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit"><strong>Bayar</strong></button>
|
||||||
|
<div class="container" style="background-color: #eee"></div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
@if (session('alert-succes'))
|
||||||
|
<script>
|
||||||
|
alert("{{ session('alert-succes') }}")
|
||||||
|
</script>
|
||||||
|
@elseif(session('alert-failed'))
|
||||||
|
<script>
|
||||||
|
alert("{{ session('alert-failed') }}")
|
||||||
|
</script>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -26,7 +26,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a href="/invoice-transaction" type="button" class="btn btn-primary">Selesai</a>
|
<a href="/pembeli" type="button" class="btn btn-primary">Selesai</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@extends('user.layout.main')
|
{{-- @extends('user.layout.main')
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<section class="section">
|
<section class="section">
|
||||||
@ -116,9 +116,9 @@
|
|||||||
<div class="text-md-right">
|
<div class="text-md-right">
|
||||||
<div class="float-lg-left mb-lg-0 mb-3">
|
<div class="float-lg-left mb-lg-0 mb-3">
|
||||||
<a href="#" class="btn btn-primary btn-icon icon-left" id="payment"><i class="fas fa-credit-card" ></i> Process
|
<a href="#" class="btn btn-primary btn-icon icon-left" id="payment"><i class="fas fa-credit-card" ></i> Process
|
||||||
Payment</a>
|
Payment</a> --}}
|
||||||
{{-- <button id="pay-button">Pay!</button> --}}
|
{{-- <button id="pay-button">Pay!</button> --}}
|
||||||
<a href="/pembeli" class="btn btn-danger btn-icon icon-left"><i class="fas fa-times"></i> Cancel</a>
|
{{-- <a href="/pembeli" class="btn btn-danger btn-icon icon-left"><i class="fas fa-times"></i> Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-warning btn-icon icon-left"><i class="fas fa-print"></i> Print</button>
|
<button class="btn btn-warning btn-icon icon-left"><i class="fas fa-print"></i> Print</button>
|
||||||
</div>
|
</div>
|
||||||
@ -130,4 +130,4 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@endsection
|
@endsection --}}
|
@ -15,119 +15,85 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label for="inputpembeli">Nama Pembeli</label>
|
<label for="inputpembeli">Nama Pembeli</label>
|
||||||
<input type="email" class="form-control" id="inputpembeli" placeholder="Masukkan nama pembeli">
|
<input type="email" class="form-control" id="inputpembeli"
|
||||||
|
placeholder="Masukkan nama pembeli">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputpenjual">Nama Penjual</label>
|
<label for="inputpenjual">Nama Penjual</label>
|
||||||
<input type="text" class="form-control" id="inputpenjual" placeholder="Masukkan nama penjual">
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control" id="inputpenjual" list="pembeli">
|
||||||
</div>
|
</div>
|
||||||
|
<datalist id="pembeli">
|
||||||
|
<option value="Pembeli 1">
|
||||||
|
<option value="Pembeli 2">
|
||||||
|
<option value="Pembeli 3">
|
||||||
|
</datalist>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control" id="inputpenjual"
|
||||||
|
placeholder="Masukkan atau pilih nama penjual">
|
||||||
|
<button class="btn btn-danger" type="button" id="checkButton">Check</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="harga">Harga</label>
|
<label for="harga">Harga</label>
|
||||||
<input type="text" class="form-control" id="harga" placeholder="Rp.1000.000">
|
<input type="text" class="form-control" id="harga" placeholder="Rp.1000.000">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputjenis">Jenis Barang</label>
|
<label for="inputjenis">Jenis Barang</label>
|
||||||
<input type="text" class="form-control" id="inputjenis" placeholder="">
|
<input type="text" class="form-control" id="inputjenis" placeholder="">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Due Date</label>
|
<label>Due Date</label>
|
||||||
<input type="date" class="form-control">
|
<input type="date" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="inputjenis">Jenis Barang</label>
|
||||||
|
<input type="text" class="form-control" id="inputjenis" placeholder="">
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputdeskripsi">Deskripsi</label>
|
<label for="inputdeskripsi">Deskripsi</label>
|
||||||
<textarea class="form-control resizable" id="deskripsi" placeholder="Deskripsikan jenis apa transaksi yang anda lakukan"></textarea>
|
<textarea class="form-control resizable" id="deskripsi"
|
||||||
</div>
|
placeholder="Deskripsikan jenis apa transaksi yang anda lakukan"></textarea>
|
||||||
<div class="form-group mb-0">
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" id="gridCheck">
|
|
||||||
<label class="form-check-label" for="gridCheck">
|
|
||||||
Check me out
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="dashed-line"></div>
|
||||||
|
|
||||||
|
<div class="form-row">
|
||||||
|
<label for="nominal" style="margin-right: 500px;">Nominal</label>
|
||||||
|
<div style="display: inline-block;">Rp. 890000</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-row">
|
||||||
|
<label for="biayaAdmin" style="margin-right: 500px;">Biaya Admin</label>
|
||||||
|
<div style="display: inline-block; ">Rp.0</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="dashed-line"></div>
|
||||||
|
|
||||||
|
|
||||||
<div class="card-footer d-flex justify-content-center">
|
<div class="card-footer d-flex justify-content-center">
|
||||||
<a href="/pembeli" class="btn btn-primary">Submit</a>
|
<a href="/pembeli" class="btn btn-primary">Submit</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{-- form transaksi --}}
|
|
||||||
{{-- <div class="container">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-body">
|
|
||||||
<form>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="orderid" class="form-label">Order Id</label>
|
|
||||||
<input type="text" class="form-control" id="orderId" name="order" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="customer" class="form-label">Customer</label>
|
|
||||||
<input type="text" class="form-control" id="customer" name="customer" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="seller" class="form-label">Norek Asal</label>
|
|
||||||
<input type="text" class="form-control" id="norekasal" name="norekasal" pattern="[0-9]+" required>
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
Harap masukkan hanya angka</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="seller" class="form-label">Seller</label>
|
|
||||||
<input type="text" class="form-control" id="seller" name="seller" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="seller" class="form-label">Norek Tujuan</label>
|
|
||||||
<input type="text" class="form-control" id="norektujuan" name="norektujuan" pattern="[0-9]+" required>
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
Harap masukkan hanya angka.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="total" class="form-label">Total</label>
|
|
||||||
<input type="text" class="form-control" id="total" name="total">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="seller" class="form-label">Due Date</label>
|
|
||||||
<input type="calendar" class="form-control" id="duedate" name="duedate" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="textareadesc" class="form-label">Deskripsi</label>
|
|
||||||
<textarea class="form-control" id="textareadesc" rows="3"></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{{-- <div class="d-flex justify-content-center">
|
|
||||||
<button class="btn btn-info open-detail-modal" data-toggle="modal fade"
|
|
||||||
data-target="#confirmtransaction">Transaksi Sudah Benar</button>
|
|
||||||
</div> --}}
|
|
||||||
|
|
||||||
<div class="d-flex justiffy-content-center">
|
|
||||||
<a href="/pembeli" type="button" class="btn btn-primary" data-bs-dismiss="modal">Transaksi Sudah
|
|
||||||
Benar</a>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{-- </div> --}}
|
|
||||||
</div>
|
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a href="#" class="btn btn-primary mx-1">Back</a>
|
<a href="/penjual" class="btn btn-primary mx-1">Back</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
53
resources/views/user/verifikasi/index.blade.php
Normal file
53
resources/views/user/verifikasi/index.blade.php
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" name="viewport">
|
||||||
|
<title>Verifikasi Email Pemulihan</title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="assets/modules/bootstrap/css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/style.css">
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="app">
|
||||||
|
<section class="section">
|
||||||
|
<div class="container mt-5">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-md-10">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header d-flex justify-content-center bg-primary text-white">
|
||||||
|
<img class="mr-3 rounded" width="150" src="assets/images/google-removebg-preview.png">
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center bg-primary text-white">
|
||||||
|
<h2 class="mb-0">Verifikasi Email Pemulihan</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<p>Google menerima permintaan untuk menggunakan</p>
|
||||||
|
<p><b>nurulprimaa@gmail.com</b> sebagai email pemulihan untuk akun Google</p>
|
||||||
|
<p><b>npannisa23@gmail.com</b></p>
|
||||||
|
<p class="mt-4">Gunakan kode ini untuk menyelesaikan penyiapan email pemulihan ini:</p>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
<h1 class="verification-code">123469</h1>
|
||||||
|
</div>
|
||||||
|
<div class="text-center">
|
||||||
|
<p><b>Masa berlaku kode ini akan berakhir dalam 24 jam.</b> </p>
|
||||||
|
</div>
|
||||||
|
<div class="text-break"><p>Jika anda tidak mengenali <b>npannisa23@gmail.com</b>, Anda dapat mengabaikan email ini dengan aman. </p></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="text-center">
|
||||||
|
<p>Anda menerima email ini sebagai pemberitahuan tentang
|
||||||
|
perubahan penting pada layanan dan Akun Google anda.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</html>
|
@ -1,8 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\ApiController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| API Routes
|
| API Routes
|
||||||
@ -17,3 +19,5 @@ use Illuminate\Support\Facades\Route;
|
|||||||
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
||||||
return $request->user();
|
return $request->user();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::post('/payment-handler', [ApiController::class, 'payment_handler']);
|
||||||
|
@ -98,7 +98,9 @@ Route::get('/invoice-transaction', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// percobaan midtrans untuk payment
|
// percobaan midtrans untuk payment
|
||||||
// Route::get('/bayar-transaction', [pembayaranController::class, 'index']);
|
Route::get('/test', [pembayaranController::class, 'index']);
|
||||||
|
Route::get('/payment', [pembayaranController::class, 'payment']);
|
||||||
|
Route::post('/payment', [pembayaranController::class, 'payment_post']);
|
||||||
|
|
||||||
|
|
||||||
// profile
|
// profile
|
||||||
@ -108,25 +110,12 @@ Route::get('/profile', function () {
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::post('/profile', [ProfileController::class,'updateProfile']);
|
// verifikasi
|
||||||
|
Route::get('/verifikasi', function () {
|
||||||
// Route::middleware(['web'])->group(function () {
|
return view('user/verifikasi/index',[
|
||||||
// ... Rute lain di sini ...
|
'name'=>'npannisa',
|
||||||
// Route::post('/profile', 'ProfileController@updateProfile');
|
]);
|
||||||
// });
|
});
|
||||||
Route::get('/profile/edit', [ProfileController::class, 'showEditForm'])->name('profile.edit');
|
|
||||||
Route::post('/profile/edit', [ProfileController::class, 'updateProfile']);
|
|
||||||
|
|
||||||
|
|
||||||
// controller
|
|
||||||
// Route::get('/refund/create', 'RefundController@create');
|
|
||||||
// Route::post('/refund', 'RefundController@store');
|
|
||||||
// Route::get('/refund/{id}', 'RefundController@show');
|
|
||||||
// Route::delete('/refund/{id}', 'RefundController@destroy');
|
|
||||||
// routes/web.php
|
|
||||||
Route::post('/refund/create', 'RefundController@create')->name('refund.create');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user