move payment button into choice page and make a link

This commit is contained in:
Rimian Perkins 2017-02-09 12:17:25 +11:00
parent 6d3ad0268e
commit b2321ba965
4 changed files with 27 additions and 26 deletions

View File

@ -3,12 +3,27 @@
<form class="choice-discourse-form form-horizontal">
<div>
<div>
{{text-field}}
</div>
<div>
<button class='btn btn-primary' {{action "someThing"}}>something</button>
</div>
</div>
</form>
<h2>Stripe Payments</h2>
<form action="/choice/stripe">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_b8RmhzlL8QPizJRqOrKF3JEV"
data-name="CHOICE"
data-description="Consumer Defender"
data-image="https://cloud.githubusercontent.com/assets/64749/18696451/99eeb440-7ffc-11e6-8cab-905a8ea27fb6.png"
data-locale="auto"
data-zip-code="false"
data-currency="aud"
data-label="Become a Consumer Defender"
data-email="{{model.email}}"
>
</script>
</form>

View File

@ -1,17 +1,2 @@
<form action="/choice/stripe">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_b8RmhzlL8QPizJRqOrKF3JEV"
data-name="CHOICE"
data-description="Consumer Defender"
data-image="https://cloud.githubusercontent.com/assets/64749/18696451/99eeb440-7ffc-11e6-8cab-905a8ea27fb6.png"
data-locale="auto"
data-zip-code="false"
data-currency="aud"
data-label="Become a Consumer Defender"
data-email="{{model.email}}"
>
</script>
</form>
<a href="/choice/form">Choice page</a>

View File

@ -0,0 +1,6 @@
module ::Choice
class Engine < ::Rails::Engine
engine_name 'choice'
isolate_namespace Choice
end
end

View File

@ -1,6 +1,6 @@
# name: choice-plugin
# about: Integrating Discourse with Stripe
# version: 0.0.3
# version: 0.1.0
# authors: Rimian Perkins
gem 'stripe', '1.58.0'
@ -12,12 +12,7 @@ Rails.configuration.stripe = {
Stripe.api_key = Rails.configuration.stripe[:secret_key]
module ::Choice
class Engine < ::Rails::Engine
engine_name 'choice'
isolate_namespace Choice
end
end
load File.expand_path('../lib/choice-discourse/engine.rb', __FILE__)
Discourse::Application.routes.prepend do
mount ::Choice::Engine, at: '/choice'