Skip to content

Conversation

thedev132
Copy link
Member

Summary of the problem

I wanna have the ability to activate grant cards on mobile (kinda how we have org invites).

Describe your changes

I copied most of the logical from the web controller and tweaked it for the API. Then you can activate via /api/v4/card_grants/xxxxxxx/activate

def activate
authorize @card_grant
@card_grant.create_stripe_card(current_session)
redirect_to @card_grant
rescue Stripe::InvalidRequestError => e
redirect_to @card_grant, flash: { error: "This card could not be activated: #{e.message}" }
rescue Errors::StripeInvalidNameError => e
redirect_to @card_grant, flash: { error: e.message }
end

@thedev132 thedev132 requested review from a team as code owners October 1, 2025 00:52
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.

1 participant