I have deleted all wath i did yesterday and i have started back from zero. Let me show you what i have already done up till now and the problem(s) i am currently facing. For the moment i don’t really care about editing the /locales .yml files i have hard-coded all the text, and i also decided to use classic html rather than handlebar (I’ll come back to it once I have something that works)
- I have added the bank transfer option
../discourse-subscriptions/assets/javascripts/discourse/templates/subscribe/show.hbs
<hr>
<h3>Bank Transfer</h3>
<form action="/payment_intent" method="post">
<!-- some data-->
<input type="submit" value="Next" class="btn btn-primary ">
</form>
<hr>
- I have created a payment_intent controller
../discourse-subscriptions/app/controllers/discourse_subscriptions/payment_intents_controller.rb
module DiscourseSubscriptions
class PaymentIntentsController < ::ApplicationController
include DiscourseSubscriptions::Stripe
include DiscourseSubscriptions::Group
before_action :set_api_key
requires_login except: [:index, :contributors, :show]
def create
params.require([:source, :plan])
begin
#customer = find_or_create_customer(params[:source])
# create a test payment intent
bk_payment_intent = Stripe::PaymentIntent.create({
amount: 1099,
currency: 'eur'
})
render json: payment_intent
end
end
end
- It’s route
../discourse-subscriptions/config/routes.rb
resources :payment_intents, only: %i[create]
But when i run the project and go to the ember inspector it tells me the route doesn’t exist
And after that what would be the best way to handle the form submission ? should i create another ember controller,use the subscribe-show.js controller or add a script tag within the subscribe/show.hbs?

