Skip to content

Commit

Permalink
server/pledge: don't set transfer_group on payment intents
Browse files Browse the repository at this point in the history
  • Loading branch information
frankie567 committed Apr 2, 2024
1 parent 6b3e956 commit 6cafff5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
8 changes: 0 additions & 8 deletions server/polar/integrations/stripe/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ async def create_payment_intent(
session: AsyncSession,
*,
amount: CurrencyAmount,
transfer_group: str | None = None,
metadata: PledgePaymentIntentMetadata
| DonationPaymentIntentMetadata
| None = None,
Expand All @@ -67,9 +66,6 @@ async def create_payment_intent(
"description": description,
}

if transfer_group:
params["transfer_group"] = transfer_group

if metadata is not None:
params["metadata"] = metadata.model_dump(exclude_none=True)

Expand All @@ -87,7 +83,6 @@ async def modify_payment_intent(
id: str,
*,
amount: CurrencyAmount,
transfer_group: str | None = None,
metadata: PledgePaymentIntentMetadata
| DonationPaymentIntentMetadata
| None = None,
Expand All @@ -107,9 +102,6 @@ async def modify_payment_intent(
if description is not None:
params["description"] = description

if transfer_group:
params["transfer_group"] = transfer_group

if setup_future_usage is not None:
params["setup_future_usage"] = setup_future_usage

Expand Down
6 changes: 0 additions & 6 deletions server/polar/integrations/stripe/service_pledge.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class PledgeStripeService:
def create_anonymous_intent(
self,
amount: int,
transfer_group: str,
pledge_issue: Issue,
pledge_issue_org: Organization,
pledge_issue_repo: Repository,
Expand All @@ -40,7 +39,6 @@ def create_anonymous_intent(
return stripe_lib.PaymentIntent.create(
amount=amount,
currency="USD",
transfer_group=transfer_group,
metadata=metadata.model_dump(exclude_none=True),
receipt_email=anonymous_email,
description=f"Pledge to {pledge_issue_org.name}/{pledge_issue_repo.name}#{pledge_issue.number}", # noqa: E501
Expand All @@ -50,7 +48,6 @@ async def create_user_intent(
self,
session: AsyncSession,
amount: int,
transfer_group: str,
pledge_issue: Issue,
pledge_issue_org: Organization,
pledge_issue_repo: Repository,
Expand All @@ -75,7 +72,6 @@ async def create_user_intent(
return stripe_lib.PaymentIntent.create(
amount=amount,
currency="USD",
transfer_group=transfer_group,
customer=customer.id,
metadata=metadata.model_dump(exclude_none=True),
receipt_email=user.email,
Expand All @@ -85,7 +81,6 @@ async def create_user_intent(
def create_organization_intent(
self,
amount: int,
transfer_group: str,
issue: Issue,
organization: Organization,
user: User,
Expand All @@ -103,7 +98,6 @@ def create_organization_intent(
return stripe_lib.PaymentIntent.create(
amount=amount,
currency="USD",
transfer_group=transfer_group,
metadata=metadata.model_dump(exclude_none=True),
receipt_email=user.email,
)
Expand Down
2 changes: 0 additions & 2 deletions server/polar/pledge/payment_intent_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ async def create_anonymous_payment_intent(
try:
payment_intent = pledge_stripe_service.create_anonymous_intent(
amount=amount_including_fee,
transfer_group=str(intent.issue_id),
pledge_issue=pledge_issue,
pledge_issue_org=pledge_issue_org,
pledge_issue_repo=pledge_issue_repo,
Expand Down Expand Up @@ -114,7 +113,6 @@ async def create_user_payment_intent(
payment_intent = await pledge_stripe_service.create_user_intent(
session=session,
amount=amount_including_fee,
transfer_group=str(intent.issue_id),
pledge_issue=pledge_issue,
pledge_issue_org=pledge_issue_org,
pledge_issue_repo=pledge_issue_repo,
Expand Down

0 comments on commit 6cafff5

Please sign in to comment.