Saving more details, redirecting and simplifying the succeed handler

This commit is contained in:
2024-08-11 12:01:05 +02:00
parent 8e482aa712
commit 5ad4464b28
10 changed files with 124 additions and 49 deletions

View File

@ -0,0 +1,8 @@
{{ template "base" . }}
{{ define "title" }}
Widget
{{ end }}
{{ define "content" }}
<h2 class="mt-5">Widget</h2>
{{ end }}

View File

@ -0,0 +1,18 @@
{{ template "base" . }}
{{ define "title" }}
Payment Succedded!
{{ end }}
{{ define "content" }}
{{$txn := index .Data "txn"}}
<h2 class="mt-5">Payment Succeeded</h2>
<hr>
<p>Payment Intent: {{$txn.PaymentIntentID}}</p>
<p>Customer Name: {{ $txn.FirstName }} {{ $txn.LastName }}</p>
<p>Email: {{ $txn.Email }}</p>
<p>Payment Method: {{ $txn.PaymentMethodID }}</p>
<p>Payment Amount: {{ $txn.PaymentAmount }}</p>
<p>Currency: {{ $txn.PaymentCurrency }}</p>
<p>Last Four: {{ $txn.LastFour }}</p>
<p>Bank Return Code: {{ $txn.BankReturnCode }}</p>
<p>Expiry Date: {{ $txn.ExpiryMonth }}/{{$txn.ExpiryYear}}</p>
{{ end }}

View File

@ -1,17 +0,0 @@
{{ template "base" . }}
{{ define "title" }}
Payment Succedded!
{{ end }}
{{ define "content" }}
<h2 class="mt-5">Payment Succeeded</h2>
<hr>
<p>Payment Intent: {{ index .Data "pi" }}</p>
<p>Customer Name: {{ index .Data "first_name" }} {{ index .Data "last_name" }}</p>
<p>Email: {{ index .Data "email" }}</p>
<p>Payment Method: {{ index .Data "pm" }}</p>
<p>Payment Amount: {{ index .Data "pa" }}</p>
<p>Currency: {{ index .Data "pc" }}</p>
<p>Last Four: {{ index .Data "last_four" }}</p>
<p>Bank Return Code: {{ index .Data "bank_return_code" }}</p>
<p>Expiry Date: {{ index .Data "expiry_month" }}/{{index .Data "expiry_year"}}</p>
{{ end }}