mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Ensure encodable object in StripeAccountsController
Fixes:
```
Admin::StripeAccountsController#connect redirects to Stripe Authorization url constructed OAuth
Failure/Error: url_params = { state: JWT.encode(payload, key, 'HS256'), scope: "read_write" }
JSON::GeneratorError:
only generation of JSON objects or arrays allowed
# ./app/controllers/admin/stripe_accounts_controller.rb:8:in `connect'
# ./spec/controllers/admin/stripe_accounts_controller_spec.rb:18:in `block (3 levels) in <top (required)>'
```
This commit is contained in:
@@ -3,7 +3,7 @@ require 'stripe/account_connector'
|
||||
module Admin
|
||||
class StripeAccountsController < Spree::Admin::BaseController
|
||||
def connect
|
||||
payload = params.permit(:enterprise_id)
|
||||
payload = params.permit(:enterprise_id).to_h
|
||||
key = Openfoodnetwork::Application.config.secret_token
|
||||
url_params = { state: JWT.encode(payload, key, 'HS256'), scope: "read_write" }
|
||||
redirect_to Stripe::OAuth.authorize_url(url_params)
|
||||
|
||||
Reference in New Issue
Block a user