add amount parameter

This commit is contained in:
Michael Stapelberg
2020-07-09 18:24:02 +02:00
parent b3e76141a8
commit d606b9f795
2 changed files with 11 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ func qrchFromRequest(r *http.Request) *qrbill.QRCH {
}, },
}, },
CcyAmt: qrbill.QRCHCcyAmt{ CcyAmt: qrbill.QRCHCcyAmt{
Amt: "", Amt: ifEmpty(r.Form, "amount", ""),
Ccy: "CHF", Ccy: "CHF",
}, },
UltmtDbtr: qrbill.Address{ UltmtDbtr: qrbill.Address{

View File

@@ -125,6 +125,12 @@ th { text-align: left; }
<td>{{ .Udcountry }}</td> <td>{{ .Udcountry }}</td>
</tr> </tr>
<tr>
<td>&amount=</td>
<td>{{ .Amount }}</td>
</tr>
<tr> <tr>
<td>&message=</td> <td>&message=</td>
<td>{{ .Message }}</td> <td>{{ .Message }}</td>
@@ -156,6 +162,8 @@ func debugHTML(w http.ResponseWriter, r *http.Request, prefix string, qrch *qrbi
Udcountry string Udcountry string
Message string Message string
Amount string
}{ }{
Criban: r.FormValue("criban"), Criban: r.FormValue("criban"),
@@ -174,6 +182,8 @@ func debugHTML(w http.ResponseWriter, r *http.Request, prefix string, qrch *qrbi
Udcountry: r.FormValue("udcountry"), Udcountry: r.FormValue("udcountry"),
Message: r.FormValue("message"), Message: r.FormValue("message"),
Amount: r.FormValue("amount"),
}) })
if err != nil { if err != nil {
log.Printf("%s %s", prefix, err) log.Printf("%s %s", prefix, err)