commit 8872bba0ab12a4fa08d09109a934ce5e94baa46a
parent e791c3e26f1cd8c01a4e022f987edcfcb8863e9f
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 15 Apr 2025 09:30:46 +0200
adjust postal check script to match postal form and JQ converter
Diffstat:
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/kyclogic/taler-exchange-helper-measure-tops-postal-check b/src/kyclogic/taler-exchange-helper-measure-tops-postal-check
@@ -33,11 +33,9 @@ while getopts 'ac:hirvV' OPTION;
do
case "$OPTION" in
a)
- # Address details are required.
- echo "ADDRESS_STREET"
- echo "ADDRESS_TOWN_LOCATION"
- echo "ADDRESS_ZIPCODE"
- echo "ADDRESS_COUNTRY_CC"
+ echo "CONTACT_NAME"
+ echo "ADDRESS_LINES"
+ echo "ADDRESS_COUNTRY"
exit 0
;;
c)
@@ -68,7 +66,7 @@ do
exit 0
;;
v)
- echo "$0 v0.0.2"
+ echo "$0 v0.0.3"
exit 0
;;
V)
@@ -92,7 +90,7 @@ fi
INPUTS=$(jq '{"current_rules":.current_rules,"attributes":.attributes,"context":.context}')
# Get country number.
-COUNTRY=$(echo "$INPUTS" | jq -r '.attributes.ADDRESS_COUNTRY_CC // null')
+COUNTRY=$(echo "$INPUTS" | jq -r '.attributes.ADDRESS_COUNTRY // null')
# Get current rules.
CURRENT_RULES=$(echo "$INPUTS" | jq '.current_rules // null')
# Get context values.
@@ -100,8 +98,6 @@ EXPIRATION_TIME=$(echo "$INPUTS" | jq '.context.expiration_time // .attributes.e
SUCCESSOR_MEASURE=$(echo "$INPUTS" | jq '.context.successor_measure // .current_rules.successor_measure // null')
CUSTOM_MEASURES=$(echo "$INPUTS" | jq '.context.custom_measures // null')
-# FIXME: should we check that BUSINESS_NAME *or* FULL_NAME are provided?
-
# Validate country
if $(echo "$COUNTRY" | grep -E -e ${EXCHANGE_AML_PROGRAM_TOPS_POSTAL_CHECK_COUNTRY_REGEX} > /dev/null)
then