@@ -10,23 +10,23 @@ import (
1010)
1111
1212const (
13- idPayloadFormat = "00"
14- idPOIMethod = "01"
15- idMerchantInformationBOT = "29"
16- idTransactionCurrency = "53"
17- idTransactionAmount = "54"
18- idCountryCode = "58"
19- idCRC = "63"
20- PAYLOAD_FORMAT_EMV_QRCPS_MERCHANT_PRESENTED_MODE = "01"
21- POI_METHOD_STATIC = "11"
22- POI_METHOD_DYNAMIC = "12"
23- MERCHANT_INFORMATION_TEMPLATE_ID_GUID = "00"
24- BOT_ID_MERCHANT_PHONE_NUMBER = "01"
25- BOT_ID_MERCHANT_TAX_ID = "02"
26- BOT_ID_MERCHANT_EWALLET_ID = "03"
27- guidPromptpay = "A000000677010111"
28- transactionCurrencyTHB = "764"
29- countryCodeTH = "TH"
13+ idPayloadFormat = "00"
14+ idPOIMethod = "01"
15+ idMerchantInformationBOT = "29"
16+ idTransactionCurrency = "53"
17+ idTransactionAmount = "54"
18+ idCountryCode = "58"
19+ idCRC = "63"
20+ payloadFormatEMVQRCPS_MerchantPresentedMode = "01"
21+ poiMethodStatic = "11"
22+ poiMathodDynamic = "12"
23+ merchantInformationTemplateIDGUID = "00"
24+ botIDMerchantPhoneNumber = "01"
25+ botIDerchantTaxID = "02"
26+ botIDMerchantEwalletID = "03"
27+ guidPromptpay = "A000000677010111"
28+ transactionCurrencyTHB = "764"
29+ countryCodeTH = "TH"
3030)
3131
3232// Payment is the payment definition
@@ -106,25 +106,25 @@ func (p Payment) String() string {
106106 var targetType string
107107 switch {
108108 case len (target ) >= 15 :
109- targetType = BOT_ID_MERCHANT_EWALLET_ID
109+ targetType = botIDMerchantEwalletID
110110 case len (target ) >= 13 :
111- targetType = BOT_ID_MERCHANT_TAX_ID
111+ targetType = botIDerchantTaxID
112112 default :
113- targetType = BOT_ID_MERCHANT_PHONE_NUMBER
113+ targetType = botIDMerchantPhoneNumber
114114 }
115115
116116 var data []string
117- data = append (data , f (idPayloadFormat , PAYLOAD_FORMAT_EMV_QRCPS_MERCHANT_PRESENTED_MODE ))
117+ data = append (data , f (idPayloadFormat , payloadFormatEMVQRCPS_MerchantPresentedMode ))
118118 if p .Amount != 0 {
119- data = append (data , f (idPOIMethod , POI_METHOD_DYNAMIC ))
119+ data = append (data , f (idPOIMethod , poiMathodDynamic ))
120120 } else {
121- data = append (data , f (idPOIMethod , POI_METHOD_STATIC ))
121+ data = append (data , f (idPOIMethod , poiMethodStatic ))
122122 }
123- merchantInfo := serialize ([]string {f (MERCHANT_INFORMATION_TEMPLATE_ID_GUID , guidPromptpay ), f (targetType , formatTarget (target ))})
123+ merchantInfo := serialize ([]string {f (merchantInformationTemplateIDGUID , guidPromptpay ), f (targetType , formatTarget (target ))})
124124 data = append (data , f (idMerchantInformationBOT , merchantInfo ))
125125 data = append (data , f (idCountryCode , countryCodeTH ))
126126 data = append (data , f (idTransactionCurrency , p .transactionCurrency ))
127- data = append (data , f (idPayloadFormat , PAYLOAD_FORMAT_EMV_QRCPS_MERCHANT_PRESENTED_MODE ))
127+ data = append (data , f (idPayloadFormat , payloadFormatEMVQRCPS_MerchantPresentedMode ))
128128 if p .Amount != 0 {
129129 data = append (data , f (idTransactionAmount , formatAmount (p .Amount )))
130130 }
0 commit comments