added api for tracking

This commit is contained in:
Frank John Begornia
2020-11-27 02:43:26 +08:00
parent 36ad67a37a
commit d2a20c4831
12 changed files with 213 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ use Illuminate\Http\Request;
use Netshell\Paypal\Facades\Paypal;
use App\Models\teamstore\TeamStoreModel;
use App\Models\user\UserModel;
use App\Models\ApiModel;
use App\Models\paypal\PayPalModel;
// use Auth;
use Illuminate\Support\Facades\Auth;
@@ -19,7 +20,6 @@ use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Mail;
class PaypalController extends Controller
{
@@ -74,8 +74,6 @@ class PaypalController extends Controller
$payer = PayPal::Payer();
$payer->setPaymentMethod('paypal');
$m = new TeamStoreModel;
$paypal_model = new PayPalModel;
$last_id = $paypal_model->getLastIdPaymentDetails();
@@ -382,6 +380,17 @@ class PaypalController extends Controller
});
// end email sending
$insertTracking = array(
"StepId" => 1,
"ScannedBy" => 1,
"InvoiceNumber" => $invoice_number,
"created_at" => date('Y-m-d H:i:s')
);
$ApiModel = new ApiModel;
$ApiModel->insertTracking($insertTracking);
$request->session()->forget('cartkey'); // clear session for cartkey
// redirect to thank you page.