Skip to content

Commit e1b32c9

Browse files
committed
Checkout pay with card button
1 parent 4ee60ae commit e1b32c9

File tree

3 files changed

+19
-35
lines changed

3 files changed

+19
-35
lines changed

app/Http/Controllers/ProductsController.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -50,38 +50,4 @@ public function show($id)
5050
{
5151
//
5252
}
53-
54-
/**
55-
* Show the form for editing the specified resource.
56-
*
57-
* @param int $id
58-
* @return \Illuminate\Http\Response
59-
*/
60-
public function edit($id)
61-
{
62-
//
63-
}
64-
65-
/**
66-
* Update the specified resource in storage.
67-
*
68-
* @param \Illuminate\Http\Request $request
69-
* @param int $id
70-
* @return \Illuminate\Http\Response
71-
*/
72-
public function update(Request $request, $id)
73-
{
74-
//
75-
}
76-
77-
/**
78-
* Remove the specified resource from storage.
79-
*
80-
* @param int $id
81-
* @return \Illuminate\Http\Response
82-
*/
83-
public function destroy($id)
84-
{
85-
//
86-
}
8753
}

resources/views/cart/index.blade.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,25 @@
3434
@endforeach
3535
</div>
3636
<div class="panel-footer">
37+
<div class="row text-center">
38+
<div class="col-md-9">
39+
<h4 class="text-right">Total <strong>$ {{ $cart->totalPrice() }}</strong></h4>
40+
</div>
41+
<div class="col-md-3">
42+
<form action="/orders" method="post">
43+
{{csrf_field()}}
44+
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
45+
data-key="{!! config('services.stripe.key') !!}"
46+
data-amount="{{ $cart->totalPrice() }}"
47+
data-name="{{ config('app.name') }}"
48+
data-description="Test purchase"
49+
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
50+
>
3751
52+
</script>
53+
</form>
54+
</div>
55+
</div>
3856
</div>
3957
</div>
4058
</div>

resources/views/layouts/app.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<title>{{ config('app.name', 'Laravel') }}</title>
1111

1212
<!-- Scripts -->
13-
<script src="{{ asset('js/app.js') }}" defer></script>
13+
{{--<script src="{{ asset('js/app.js') }}" defer></script>--}}
1414

1515
<!-- Fonts -->
1616
<link rel="dns-prefetch" href="//fonts.gstatic.com">

0 commit comments

Comments
 (0)