# הוספת בקרי נתיבים חדשים ותוספים לתקע ה-Discourse-subscriptions

**URL:** <https://meta.discourse.org/t/adding-new-controllers-and-routes-to-discourse-subscriptions-plugin/233704>\
**Category:** Development\
**Tags:** subscriptions\
**Created:** [22 ביולי,‏ 2022,‏ 10:44pm UTC](https://meta.discourse.org/t/adding-new-controllers-and-routes-to-discourse-subscriptions-plugin/233704 "2022-07-22T22:44:19Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![martin\_junior\_tchoup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin_junior_tchoup/32/253858_2.png) [@martin\_junior\_tchoup](https://meta.discourse.org/u/martin_junior_tchoup)\
**Post date:** [23 ביולי,‏ 2022,‏ 3:31pm UTC](https://meta.discourse.org/t/adding-new-controllers-and-routes-to-discourse-subscriptions-plugin/233704/4 "2022-07-23T15:31:50Z")

</div>

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)

1. **I have added the bank transfer option**  
 ![bktransfer-option](https://global.discourse-cdn.com/meta/original/4X/8/1/a/81a9433d4406289da65b061e8959cc3f15d03245.png)

```plaintext
../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>

```

1. **I have created a payment\_intent controller**  
../discourse-subscriptions/app/controllers/discourse\_subscriptions/payment\_intents\_controller.rb

```plaintext
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

```

1. **It’s route**  
../discourse-subscriptions/config/routes.rb

```plaintext
 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**

 ![intent error](https://global.discourse-cdn.com/meta/original/4X/8/5/3/8538bb3e3d6f91b45a08cec151c9b64c24f44667.png)

**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?**

---

_[View the full topic](https://meta.discourse.org/t/adding-new-controllers-and-routes-to-discourse-subscriptions-plugin/233704)._
