Paypal Order Data Captured

This commit is contained in:
devansh bawari 2021-02-03 12:53:34 +05:30
parent 31cd625644
commit 1de08b17cf
3 changed files with 40 additions and 1 deletions

View File

@ -897,6 +897,10 @@ class Cart
$finalData['items'][] = $this->prepareDataForOrderItem($item);
}
if ($finalData['payment']['method'] === 'paypal_smart_button') {
$finalData['payment']['additional'] = request()->get('data');
}
return $finalData;
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddAdittionalDataToOrderPaymentTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('order_payment', function (Blueprint $table) {
$table->json('additional')->after('order_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('order_payment', function (Blueprint $table) {
$table->dropColumn('additional');
});
}
}

View File

@ -5,7 +5,6 @@ namespace Webkul\Sales\Models;
use Illuminate\Database\Eloquent\Model;
use Webkul\Sales\Contracts\OrderPayment as OrderPaymentContract;
class OrderPayment extends Model implements OrderPaymentContract
{
protected $table = 'order_payment';
@ -15,4 +14,8 @@ class OrderPayment extends Model implements OrderPaymentContract
'created_at',
'updated_at',
];
protected $casts = [
'additional' => 'array'
];
}