exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

challenger-postal.typ (1526B)


      1 // Form to render postal addresses validated via Challenger.
      2 // Pass JSON data as content dictionary
      3 #import "@taler-exchange/common:0.0.0": talerlogo
      4 
      5 #let form(data) = {
      6   set page(
      7     paper: "a4",
      8     margin: (left: 2cm, right: 2cm, top: 2cm, bottom: 2.5cm),
      9     footer: context [
     10       #grid(
     11         columns: (1fr, 1fr),
     12         align: (left, right),
     13         text(size: 8pt)[
     14         ],
     15         text(size: 8pt)[
     16           Page #here().page() of #counter(page).final().first()
     17         ]
     18       )
     19     ]
     20   )
     21 
     22   set text(font: "Liberation Sans", size: 10pt)
     23   set par(justify: false, leading: 0.65em)
     24 
     25   // Helper function to get value or empty string
     26   let get(key, default: "") = {
     27     data.at(key, default: default)
     28   }
     29 
     30   // Header
     31   align(center, text(size: 11pt, weight: "bold")[CONFIDENTIAL])
     32 
     33   v(0.5em)
     34 
     35   grid(
     36     columns: (50%, 50%),
     37     gutter: 1em,
     38     talerlogo(),
     39     align(right)[
     40       #table(
     41         columns: (1fr, 1fr),
     42         stroke: 0.5pt + black,
     43         inset: 5pt,
     44         align: (left, left),
     45         [AMLA File No.],
     46         [#get("FILE_NUMBER")]
     47       )
     48     ]
     49   )
     50 
     51   v(1em)
     52 
     53   // Section 1: Validated address
     54   text(size: 11pt, weight: "bold")[Validated address:]
     55 
     56   v(0.5em)
     57 
     58   block(breakable: false)[
     59     #v(0.5em)
     60     #table(
     61       columns: (35%, 65%),
     62       stroke: 0.5pt + black,
     63       inset: 5pt,
     64       [Contact name:], [#get("CONTACT_NAME")],
     65       [Address:], [#get("ADDRESS_LINES").split("\n").join(linebreak())],
     66       [Country:], [#get("ADDRESS_COUNTRY")],
     67     )
     68     #v(0.5em)
     69   ]
     70 }