Skip to content

Fix: setup_payout_account returns error flash instead of Stripe Connect redirect (#274)#310

Open
Ishant5436 wants to merge 1 commit into
algora-io:mainfrom
Ishant5436:fix/stripe-account-update-link-2
Open

Fix: setup_payout_account returns error flash instead of Stripe Connect redirect (#274)#310
Ishant5436 wants to merge 1 commit into
algora-io:mainfrom
Ishant5436:fix/stripe-account-update-link-2

Conversation

@Ishant5436
Copy link
Copy Markdown

Fixes #274

Bug

When an existing user (who had already partially or fully completed Stripe onboarding) clicked the Update details button, they were greeted with a Something went wrong error flash instead of being redirected to Stripe Connect. This was because the setup_payout_account handler unconditionally requested an account_onboarding account link type, which fails via the Stripe API if the account has already submitted its details. The API returned an error that was being swallowed by a catch-all {:error, _reason} match.

Fix

  • Updated Payments.create_account_link/3 to accept a type argument (defaulting to "account_onboarding").
  • Updated the setup_payout_account event handlers in both the User and Org transactions_live.ex modules to dynamically check socket.assigns.account.details_submitted. If true, the link type is correctly set to "account_update", restoring the ability for users to update their payout details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚨 CRITICAL: setup_payout_account returns error flash instead of Stripe Connect redirect — payouts blocked + China market feature request

1 participant