@@ -6,11 +6,7 @@ import Data.Maybe (Maybe)
6
6
type Customer =
7
7
{ object :: ObjectTag
8
8
, id :: CustomerId
9
- , name :: Maybe String
10
9
, description :: Maybe String
11
- , email :: Maybe Email
12
- , phone :: Maybe String
13
- , address :: Maybe Address
14
10
, balance :: Amount
15
11
, currency :: Currency
16
12
, invoice_prefix :: String
@@ -19,6 +15,7 @@ type Customer =
19
15
, delinquent :: Boolean
20
16
, tax_ids :: ArrayWrapper TaxIdData
21
17
, tax_exempt :: TaxExemptType
18
+ | NameAddressPhoneRow ()
22
19
}
23
20
24
21
type CustomerId = String
@@ -44,12 +41,7 @@ type PaymentMethodId = String
44
41
-- | One of `"card"` | `"fpx"` | `"ideal"` | `"sepa_debit"`. See https://stripe.com/docs/api/payment_methods/object.
45
42
type PaymentMethodType = String
46
43
47
- type BillingDetails =
48
- { name :: Maybe String
49
- , phone :: Maybe Phone
50
- , email :: Maybe Email
51
- , address :: Maybe Address
52
- }
44
+ type BillingDetails = { | NameAddressPhoneRow () }
53
45
54
46
type BillingDetailsId = String
55
47
@@ -168,6 +160,17 @@ type TaxExemptType = String
168
160
169
161
-- ------------------------------------------------------------------------------
170
162
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
+
171
174
type Address =
172
175
{ postal_code :: Maybe PostalCode
173
176
, city :: Maybe String
0 commit comments