-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathpayment.blade.php
More file actions
73 lines (68 loc) · 3.28 KB
/
payment.blade.php
File metadata and controls
73 lines (68 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<div class="bg-white border border-gray-100 rounded-xl">
<div class="flex items-center h-16 px-6 border-b border-gray-100">
<h3 class="text-lg font-medium">
Payment
</h3>
</div>
@if ($currentStep >= $step)
<div class="p-6 space-y-4">
<div class="flex gap-4">
<button @class([
'px-5 py-2 text-sm border font-medium rounded-lg',
'text-green-700 border-green-600 bg-green-50' => $paymentType === 'card',
'text-gray-500 hover:text-gray-700' => $paymentType !== 'card',
])
type="button"
wire:click.prevent="$set('paymentType', 'card')">
Pay by card
</button>
<button @class([
'px-5 py-2 text-sm border font-medium rounded-lg',
'text-green-700 border-green-600 bg-green-50' => $paymentType === 'cash-in-hand',
'text-gray-500 hover:text-gray-700' => $paymentType !== 'cash-in-hand',
])
type="button"
wire:click.prevent="$set('paymentType', 'cash-in-hand')">
Pay with cash
</button>
</div>
@if ($paymentType == 'card')
<livewire:stripe.payment :cart="$cart"
:returnUrl="route('checkout.processing')" />
@endif
@if ($paymentType == 'cash-in-hand')
<form wire:submit="checkout">
<div class="p-4 text-sm text-center text-blue-700 rounded-lg bg-blue-50">
Payment is offline, no card details needed.
</div>
<button class="px-5 py-3 mt-4 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-500"
type="submit"
wire:key="payment_submit_btn">
<span wire:loading.remove.delay
wire:target="checkout">
Submit Order
</span>
<span wire:loading.delay
wire:target="checkout">
<svg class="w-5 h-5 text-white animate-spin"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24">
<circle class="opacity-25"
cx="12"
cy="12"
r="10"
stroke="currentColor"
stroke-width="4"></circle>
<path class="opacity-75"
fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
</path>
</svg>
</span>
</button>
</form>
@endif
</div>
@endif
</div>