add craddrtype field, switch to structured by default for revolut

The revolut app does not seem to support the combined address type.

Luckily, switching to structured seems to not be a problem for
other apps such as the ZKB eBanking app.
This commit is contained in:
Michael Stapelberg
2020-09-10 09:26:43 +02:00
parent c896ea1025
commit c090eb57c2
2 changed files with 6 additions and 6 deletions

View File

@@ -46,12 +46,12 @@ func qrchFromRequest(r *http.Request) *qrbill.QRCH {
CdtrInf: qrbill.QRCHCdtrInf{ CdtrInf: qrbill.QRCHCdtrInf{
IBAN: ifEmpty(r.Form, "criban", "CH0209000000870913543"), IBAN: ifEmpty(r.Form, "criban", "CH0209000000870913543"),
Cdtr: qrbill.Address{ Cdtr: qrbill.Address{
AdrTp: qrbill.AddressTypeCombined, AdrTp: qrbill.AddressType(ifEmpty(r.Form, "craddrtype", string(qrbill.AddressTypeStructured))),
Name: ifEmpty(r.Form, "crname", "Legalize it!"), Name: ifEmpty(r.Form, "crname", "Legalize it!"),
StrtNmOrAdrLine1: ifEmpty(r.Form, "craddr1", "Quellenstrasse 25"), StrtNmOrAdrLine1: ifEmpty(r.Form, "craddr1", "Quellenstrasse 25"),
BldgNbOrAdrLine2: ifEmpty(r.Form, "craddr2", "8005 Zürich"), BldgNbOrAdrLine2: ifEmpty(r.Form, "craddr2", ""),
PstCd: ifEmpty(r.Form, "crpost", ""), PstCd: ifEmpty(r.Form, "crpost", "8005"),
TwnNm: ifEmpty(r.Form, "crcity", ""), TwnNm: ifEmpty(r.Form, "crcity", "Zürich"),
Ctry: ifEmpty(r.Form, "crcountry", "CH"), Ctry: ifEmpty(r.Form, "crcountry", "CH"),
}, },
}, },
@@ -60,7 +60,7 @@ func qrchFromRequest(r *http.Request) *qrbill.QRCH {
Ccy: "CHF", Ccy: "CHF",
}, },
UltmtDbtr: qrbill.Address{ UltmtDbtr: qrbill.Address{
AdrTp: qrbill.AddressType(ifEmpty(r.Form, "udaddrtype", qrbill.AddressTypeCombined)), AdrTp: qrbill.AddressType(ifEmpty(r.Form, "udaddrtype", string(qrbill.AddressTypeCombined))),
Name: ifEmpty(r.Form, "udname", "Michael Stapelberg"), Name: ifEmpty(r.Form, "udname", "Michael Stapelberg"),
StrtNmOrAdrLine1: ifEmpty(r.Form, "udaddr1", "Stauffacherstr 42"), StrtNmOrAdrLine1: ifEmpty(r.Form, "udaddr1", "Stauffacherstr 42"),
BldgNbOrAdrLine2: ifEmpty(r.Form, "udaddr2", "8004 Zürich"), BldgNbOrAdrLine2: ifEmpty(r.Form, "udaddr2", "8004 Zürich"),

View File

@@ -70,7 +70,7 @@ type AddressType string
const ( const (
AddressTypeStructured AddressType = "S" AddressTypeStructured AddressType = "S"
AddressTypeCombined = "K" AddressTypeCombined AddressType = "K"
) )
type Address struct { type Address struct {