@@ -6,11 +6,7 @@ import Data.Maybe (Maybe)
66type Customer =
77 { object :: ObjectTag
88 , id :: CustomerId
9- , name :: Maybe String
109 , description :: Maybe String
11- , email :: Maybe Email
12- , phone :: Maybe String
13- , address :: Maybe Address
1410 , balance :: Amount
1511 , currency :: Currency
1612 , invoice_prefix :: String
@@ -19,6 +15,7 @@ type Customer =
1915 , delinquent :: Boolean
2016 , tax_ids :: ArrayWrapper TaxIdData
2117 , tax_exempt :: TaxExemptType
18+ | NameAddressPhoneRow ()
2219 }
2320
2421type CustomerId = String
@@ -44,12 +41,7 @@ type PaymentMethodId = String
4441-- | One of `"card"` | `"fpx"` | `"ideal"` | `"sepa_debit"`. See https://stripe.com/docs/api/payment_methods/object.
4542type PaymentMethodType = String
4643
47- type BillingDetails =
48- { name :: Maybe String
49- , phone :: Maybe Phone
50- , email :: Maybe Email
51- , address :: Maybe Address
52- }
44+ type BillingDetails = { | NameAddressPhoneRow () }
5345
5446type BillingDetailsId = String
5547
@@ -168,6 +160,17 @@ type TaxExemptType = String
168160
169161-- ------------------------------------------------------------------------------
170162
163+ -- TODO include or exclude 'name' field?
164+ type NameAddressPhoneRow r =
165+ ( name :: Maybe String
166+ , phone :: Maybe Phone
167+ , email :: Maybe Email
168+ , address :: Maybe Address
169+ | r
170+ )
171+
172+ -- ------------------------------------------------------------------------------
173+
171174type Address =
172175 { postal_code :: Maybe PostalCode
173176 , city :: Maybe String
0 commit comments