diff --git a/app/Http/Controllers/paypal/PaypalController.php b/app/Http/Controllers/paypal/PaypalController.php
index b322702..3d5685c 100755
--- a/app/Http/Controllers/paypal/PaypalController.php
+++ b/app/Http/Controllers/paypal/PaypalController.php
@@ -30,7 +30,7 @@ class PaypalController extends Controller
public function __construct()
{
- $paypal_env = "live";
+ $paypal_env = "sandbox";
$paypal_apiUrl = 'https://api.paypal.com'; // default
if ($paypal_env == 'live') {
@@ -240,7 +240,7 @@ class PaypalController extends Controller
$transaction->setInvoiceNumber(date('Ymd') . '-' . $invoice_num);
$redirectUrls = PayPal::RedirectUrls();
- $redirectUrls->setReturnUrl(route('getDone'));
+ $redirectUrls->setReturnUrl(route('thank-you-for-your-purchase'));
$redirectUrls->setCancelUrl(route('getCancel'));
// var_dump($shippingAddress)
@@ -290,7 +290,7 @@ class PaypalController extends Controller
$m = new TeamStoreModel;
$UserModel = new UserModel;
$userId = 0;
-
+
if (!Auth::guest()) {
$userId = Auth::user()->id;
}
@@ -337,7 +337,7 @@ class PaypalController extends Controller
}
// var_dump($item->ShippingCostId);
if ($item->ShippingCostId == 1) {
-
+
$getSmallItemQty += $item->Quantity;
} else if ($item->ShippingCostId == 2) {
$getBulkyItemQty += $item->Quantity;
@@ -359,15 +359,15 @@ class PaypalController extends Controller
// $getSmallItemQty = ceil($getSmallItemQty / 3) * 8.99;
- if($getSmallItemQty >= 1) {
- if($getSmallItemQty >= 2) {
+ if ($getSmallItemQty >= 1) {
+ if ($getSmallItemQty >= 2) {
$getSmallItemQty = ceil(($getSmallItemQty - 1) / 1) * 2.49;
$getSmallItemQty = $getSmallItemQty + 8.99;
- }else {
+ } else {
$getSmallItemQty = 8.99;
}
}
-
+
$getBulkyItemQty = ceil($getBulkyItemQty / 1) * 8;
$getMaskItemQty = ceil($getMaskItemQty / 25) * 8;
@@ -378,10 +378,10 @@ class PaypalController extends Controller
$shippingFee = $CAShippingfee;
}
- if($getSubtotal[0]->Subtotal >= 99 && $countryCode != "CA") {
+ if ($getSubtotal[0]->Subtotal >= 99 && $countryCode != "CA") {
return $shippingFee = 0;
}
-
+
return $shippingFee;
}
@@ -426,7 +426,7 @@ class PaypalController extends Controller
$checkCartKey = $paypal_model->checkCartKey($cartKey);
- if(count($checkCartKey) > 0) {
+ if (count($checkCartKey) > 0) {
$message = 'You already paid for this order. Please check your Order Page. click here .';
Session::put('cartkeyError', $message);
return Redirect::route('cart');
@@ -600,10 +600,10 @@ class PaypalController extends Controller
$request->session()->forget('cartkey'); // clear session for cartkey
// redirect to thank you page.
- return view('paypal.get_done')
+ return view('paypal.payment_success')
->with('currency', $currency)
->with('total', $total);
- }else {
+ } else {
Session::put('cartkeyError', 'Something went wrong. Please try again.');
return Redirect::route('cart');
}
@@ -632,6 +632,11 @@ class PaypalController extends Controller
// var_dump($obj->transactions[0]->item_list->shipping_address);
}
+ public function thankyou()
+ {
+ return view('paypal.payment_success');
+ }
+
public function getCancel(Request $request)
{
@@ -641,7 +646,7 @@ class PaypalController extends Controller
$items = $m->myCart($cartKey);
$getSubtotal = $m->getSubtotal($cartKey);
- if($items == null) {
+ if ($items == null) {
return redirect()->route('cart');
}
diff --git a/app/Http/routes.php b/app/Http/routes.php
index 79c3683..5d1a5d9 100755
--- a/app/Http/routes.php
+++ b/app/Http/routes.php
@@ -156,11 +156,14 @@ Route::group(['middleware' => 'auth'], function () {
Route::get('payPremium', ['as' => 'payPremium', 'uses' => 'paypal\PaypalController@payPremium']);
Route::get('getCheckout', ['as' => 'getCheckout', 'uses' => 'paypal\PaypalController@getCheckout']);
- Route::get('getDone', ['as' => 'getDone', 'uses' => 'paypal\PaypalController@getDone']);
+ // Route::get('getDone', ['as' => 'getDone', 'uses' => 'paypal\PaypalController@getDone']);
+ Route::get('thank-you-for-your-purchase', ['as' => 'thank-you-for-your-purchase', 'uses' => 'paypal\PaypalController@getDone']);
Route::get('getCancel', ['as' => 'getCancel', 'uses' => 'paypal\PaypalController@getCancel']);
Route::get('getDoneTest', ['as' => 'getDoneTest', 'uses' => 'paypal\PaypalController@getDoneTest']);
+
// END PAYPAL ROUTES
});
+ // Route::get('thank-you-for-your-purchase', 'paypal\PaypalController@thankyou');
Route::group(['middleware' => 'admin'], function () {
Route::get('admin', function () {
diff --git a/resources/views/merchbay/index.blade.php b/resources/views/merchbay/index.blade.php
index ed012e5..129e7fc 100755
--- a/resources/views/merchbay/index.blade.php
+++ b/resources/views/merchbay/index.blade.php
@@ -1,162 +1,131 @@
@extends('merchbay_main')
@section('main-content')
-
-
-
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
-

-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- Calling all Creators
-
-
- Sign in on Merchbay and share your creativity and expand
-
your ideas. Click below button to know more.
-
+
+
+
+
+
+
+ Calling all Creators
+
+
+ Sign in on Merchbay and share your creativity and expand
+
your ideas. Click below button to know more.
+
-
+
+
+
-
-
-@endsection
\ No newline at end of file
+@endsection
diff --git a/resources/views/paypal/get_done.blade.php b/resources/views/paypal/get_done.blade.php
index 3988105..240c377 100755
--- a/resources/views/paypal/get_done.blade.php
+++ b/resources/views/paypal/get_done.blade.php
@@ -1,95 +1,98 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
CREW Sportswear
+
+
CREW Sportswear
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+