Skip to content

Commit

Permalink
add udaddrtype so that you can create donation codes
Browse files Browse the repository at this point in the history
  • Loading branch information
stapelberg committed Jul 10, 2020
1 parent d606b9f commit c896ea1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cmd/qrbill-api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func qrchFromRequest(r *http.Request) *qrbill.QRCH {
Ccy: "CHF",
},
UltmtDbtr: qrbill.Address{
AdrTp: qrbill.AddressTypeCombined,
AdrTp: qrbill.AddressType(ifEmpty(r.Form, "udaddrtype", qrbill.AddressTypeCombined)),
Name: ifEmpty(r.Form, "udname", "Michael Stapelberg"),
StrtNmOrAdrLine1: ifEmpty(r.Form, "udaddr1", "Stauffacherstr 42"),
BldgNbOrAdrLine2: ifEmpty(r.Form, "udaddr2", "8004 Zürich"),
Expand Down
31 changes: 19 additions & 12 deletions cmd/qrbill-api/debughtml.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ th { text-align: left; }
<td>{{ .Message }}</td>
</tr>
<tr>
<td>&udaddrtype=</td>
<td>{{ .Udaddrtype }}</td>
</tr>
</table>
</div>
Expand All @@ -154,12 +159,13 @@ func debugHTML(w http.ResponseWriter, r *http.Request, prefix string, qrch *qrbi
Crcity string
Crcountry string

Udname string
Udaddr1 string
Udaddr2 string
Udpost string
Udcity string
Udcountry string
Udname string
Udaddr1 string
Udaddr2 string
Udpost string
Udcity string
Udcountry string
Udaddrtype string

Message string

Expand All @@ -174,12 +180,13 @@ func debugHTML(w http.ResponseWriter, r *http.Request, prefix string, qrch *qrbi
Crcity: r.FormValue("crcity"),
Crcountry: r.FormValue("crcountry"),

Udname: r.FormValue("udname"),
Udaddr1: r.FormValue("udaddr1"),
Udaddr2: r.FormValue("udaddr2"),
Udpost: r.FormValue("udpost"),
Udcity: r.FormValue("udcity"),
Udcountry: r.FormValue("udcountry"),
Udname: r.FormValue("udname"),
Udaddr1: r.FormValue("udaddr1"),
Udaddr2: r.FormValue("udaddr2"),
Udpost: r.FormValue("udpost"),
Udcity: r.FormValue("udcity"),
Udcountry: r.FormValue("udcountry"),
Udaddrtype: r.FormValue("udaddrtype"),

Message: r.FormValue("message"),

Expand Down

0 comments on commit c896ea1

Please sign in to comment.