Remove useless on_behalf_of
This commit is contained in:
parent
a7a1263c73
commit
55746445bb
@ -228,6 +228,18 @@ class StripeManager:
|
|||||||
transaction.stripe_checkout_session_url,
|
transaction.stripe_checkout_session_url,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Check connected account capabilities
|
||||||
|
connected_account = stripe.Account.retrieve(
|
||||||
|
transaction.to_stripe_account_id
|
||||||
|
)
|
||||||
|
if (
|
||||||
|
connected_account.capabilities.get("card_payments") != "active"
|
||||||
|
or connected_account.capabilities.get("transfers") != "active"
|
||||||
|
):
|
||||||
|
raise Exception(
|
||||||
|
f"Connected account {transaction.to_stripe_account_id} lacks required capabilities."
|
||||||
|
)
|
||||||
|
|
||||||
if not transaction.stripe_product_id:
|
if not transaction.stripe_product_id:
|
||||||
product = stripe.Product.create(
|
product = stripe.Product.create(
|
||||||
name="{}-{}".format(
|
name="{}-{}".format(
|
||||||
@ -261,7 +273,6 @@ class StripeManager:
|
|||||||
"destination": transaction.to_stripe_account_id,
|
"destination": transaction.to_stripe_account_id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
on_behalf_of=transaction.to_stripe_account_id,
|
|
||||||
mode="payment",
|
mode="payment",
|
||||||
success_url="{}/work-space".format(
|
success_url="{}/work-space".format(
|
||||||
self.site_url_root
|
self.site_url_root
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user