File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ defmodule Algora.Payments do
198
198
charges_enabled: stripe_account . charges_enabled ,
199
199
details_submitted: stripe_account . details_submitted ,
200
200
country: stripe_account . country ,
201
- service_agreement: stripe_account . tos_acceptance . service_agreement ,
201
+ service_agreement: get_service_agreement ( stripe_account ) ,
202
202
provider_meta: Util . normalize_struct ( stripe_account )
203
203
}
204
204
@@ -223,4 +223,12 @@ defmodule Algora.Payments do
223
223
end
224
224
end
225
225
end
226
+
227
+ defp get_service_agreement ( % { tos_acceptance: % { service_agreement: agreement } } = _account ) when not is_nil ( agreement ) do
228
+ agreement
229
+ end
230
+
231
+ defp get_service_agreement ( % { capabilities: capabilities } ) do
232
+ if is_nil ( capabilities [ :card_payments ] ) , do: "recipient" , else: "full"
233
+ end
226
234
end
You can’t perform that action at this time.
0 commit comments