forked from beam-community/stripity-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
218 lines (207 loc) · 5.22 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
defmodule Stripe.Mixfile do
use Mix.Project
@source_url "https://github.com/code-corps/stripity_stripe"
@version "2.15.1"
def project do
[
app: :stripity_stripe,
version: @version,
elixir: "~> 1.10",
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
[
applications: apps(Mix.env()),
extra_applications: [:plug],
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/v1/",
api_upload_url: "https://files.stripe.com/v1/",
pool_options: [
timeout: 5_000,
max_connections: 10
],
use_connection_pool: true
]
end
defp apps(:test), do: apps()
defp apps(_), do: apps()
defp apps, do: [:hackney, :logger, :jason, :uri_query]
defp deps do
[
{:dialyxir, "1.1.0", only: [:dev, :test], runtime: false},
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:excoveralls, "~> 0.14.1", only: :test},
{:hackney, "~> 1.15"},
{:inch_ex, "~> 2.0", only: [:dev, :test]},
{:mox, "~> 0.4", only: :test},
{:jason, "~> 1.1"},
{:uri_query, "~> 0.1.2"},
{:exexec, "~> 0.1.0", only: :test},
{:plug, "~> 1.0", optional: true}
]
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: "master",
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: [
"Dan Matthews",
"Josh Smith",
"Nikola Begedin",
"Scott Newcomer"
],
links: %{
"GitHub" => @source_url
}
]
end
defp groups_for_modules do
[
"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.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.SubscriptionItem.Usage,
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.Fraud.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
],
"Relay/Orders": [
Stripe.Order,
Stripe.OrderItem,
Stripe.OrderReturn,
Stripe.Relay.Product,
Stripe.Sku
],
Terminal: [
Stripe.Terminal.ConnectionToken,
Stripe.Terminal.Location,
Stripe.Terminal.Reader
],
Utilities: [
Stripe.Config,
Stripe.Converter,
Stripe.Types
]
]
end
def nest_modules_by_prefix() do
[
Stripe.Connect.OAuth,
Stripe.Connect.OAuth.AuthorizeResponse,
Stripe.Connect.OAuth.TokenResponse,
Stripe.Connect.OAuth.DeauthorizeResponse
]
end
end