mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-09 12:16:50 +00:00
Introduce Stripe integration for automatic payment ingestion and refund tracking. Adds new fields to the payment model for Stripe IDs and status, Stripe client driver, sync service, cron job, manual API endpoint, and public webhook handler for real-time updates. Includes tests and documentation. Manual cash entry remains supported.
66 lines
1.4 KiB
Text
66 lines
1.4 KiB
Text
package view
|
|
|
|
templ PaymentLine(payment *PaymentViewModel) {
|
|
<tr class="hover">
|
|
<td></td>
|
|
<td></td>
|
|
<td>- { payment.Amount }</td>
|
|
<td>
|
|
{ payment.PaymentMethod }
|
|
if payment.StripeStatus != "" {
|
|
<span class="badge badge-outline badge-sm ml-2">{ payment.StripeStatus }</span>
|
|
}
|
|
</td>
|
|
<td></td>
|
|
<td class="flex gap-2">
|
|
<button
|
|
class="btn btn-sm btn-outline"
|
|
hx-get={ payment.PaymentUrl }
|
|
hx-target="closest tr"
|
|
hx-swap="outerHTML"
|
|
>Edit</button>
|
|
</td>
|
|
</tr>
|
|
}
|
|
|
|
templ PaymentForm(payment *PaymentViewModel) {
|
|
<tr class="hover">
|
|
<form hx-put={ payment.PaymentUrl } id="edit-payment" hx-target="closest tr" hx-swap="outerHTML">
|
|
<td></td>
|
|
<td></td>
|
|
<td>
|
|
<input
|
|
class="input input-bordered input-sm w-full"
|
|
type="number"
|
|
inputmode="decimal"
|
|
step="0.01"
|
|
value={ payment.Amount }
|
|
name="amount"
|
|
form="edit-payment"
|
|
/>
|
|
</td>
|
|
<td>
|
|
<input
|
|
class="input input-bordered input-sm w-full"
|
|
value={ payment.PaymentMethod }
|
|
name="paymentMethod"
|
|
form="edit-payment"
|
|
/>
|
|
</td>
|
|
<td></td>
|
|
<td>
|
|
<button class="btn btn-sm btn-primary" type="submit" form="edit-payment">Save</button>
|
|
</td>
|
|
</form>
|
|
</tr>
|
|
}
|
|
|
|
templ PaymentList(payments []*PaymentViewModel) {
|
|
<tbody id="payment-lines">
|
|
if len(payments) >0 {
|
|
for _,payment := range payments {
|
|
@PaymentLine(payment)
|
|
}
|
|
}
|
|
</tbody>
|
|
}
|