-
Notifications
You must be signed in to change notification settings - Fork 353
/
mix.exs
219 lines (209 loc) · 5.18 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
defmodule Stripe.Mixfile do
use Mix.Project
@source_url "https://github.com/code-corps/stripity_stripe"
@version "3.2.0"
def project do
[
app: :stripity_stripe,
version: @version,
elixir: "~> 1.11",
deps: deps(),
docs: docs(),
package: package(),
elixirc_paths: elixirc_paths(Mix.env()),
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
dialyzer: [
plt_add_apps: [:mix],
plt_file: {:no_warn, "priv/plts/stripity_stripe.plt"}
],
test_coverage: [tool: ExCoveralls]
]
end
# Configuration for the OTP application
def application do
[
extra_applications: [],
env: env(),
mod: {Stripe, []}
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp env do
[
api_base_url: "https://api.stripe.com",
api_upload_url: "https://files.stripe.com",
pool_options: [
timeout: 5_000,
max_connections: 10
],
use_connection_pool: true
]
end
defp deps do
[
{:hackney, "~> 1.18"},
{:jason, "~> 1.1"},
{:telemetry, "~> 1.1"},
{:uri_query, "~> 0.2.0"},
{:plug, "~> 1.14", optional: true},
# Non-production dependencies
{:inch_ex, ">= 0.0.0", only: [:dev, :test]},
{:mox, ">= 0.0.0", only: :test},
{:erlexec, "~> 2.0", only: :test},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:excoveralls, ">= 0.0.0", only: :test}
]
end
defp docs do
[
extras: [
"CHANGELOG.md": [title: "Changelog"],
"LICENSE.md": [title: "License"],
"README.md": [title: "Overview"]
],
main: "readme",
source_url: @source_url,
source_ref: "v#{@version}",
formatters: ["html"],
groups_for_modules: groups_for_modules(),
nest_modules_by_prefix: nest_modules_by_prefix()
]
end
defp package do
[
description: "A Stripe client for Elixir.",
files: ["lib", "LICENSE*", "mix.exs", "README*", "CHANGELOG*"],
licenses: ["BSD-3-Clause"],
maintainers: [
"Maarten van Vliet",
"Nikola Begedin",
"Scott Newcomer"
],
links: %{
"GitHub" => @source_url
}
]
end
defp groups_for_modules do
[
Main: [
Stripe,
Stripe.API,
Stripe.ApiErrors,
Stripe.Entity,
Stripe.List,
Stripe.Request,
Stripe.SearchResult
],
"Core Resources": [
Stripe.Balance,
Stripe.BalanceTransaction,
Stripe.Charge,
Stripe.Customer,
Stripe.Dispute,
Stripe.Event,
Stripe.FileUpload,
Stripe.FileLink,
Stripe.Mandate,
Stripe.PaymentIntent,
Stripe.Payout,
Stripe.Price,
Stripe.Product,
Stripe.Refund,
Stripe.SetupIntent,
Stripe.TaxId,
Stripe.Token
],
"Payment Methods": [
Stripe.BankAccount,
Stripe.Card,
Stripe.PaymentMethod,
Stripe.Source
],
Checkout: [
Stripe.Checkout.Session
],
Billing: [
Stripe.Coupon,
Stripe.CreditNote,
Stripe.CreditNoteLineItem,
Stripe.CustomerTransactionBalance,
Stripe.Discount,
Stripe.Invoice,
Stripe.Invoiceitem,
Stripe.LineItem,
Stripe.Product,
Stripe.Plan,
Stripe.Subscription,
Stripe.SubscriptionItem,
Stripe.UsageRecord,
Stripe.SubscriptionSchedule,
Stripe.TaxRate
],
"Billing Portal": [
Stripe.BillingPortal.Session
],
Connect: [
Stripe.Account,
Stripe.ApplicationFee,
Stripe.Capability,
Stripe.Connect.OAuth,
Stripe.Connect.OAuth.AuthorizeResponse,
Stripe.Connect.OAuth.DeauthorizeResponse,
Stripe.Connect.OAuth.TokenResponse,
Stripe.CountrySpec,
Stripe.ExternalAccount,
Stripe.FeeRefund,
Stripe.LoginLink,
Stripe.Recipient,
Stripe.Topup,
Stripe.Transfer,
Stripe.TransferReversal
],
Fraud: [
Stripe.Radar.EarlyFraudWarning,
Stripe.Review
],
Identity: [
Stripe.Identity.VerificationSession,
Stripe.Identity.VerificationReport
],
Issuing: [
Stripe.Issuing.Authorization,
Stripe.Issuing.Card,
Stripe.Issuing.Cardholder,
Stripe.Issuing.Transaction,
Stripe.Issuing.Types
],
Terminal: [
Stripe.Terminal.ConnectionToken,
Stripe.Terminal.Location,
Stripe.Terminal.Reader
],
Utilities: [
Stripe.Config,
Stripe.Converter,
Stripe.Types
],
Other: [
~r/.*/
]
]
end
def nest_modules_by_prefix() do
[
Stripe.Connect.OAuth,
Stripe.Connect.OAuth.AuthorizeResponse,
Stripe.Connect.OAuth.TokenResponse,
Stripe.Connect.OAuth.DeauthorizeResponse
]
end
end