Bitcoin donations

This commit is contained in:
Bender Bending Rodríguez 2013-08-09 20:54:02 +02:00 committed by Jonne Haß
parent 45e4817a58
commit 7086055f4e
6 changed files with 48 additions and 12 deletions

View file

@ -1,11 +1,17 @@
%form{:action => "https://www.paypal.com/cgi-bin/webscr", :method => "post"}
%input{:name => "cmd", :type => "hidden", :value => "_s-xclick"}
%input{:name => "hosted_button_id", :type => "hidden", :value => AppConfig.settings.paypal_hosted_button_id}
%input{:name => "on0", :type => "hidden", :value => "Type"}
%input{:name => "modify", :type => "hidden", :value => "2"}
%select{:name => "os0"}
%option{:value => "Mocha"} Mocha : $3.00USD
%option{:value => "Americano"} Americano : $5.00USD
%option{:value => "Box o' Joe"} Box o' Joe : $20.00USD
%input{:name => "currency_code", :type => "hidden", :value => "USD"}
%input{:name => "submit", :type => "submit", :value => t('aspects.index.donate')}
- if AppConfig.settings.paypal_hosted_button_id.present?
PayPal:
%form{:action => "https://www.paypal.com/cgi-bin/webscr", :method => "post"}
%input{:name => "cmd", :type => "hidden", :value => "_s-xclick"}
%input{:name => "hosted_button_id", :type => "hidden", :value => AppConfig.settings.paypal_hosted_button_id}
%input{:name => "on0", :type => "hidden", :value => "Type"}
%input{:name => "modify", :type => "hidden", :value => "2"}
%select{:name => "os0"}
%option{:value => "Mocha"} Mocha : $3.00USD
%option{:value => "Americano"} Americano : $5.00USD
%option{:value => "Box o' Joe"} Box o' Joe : $20.00USD
%input{:name => "currency_code", :type => "hidden", :value => "USD"}
%input{:name => "submit", :type => "submit", :value => t('aspects.index.donate')}
- if AppConfig.settings.bitcoin_wallet_id.present?
Bitcoin:
%input{:type => "text", :id => "bitcoin_address", :value => AppConfig.settings.bitcoin_wallet_id, :readonly => true}

View file

@ -67,7 +67,7 @@
.content
!= t('bookmarklet.explanation', :link => link_to(t('bookmarklet.post_something'), magic_bookmarklet_link))
- if AppConfig.settings.paypal_hosted_button_id.present?
- if AppConfig.settings.paypal_hosted_button_id.present? || AppConfig.settings.bitcoin_wallet_id.present?
.section
.title
.icons-coffee

View file

@ -59,6 +59,7 @@ defaults:
open: true
count: 25
paypal_hosted_button_id:
bitcoin_wallet_id:
community_spotlight:
enable: false
suggest_email:

View file

@ -233,6 +233,11 @@ configuration: ## Section
## we kindly ask your users to donate to the Diaspora Foundation :)
#paypal_hosted_button_id: ""
## Bitcoin donations
## You can provide the bitcoin address here to kindly ask
## your users for donations to run their pod.
#bitcoin_wallet_id: ""
## Community Spotlight
## The community spotlight gives new users a starting point on who
## could be interesting Diasporas community. To add a person

View file

@ -0,0 +1,16 @@
@javascript
Feature: donations
In order to accept donation
As a podmin
I want a donation box shown on the stream page
Background:
Given following user exists:
| username | email |
| Alice | alice@alice.alice |
And I sign in as "alice@alice.alice"
Scenario: Bitcoin donations
Given I have configured a Bitcoin wallet
And I am on the home page
Then I should see the Bitcoin wallet ID

View file

@ -308,3 +308,11 @@ end
When /^I focus the "([^"]+)" field$/ do |field|
find_field(field).click
end
Given /^I have configured a Bitcoin wallet$/ do
AppConfig.settings.bitcoin_wallet_id = "AAAAAA"
end
Then /^I should see the Bitcoin wallet ID$/ do
find("#bitcoin_address")['value'].should == "AAAAAA"
end