PaymentController.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Events\UserUpdateCreditsEvent;
  4. use App\Http\Controllers\Controller;
  5. use App\Models\PartnerDiscount;
  6. use App\Models\Payment;
  7. use App\Models\User;
  8. use App\Models\ShopProduct;
  9. use App\Notifications\ConfirmPaymentNotification;
  10. use Exception;
  11. use Illuminate\Contracts\Foundation\Application;
  12. use Illuminate\Contracts\View\Factory;
  13. use Illuminate\Contracts\View\View;
  14. use Illuminate\Http\JsonResponse;
  15. use Illuminate\Http\RedirectResponse;
  16. use Illuminate\Http\Request;
  17. use Illuminate\Support\Facades\Auth;
  18. use Illuminate\Support\Facades\DB;
  19. use PayPalCheckoutSdk\Core\PayPalHttpClient;
  20. use PayPalCheckoutSdk\Core\ProductionEnvironment;
  21. use PayPalCheckoutSdk\Core\SandboxEnvironment;
  22. use PayPalHttp\HttpException;
  23. use Stripe\Stripe;
  24. use App\Helpers\ExtensionHelper;
  25. class PaymentController extends Controller
  26. {
  27. /**
  28. * @return Application|Factory|View
  29. */
  30. public function index()
  31. {
  32. return view('admin.payments.index')->with([
  33. 'payments' => Payment::paginate(15),
  34. ]);
  35. }
  36. /**
  37. * @param Request $request
  38. * @param ShopProduct $shopProduct
  39. * @return Application|Factory|View
  40. */
  41. public function checkOut(ShopProduct $shopProduct)
  42. {
  43. // get all payment gateway extensions
  44. $extensions = glob(app_path() . '/Extensions/PaymentGateways/*', GLOB_ONLYDIR);
  45. // build a paymentgateways array that contains the routes for the payment gateways and the image path for the payment gateway which lays in public/images/Extensions/PaymentGateways with the extensionname in lowercase
  46. $paymentGateways = [];
  47. foreach ($extensions as $extension) {
  48. $extensionName = basename($extension);
  49. $config = ExtensionHelper::getExtensionConfig($extensionName, 'PaymentGateways');
  50. if ($config) {
  51. $payment = new \stdClass();
  52. $payment->name = $config['name'];
  53. $payment->image = asset('images/Extensions/PaymentGateways/' . strtolower($extensionName) . '_logo.png');
  54. $paymentGateways[] = $payment;
  55. }
  56. }
  57. return view('store.checkout')->with([
  58. 'product' => $shopProduct,
  59. 'discountpercent' => PartnerDiscount::getDiscount(),
  60. 'discountvalue' => PartnerDiscount::getDiscount() * $shopProduct->price / 100,
  61. 'discountedprice' => $shopProduct->getPriceAfterDiscount(),
  62. 'taxvalue' => $shopProduct->getTaxValue(),
  63. 'taxpercent' => $shopProduct->getTaxPercent(),
  64. 'total' => $shopProduct->getTotalPrice(),
  65. 'paymentGateways' => $paymentGateways,
  66. ]);
  67. }
  68. /**
  69. * @param Request $request
  70. * @param ShopProduct $shopProduct
  71. * @return RedirectResponse
  72. */
  73. public function FreePay(ShopProduct $shopProduct)
  74. {
  75. //dd($shopProduct);
  76. //check if the product is really free or the discount is 100%
  77. if($shopProduct->getTotalPrice()>0) return redirect()->route('home')->with('error', __('An error ocured. Please try again.'));
  78. //give product
  79. /** @var User $user */
  80. $user = Auth::user();
  81. //not updating server limit
  82. //update User with bought item
  83. if ($shopProduct->type=="Credits") {
  84. $user->increment('credits', $shopProduct->quantity);
  85. }elseif ($shopProduct->type=="Server slots"){
  86. $user->increment('server_limit', $shopProduct->quantity);
  87. }
  88. //skipped the referral commission, because the user did not pay anything.
  89. //not giving client role
  90. //store payment
  91. $payment = Payment::create([
  92. 'user_id' => $user->id,
  93. 'payment_id' => uniqid(),
  94. 'payment_method' => 'free',
  95. 'type' => $shopProduct->type,
  96. 'status' => 'paid',
  97. 'amount' => $shopProduct->quantity,
  98. 'price' => $shopProduct->price - ($shopProduct->price*PartnerDiscount::getDiscount()/100),
  99. 'tax_value' => $shopProduct->getTaxValue(),
  100. 'tax_percent' => $shopProduct->getTaxPercent(),
  101. 'total_price' => $shopProduct->getTotalPrice(),
  102. 'currency_code' => $shopProduct->currency_code,
  103. 'shop_item_product_id' => $shopProduct->id,
  104. ]);
  105. event(new UserUpdateCreditsEvent($user));
  106. //not sending an invoice
  107. //redirect back to home
  108. return redirect()->route('home')->with('success', __('Your credit balance has been increased!'));
  109. }
  110. /**
  111. * @return PayPalHttpClient
  112. */
  113. protected function getPayPalClient()
  114. {
  115. $environment = env('APP_ENV') == 'local'
  116. ? new SandboxEnvironment($this->getPaypalClientId(), $this->getPaypalClientSecret())
  117. : new ProductionEnvironment($this->getPaypalClientId(), $this->getPaypalClientSecret());
  118. return new PayPalHttpClient($environment);
  119. }
  120. /**
  121. * @return string
  122. */
  123. protected function getPaypalClientId()
  124. {
  125. return env('APP_ENV') == 'local' ? config('SETTINGS::PAYMENTS:PAYPAL:SANDBOX_CLIENT_ID') : config('SETTINGS::PAYMENTS:PAYPAL:CLIENT_ID');
  126. }
  127. /**
  128. * @return string
  129. */
  130. protected function getPaypalClientSecret()
  131. {
  132. return env('APP_ENV') == 'local' ? config('SETTINGS::PAYMENTS:PAYPAL:SANDBOX_SECRET') : config('SETTINGS::PAYMENTS:PAYPAL:SECRET');
  133. }
  134. public function pay(Request $request)
  135. {
  136. $product = ShopProduct::find($request->product_id);
  137. $paymentGateway = $request->payment_method;
  138. return redirect()->route('payment.' . $paymentGateway . 'Pay', ['shopProduct' => $product->id]);
  139. }
  140. /**
  141. * @param Request $request
  142. */
  143. public function Cancel(Request $request)
  144. {
  145. return redirect()->route('store.index')->with('success', 'Payment was Canceled');
  146. }
  147. /**
  148. * @param Request $request
  149. * @param ShopProduct $shopProduct
  150. * @return RedirectResponse
  151. */
  152. public function StripePay(Request $request, ShopProduct $shopProduct)
  153. {
  154. if(!$this->checkAmount($shopProduct->getTotalPrice(), strtoupper($shopProduct->currency_code), "stripe")) return redirect()->route('home')->with('error', __('The product you chose can´t be purchased with this payment method. The total amount is too small. Please buy a bigger amount or try a different payment method.'));
  155. $stripeClient = $this->getStripeClient();
  156. $request = $stripeClient->checkout->sessions->create([
  157. 'line_items' => [
  158. [
  159. 'price_data' => [
  160. 'currency' => $shopProduct->currency_code,
  161. 'product_data' => [
  162. 'name' => $shopProduct->display.(PartnerDiscount::getDiscount() ? (' ('.__('Discount').' '.PartnerDiscount::getDiscount().'%)') : ''),
  163. 'description' => $shopProduct->description,
  164. ],
  165. 'unit_amount_decimal' => round($shopProduct->getPriceAfterDiscount() * 100, 2),
  166. ],
  167. 'quantity' => 1,
  168. ],
  169. [
  170. 'price_data' => [
  171. 'currency' => $shopProduct->currency_code,
  172. 'product_data' => [
  173. 'name' => __('Tax'),
  174. 'description' => $shopProduct->getTaxPercent().'%',
  175. ],
  176. 'unit_amount_decimal' => round($shopProduct->getTaxValue(), 2) * 100,
  177. ],
  178. 'quantity' => 1,
  179. ],
  180. ],
  181. 'mode' => 'payment',
  182. 'payment_method_types' => str_getcsv(config('SETTINGS::PAYMENTS:STRIPE:METHODS')),
  183. 'success_url' => route('payment.StripeSuccess', ['product' => $shopProduct->id]).'&session_id={CHECKOUT_SESSION_ID}',
  184. 'cancel_url' => route('payment.Cancel'),
  185. ]);
  186. return redirect($request->url, 303);
  187. }
  188. /**
  189. * @param Request $request
  190. */
  191. public function StripeSuccess(Request $request)
  192. {
  193. /** @var ShopProduct $shopProduct */
  194. $shopProduct = ShopProduct::findOrFail($request->input('product'));
  195. /** @var User $user */
  196. $user = Auth::user();
  197. $stripeClient = $this->getStripeClient();
  198. try {
  199. //get stripe data
  200. $paymentSession = $stripeClient->checkout->sessions->retrieve($request->input('session_id'));
  201. $paymentIntent = $stripeClient->paymentIntents->retrieve($paymentSession->payment_intent);
  202. //get DB entry of this payment ID if existing
  203. $paymentDbEntry = Payment::where('payment_id', $paymentSession->payment_intent)->count();
  204. // check if payment is 100% completed and payment does not exist in db already
  205. if ($paymentSession->status == 'complete' && $paymentIntent->status == 'succeeded' && $paymentDbEntry == 0) {
  206. //update server limit
  207. if (config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
  208. if ($user->server_limit < config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')) {
  209. $user->update(['server_limit' => config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
  210. }
  211. }
  212. //update User with bought item
  213. if ($shopProduct->type == 'Credits') {
  214. $user->increment('credits', $shopProduct->quantity);
  215. } elseif ($shopProduct->type == 'Server slots') {
  216. $user->increment('server_limit', $shopProduct->quantity);
  217. }
  218. //update role give Referral-reward
  219. if ($user->role == 'member') {
  220. $user->update(['role' => 'client']);
  221. if ((config('SETTINGS::REFERRAL:MODE') == 'commission' || config('SETTINGS::REFERRAL:MODE') == 'both') && $shopProduct->type == 'Credits') {
  222. if ($ref_user = DB::table('user_referrals')->where('registered_user_id', '=', $user->id)->first()) {
  223. $ref_user = User::findOrFail($ref_user->referral_id);
  224. $increment = number_format($shopProduct->quantity / 100 * config('SETTINGS::REFERRAL:PERCENTAGE'), 0, '', '');
  225. $ref_user->increment('credits', $increment);
  226. //LOGS REFERRALS IN THE ACTIVITY LOG
  227. activity()
  228. ->performedOn($user)
  229. ->causedBy($ref_user)
  230. ->log('gained '.$increment.' '.config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME').' for commission-referral of '.$user->name.' (ID:'.$user->id.')');
  231. }
  232. }
  233. }
  234. //store paid payment
  235. $payment = Payment::create([
  236. 'user_id' => $user->id,
  237. 'payment_id' => $paymentSession->payment_intent,
  238. 'payment_method' => 'stripe',
  239. 'type' => $shopProduct->type,
  240. 'status' => 'paid',
  241. 'amount' => $shopProduct->quantity,
  242. 'price' => $shopProduct->price - ($shopProduct->price * PartnerDiscount::getDiscount() / 100),
  243. 'tax_value' => $shopProduct->getTaxValue(),
  244. 'total_price' => $shopProduct->getTotalPrice(),
  245. 'tax_percent' => $shopProduct->getTaxPercent(),
  246. 'currency_code' => $shopProduct->currency_code,
  247. 'shop_item_product_id' => $shopProduct->id,
  248. ]);
  249. //payment notification
  250. $user->notify(new ConfirmPaymentNotification($payment));
  251. event(new UserUpdateCreditsEvent($user));
  252. //only create invoice if SETTINGS::INVOICE:ENABLED is true
  253. if (config('SETTINGS::INVOICE:ENABLED') == 'true') {
  254. $this->createInvoice($user, $payment, 'paid', $shopProduct->currency_code);
  255. }
  256. //redirect back to home
  257. return redirect()->route('home')->with('success', __('Your credit balance has been increased!'));
  258. } else {
  259. if ($paymentIntent->status == 'processing') {
  260. //store processing payment
  261. $payment = Payment::create([
  262. 'user_id' => $user->id,
  263. 'payment_id' => $paymentSession->payment_intent,
  264. 'payment_method' => 'stripe',
  265. 'type' => $shopProduct->type,
  266. 'status' => 'processing',
  267. 'amount' => $shopProduct->quantity,
  268. 'price' => $shopProduct->price,
  269. 'tax_value' => $shopProduct->getTaxValue(),
  270. 'total_price' => $shopProduct->getTotalPrice(),
  271. 'tax_percent' => $shopProduct->getTaxPercent(),
  272. 'currency_code' => $shopProduct->currency_code,
  273. 'shop_item_product_id' => $shopProduct->id,
  274. ]);
  275. //only create invoice if SETTINGS::INVOICE:ENABLED is true
  276. if (config('SETTINGS::INVOICE:ENABLED') == 'true') {
  277. $this->createInvoice($user, $payment, 'paid', $shopProduct->currency_code);
  278. }
  279. //redirect back to home
  280. return redirect()->route('home')->with('success', __('Your payment is being processed!'));
  281. }
  282. if ($paymentDbEntry == 0 && $paymentIntent->status != 'processing') {
  283. $stripeClient->paymentIntents->cancel($paymentIntent->id);
  284. //redirect back to home
  285. return redirect()->route('home')->with('success', __('Your payment has been canceled!'));
  286. } else {
  287. abort(402);
  288. }
  289. }
  290. } catch (HttpException $ex) {
  291. if (env('APP_ENV') == 'local') {
  292. echo $ex->statusCode;
  293. dd($ex->getMessage());
  294. } else {
  295. abort(422);
  296. }
  297. }
  298. }
  299. /**
  300. * @param Request $request
  301. */
  302. protected function handleStripePaymentSuccessHook($paymentIntent)
  303. {
  304. try {
  305. // Get payment db entry
  306. $payment = Payment::where('payment_id', $paymentIntent->id)->first();
  307. $user = User::where('id', $payment->user_id)->first();
  308. if ($paymentIntent->status == 'succeeded' && $payment->status == 'processing') {
  309. //update server limit
  310. if (config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
  311. if ($user->server_limit < config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')) {
  312. $user->update(['server_limit' => config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
  313. }
  314. }
  315. //update User with bought item
  316. if ($shopProduct->type == 'Credits') {
  317. $user->increment('credits', $shopProduct->quantity);
  318. } elseif ($shopProduct->type == 'Server slots') {
  319. $user->increment('server_limit', $shopProduct->quantity);
  320. }
  321. //update role give Referral-reward
  322. if ($user->role == 'member') {
  323. $user->update(['role' => 'client']);
  324. if ((config('SETTINGS::REFERRAL:MODE') == 'commission' || config('SETTINGS::REFERRAL:MODE') == 'both') && $shopProduct->type == 'Credits') {
  325. if ($ref_user = DB::table('user_referrals')->where('registered_user_id', '=', $user->id)->first()) {
  326. $ref_user = User::findOrFail($ref_user->referral_id);
  327. $increment = number_format($shopProduct->quantity / 100 * config('SETTINGS::REFERRAL:PERCENTAGE'), 0, '', '');
  328. $ref_user->increment('credits', $increment);
  329. //LOGS REFERRALS IN THE ACTIVITY LOG
  330. activity()
  331. ->performedOn($user)
  332. ->causedBy($ref_user)
  333. ->log('gained '.$increment.' '.config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME').' for commission-referral of '.$user->name.' (ID:'.$user->id.')');
  334. }
  335. }
  336. }
  337. //update payment db entry status
  338. $payment->update(['status' => 'paid']);
  339. //payment notification
  340. $user->notify(new ConfirmPaymentNotification($payment));
  341. event(new UserUpdateCreditsEvent($user));
  342. //only create invoice if SETTINGS::INVOICE:ENABLED is true
  343. if (config('SETTINGS::INVOICE:ENABLED') == 'true') {
  344. $this->createInvoice($user, $payment, 'paid', strtoupper($paymentIntent->currency));
  345. }
  346. }
  347. } catch (HttpException $ex) {
  348. abort(422);
  349. }
  350. }
  351. /**
  352. * @param Request $request
  353. */
  354. public function StripeWebhooks(Request $request)
  355. {
  356. \Stripe\Stripe::setApiKey($this->getStripeSecret());
  357. try {
  358. $payload = @file_get_contents('php://input');
  359. $sig_header = $request->header('Stripe-Signature');
  360. $event = null;
  361. $event = \Stripe\Webhook::constructEvent(
  362. $payload,
  363. $sig_header,
  364. $this->getStripeEndpointSecret()
  365. );
  366. } catch (\UnexpectedValueException $e) {
  367. // Invalid payload
  368. abort(400);
  369. } catch (\Stripe\Exception\SignatureVerificationException $e) {
  370. // Invalid signature
  371. abort(400);
  372. }
  373. // Handle the event
  374. switch ($event->type) {
  375. case 'payment_intent.succeeded':
  376. $paymentIntent = $event->data->object; // contains a \Stripe\PaymentIntent
  377. $this->handleStripePaymentSuccessHook($paymentIntent);
  378. break;
  379. default:
  380. echo 'Received unknown event type '.$event->type;
  381. }
  382. }
  383. /**
  384. * @return \Stripe\StripeClient
  385. */
  386. protected function getStripeClient()
  387. {
  388. return new \Stripe\StripeClient($this->getStripeSecret());
  389. }
  390. /**
  391. * @return string
  392. */
  393. protected function getStripeSecret()
  394. {
  395. return env('APP_ENV') == 'local'
  396. ? config('SETTINGS::PAYMENTS:STRIPE:TEST_SECRET')
  397. : config('SETTINGS::PAYMENTS:STRIPE:SECRET');
  398. }
  399. /**
  400. * @return string
  401. */
  402. protected function getStripeEndpointSecret()
  403. {
  404. return env('APP_ENV') == 'local'
  405. ? config('SETTINGS::PAYMENTS:STRIPE:ENDPOINT_TEST_SECRET')
  406. : config('SETTINGS::PAYMENTS:STRIPE:ENDPOINT_SECRET');
  407. }
  408. public function checkAmount($amount, $currencyCode, $payment_method)
  409. {
  410. $minimums = [
  411. "USD" => [
  412. "paypal" => 0,
  413. "stripe" => 0.5
  414. ],
  415. "AED" => [
  416. "paypal" => 0,
  417. "stripe" => 2
  418. ],
  419. "AUD" => [
  420. "paypal" => 0,
  421. "stripe" => 0.5
  422. ],
  423. "BGN" => [
  424. "paypal" => 0,
  425. "stripe" => 1
  426. ],
  427. "BRL" => [
  428. "paypal" => 0,
  429. "stripe" => 0.5
  430. ],
  431. "CAD" => [
  432. "paypal" => 0,
  433. "stripe" => 0.5
  434. ],
  435. "CHF" => [
  436. "paypal" => 0,
  437. "stripe" => 0.5
  438. ],
  439. "CZK" => [
  440. "paypal" => 0,
  441. "stripe" => 15
  442. ],
  443. "DKK" => [
  444. "paypal" => 0,
  445. "stripe" => 2.5
  446. ],
  447. "EUR" => [
  448. "paypal" => 0,
  449. "stripe" => 0.5
  450. ],
  451. "GBP" => [
  452. "paypal" => 0,
  453. "stripe" => 0.3
  454. ],
  455. "HKD" => [
  456. "paypal" => 0,
  457. "stripe" => 4
  458. ],
  459. "HRK" => [
  460. "paypal" => 0,
  461. "stripe" => 0.5
  462. ],
  463. "HUF" => [
  464. "paypal" => 0,
  465. "stripe" => 175
  466. ],
  467. "INR" => [
  468. "paypal" => 0,
  469. "stripe" => 0.5
  470. ],
  471. "JPY" => [
  472. "paypal" => 0,
  473. "stripe" => 0.5
  474. ],
  475. "MXN" => [
  476. "paypal" => 0,
  477. "stripe" => 10
  478. ],
  479. "MYR" => [
  480. "paypal" => 0,
  481. "stripe" => 2
  482. ],
  483. "NOK" => [
  484. "paypal" => 0,
  485. "stripe" => 3
  486. ],
  487. "NZD" => [
  488. "paypal" => 0,
  489. "stripe" => 0.5
  490. ],
  491. "PLN" => [
  492. "paypal" => 0,
  493. "stripe" => 2
  494. ],
  495. "RON" => [
  496. "paypal" => 0,
  497. "stripe" => 2
  498. ],
  499. "SEK" => [
  500. "paypal" => 0,
  501. "stripe" => 3
  502. ],
  503. "SGD" => [
  504. "paypal" => 0,
  505. "stripe" => 0.5
  506. ],
  507. "THB" => [
  508. "paypal" => 0,
  509. "stripe" => 10
  510. ]
  511. ];
  512. return $amount >= $minimums[$currencyCode][$payment_method];
  513. }
  514. /**
  515. * @return JsonResponse|mixed
  516. *
  517. * @throws Exception
  518. */
  519. public function dataTable()
  520. {
  521. $query = Payment::with('user');
  522. return datatables($query)
  523. ->addColumn('user', function (Payment $payment) {
  524. return
  525. ($payment->user)?'<a href="'.route('admin.users.show', $payment->user->id).'">'.$payment->user->name.'</a>':__('Unknown user');
  526. })
  527. ->editColumn('price', function (Payment $payment) {
  528. return $payment->formatToCurrency($payment->price);
  529. })
  530. ->editColumn('tax_value', function (Payment $payment) {
  531. return $payment->formatToCurrency($payment->tax_value);
  532. })
  533. ->editColumn('tax_percent', function (Payment $payment) {
  534. return $payment->tax_percent.' %';
  535. })
  536. ->editColumn('total_price', function (Payment $payment) {
  537. return $payment->formatToCurrency($payment->total_price);
  538. })
  539. ->editColumn('created_at', function (Payment $payment) {
  540. return ['display' => $payment->created_at ? $payment->created_at->diffForHumans() : '',
  541. 'raw' => $payment->created_at ? strtotime($payment->created_at) : ''];
  542. })
  543. ->addColumn('actions', function (Payment $payment) {
  544. return '<a data-content="'.__('Download').'" data-toggle="popover" data-trigger="hover" data-placement="top" href="'.route('admin.invoices.downloadSingleInvoice', 'id='.$payment->payment_id).'" class="btn btn-sm text-white btn-info mr-1"><i class="fas fa-file-download"></i></a>';
  545. })
  546. ->rawColumns(['actions', 'user'])
  547. ->make(true);
  548. }
  549. }