EVERYTHING WORKING - Safing
This commit is contained in:
parent
c69c28bd89
commit
93d8dfcf0b
|
@ -197,6 +197,9 @@ class PaymentController extends Controller
|
||||||
'status' => $response->result->status,
|
'status' => $response->result->status,
|
||||||
'amount' => $paypalProduct->quantity,
|
'amount' => $paypalProduct->quantity,
|
||||||
'price' => $paypalProduct->price,
|
'price' => $paypalProduct->price,
|
||||||
|
'tax_value' => $this->getTaxValue($paypalProduct),
|
||||||
|
'tax_percent' => $this->getTaxPercent(),
|
||||||
|
'total_price' => $this->getTotalPrice($paypalProduct),
|
||||||
'currency_code' => $paypalProduct->currency_code,
|
'currency_code' => $paypalProduct->currency_code,
|
||||||
'payer' => json_encode($response->result->payer),
|
'payer' => json_encode($response->result->payer),
|
||||||
]);
|
]);
|
||||||
|
@ -235,7 +238,7 @@ class PaymentController extends Controller
|
||||||
*/
|
*/
|
||||||
public function cancel(Request $request)
|
public function cancel(Request $request)
|
||||||
{
|
{
|
||||||
return redirect()->route('store.index')->with('success', 'Payment was Cannceled');
|
return redirect()->route('store.index')->with('success', 'Payment was Canceled');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -254,6 +257,7 @@ class PaymentController extends Controller
|
||||||
->editColumn('price', function (Payment $payment) {
|
->editColumn('price', function (Payment $payment) {
|
||||||
return $payment->formatCurrency();
|
return $payment->formatCurrency();
|
||||||
})
|
})
|
||||||
|
|
||||||
->editColumn('created_at', function (Payment $payment) {
|
->editColumn('created_at', function (Payment $payment) {
|
||||||
return $payment->created_at ? $payment->created_at->diffForHumans() : '';
|
return $payment->created_at ? $payment->created_at->diffForHumans() : '';
|
||||||
})
|
})
|
||||||
|
|
|
@ -29,6 +29,9 @@ class Payment extends Model
|
||||||
'type',
|
'type',
|
||||||
'amount',
|
'amount',
|
||||||
'price',
|
'price',
|
||||||
|
'tax_value',
|
||||||
|
'total_price',
|
||||||
|
'tax_percent',
|
||||||
'currency_code',
|
'currency_code',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddTaxToPaymentlogs extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('payments', function (Blueprint $table) {
|
||||||
|
$table->decimal('tax_value',8,2)->after('price')->nullable();
|
||||||
|
$table->integer('tax_percent')->after('tax_value')->nullable();
|
||||||
|
$table->decimal('total_price',8,2)->after('tax_percent')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('payments', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('tax_value');
|
||||||
|
$table->dropColumn('tax_percent');
|
||||||
|
$table->dropColumn('total_price');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -37,7 +37,10 @@
|
||||||
<th>User</th>
|
<th>User</th>
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
<th>Amount</th>
|
<th>Amount</th>
|
||||||
<th>Price</th>
|
<th>Product Price</th>
|
||||||
|
<th>Tax</th>
|
||||||
|
<th>Tax(%)</th>
|
||||||
|
<th>Total Price</th>
|
||||||
<th>Payment_ID</th>
|
<th>Payment_ID</th>
|
||||||
<th>Payer_ID</th>
|
<th>Payer_ID</th>
|
||||||
<th>Created at</th>
|
<th>Created at</th>
|
||||||
|
@ -68,6 +71,9 @@
|
||||||
{data: 'type'},
|
{data: 'type'},
|
||||||
{data: 'amount'},
|
{data: 'amount'},
|
||||||
{data: 'price'},
|
{data: 'price'},
|
||||||
|
{data: 'tax_value'},
|
||||||
|
{data: 'tax_percent'},
|
||||||
|
{data: 'total_price'},
|
||||||
{data: 'payment_id'},
|
{data: 'payment_id'},
|
||||||
{data: 'payer_id'},
|
{data: 'payer_id'},
|
||||||
{data: 'created_at'},
|
{data: 'created_at'},
|
||||||
|
|
Loading…
Reference in a new issue