Changing the vt to use fetch
This commit is contained in:
@ -393,6 +393,8 @@ func (app *application) VirtualTerminalPaymentSucceeded(w http.ResponseWriter, r
|
||||
ExpiryMonth: txnData.ExpiryMonth,
|
||||
ExpiryYear: txnData.ExpiryYear,
|
||||
BankReturnCode: pi.LatestCharge.ID,
|
||||
PaymentIntent: txnData.PaymentIntent,
|
||||
PaymentMethod: txnData.PaymentMethod,
|
||||
TransactionStatusID: 2,
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ func (app *application) routes() http.Handler {
|
||||
w.Write([]byte("got in"))
|
||||
})
|
||||
|
||||
mux.Post("/virtual-terminal-succedded", app.VirtualTerminalPaymentSucceeded)
|
||||
mux.Post("/virtual-terminal-succeeded", app.VirtualTerminalPaymentSucceeded)
|
||||
})
|
||||
|
||||
return mux
|
||||
|
@ -6,7 +6,7 @@ Virtual Terminal
|
||||
<h2 class="mt-3 text-center">Virtual Terminal</h2>
|
||||
<hr>
|
||||
<div class="alert alert-danger text-center d-none" id="card-messages"></div>
|
||||
<form action="/virtual-terminal-payment-succeeded"
|
||||
<form action=""
|
||||
method="post"
|
||||
name="charge_form"
|
||||
id="charge_form"
|
||||
@ -72,12 +72,26 @@ Virtual Terminal
|
||||
name="payment_currency"
|
||||
value="payment_currency">
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-md-5 offset-md-3 d-none" id="receipt">
|
||||
<h3 class="mt-3 text-center">Receipt</h3>
|
||||
<hr>
|
||||
<p>
|
||||
<strong>Bank Return Code</strong>: <span id="bank-return-code"></span>
|
||||
</p>
|
||||
<p>
|
||||
<a href="/virtual-terminal" class="btn btn-primary">
|
||||
Charge another card
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ define "js" }}
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
<script type="module">
|
||||
import {stripeInit, checkAuth} from "/static/js/common.js";
|
||||
import {val} from "/static/js/stripe.js"
|
||||
import {val} from "/static/js/terminal.js"
|
||||
|
||||
checkAuth({{.API}});
|
||||
stripeInit('{{.StripePubKey}}');
|
||||
|
Reference in New Issue
Block a user