Skip to content

Commit

Permalink
change UEN length to 13
Browse files Browse the repository at this point in the history
  • Loading branch information
VirgilZhao committed Mar 4, 2021
1 parent d81629b commit 1fd476e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ A entire data message is the combination of data objects, below table shows the
| ----| ---- | ---- | ---- | ---- |
| Globally Unique Identifier | 00 | up to 32 | 0009SG.PAYNOW| static value|
| Account Type | 01 | 01 | 01012 | value 0 for mobile, value 2 for UEN |
| UEN | 02 | up to 10 | 020812345678 | UEN number |
| UEN | 02 | up to 13 | 020812345678 | UEN number takes 10, suffix takes 3 |
| Payment Amount Editable | 03 | 01 | 1 | value 1 payment is editable, value 0 is not editable |
| Expiry Date | 04 | 08 | 040820260304 | expire date format YYYYMMDD|

Expand Down
2 changes: 1 addition & 1 deletion paynow.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func getPayNowDataObject(options Options) *RootObject {
}
uenAccount := DataObject{
ID: "02",
MaxLength: 10,
MaxLength: 13,
Name: "UEN Account Number",
Value: options.UEN,
}
Expand Down
12 changes: 12 additions & 0 deletions test/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,15 @@ func TestCompanyNameOutOfLength(t *testing.T) {
})
t.Log(val)
}

func TestUENWithSuffix(t *testing.T) {
val := paynow.GeneratePayNowString(paynow.Options{
UEN: "123456789001",
Editable: false,
Expiry: "20260304",
CompanyName: "testcompany",
Amount: "0.99",
ReferenceNumber: "testordernumber12345678",
})
t.Log(val)
}

0 comments on commit 1fd476e

Please sign in to comment.