transactionable 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38e0184eda5b9abc7aeb8930c495815d91de289a
4
- data.tar.gz: 603cef288a2633938f229905a004ad0947c207c5
3
+ metadata.gz: 49728717552499cb35045ade8224c145099040f3
4
+ data.tar.gz: 7056ee5a0513ed6ad1082606aa3c88e00cb1aabc
5
5
  SHA512:
6
- metadata.gz: 862efeab377c63bde79712bc32dcc2191126c3ec962c3203a721b6afd8a6c7dc2b0b2b73a75b744aa2ac470c97d56eb56de0a64f66d5d491264317380aae2e3e
7
- data.tar.gz: 67c979751972a0862f4440f1e61c9aa72ed8e8a569aaf77c9c50327bf677b44b02bc17c5c7986abfc4df32054b3e94613e821d2cf89371e43618004d344d2180
6
+ metadata.gz: 3696cefdda68cddd497b223857ae07cf34ce12e2cbf2301fecd26ea7306be6547f13c2300c6b778d32b41058fc223d38aca84b0c2578fc424e8dbea084584d41
7
+ data.tar.gz: 55f9ac6f0da8748614f3819f70d798adb736c47aef48bf2c2602a8535d631b8358b59ea19f3916b257f99f8074a3a2c93a829746e17c8df229e809e983c3b2bc
@@ -6,6 +6,8 @@ module Transactionable
6
6
  has_many :credits, as: :transactionable
7
7
  has_many :reversals, as: :transactionable
8
8
 
9
+ TYPES = ["checking", "savings"]
10
+
9
11
  def remote
10
12
  if remote_bank_account && remote_bank_account.synced?
11
13
  remote_bank_account.fetch
@@ -0,0 +1,29 @@
1
+ <% content_for :head do %>
2
+ <%= javascript_include_tag "https://js.balancedpayments.com/v1/balanced.js" %>
3
+ <%= javascript_include_tag "transactionable/add_bank_account.js" %>
4
+ <% end %>
5
+
6
+ <% javascript_tag do %>
7
+ $(document).ready(function() {
8
+ var marketplaceUri = "#{Balanced::Marketplace.my_marketplace.uri}";
9
+ balanced.init(marketplaceUri);
10
+ });
11
+ <% end %>
12
+
13
+ <%= form_for :bank_account_info, url: action, html: { class: "acct-info-form" } do |f| %>
14
+ <%= f.label :name %>
15
+ <%= f.text_field :name, class: "acct-name" %>
16
+
17
+ <%= f.label :account_number, "Account Number" %>
18
+ <%= f.text_field :account_number, class: "acct-number" %>
19
+
20
+ <%= f.label :routing_number, "Routing Number" %>
21
+ <%= f.text_field :routing_number, class: "acct-routing-number" %>
22
+
23
+ <%= f.label :type %>
24
+ <%= f.select :type, Transactionable::BankAccount::TYPES, class: "acct-type" %>
25
+
26
+ <%= f.hidden_field :balanced_uri, class: "acct-balanced-uri" %>
27
+
28
+ <%= f.submit "Submit Bank Account Info", class: "submit-bank-acct-info" %>
29
+ <% end %>
@@ -0,0 +1,32 @@
1
+ <% content_for :head do %>
2
+ <%= javascript_include_tag "https://js.balancedpayments.com/v1/balanced.js" %>
3
+ <%= javascript_include_tag "transactionable/add_credit_card.js" %>
4
+ <% end %>
5
+
6
+ <% javascript_tag do %>
7
+ $(document).ready(function() {
8
+ var marketplaceUri = "#{Balanced::Marketplace.my_marketplace.uri}";
9
+ balanced.init(marketplaceUri);
10
+ });
11
+ <% end %>
12
+
13
+ <%= form_for :credit_card_info, url: action, html: { class: "cc-info-form" } do |f| %>
14
+ <%= f.label :name %>
15
+ <%= f.text_field :name, class: "cc-name" %>
16
+
17
+ <%= f.label :card_number, "Credit Card Number" %>
18
+ <%= f.text_field :card_number, class: "cc-number" %>
19
+
20
+ <%= f.label :expiration_date, "Expiration Date" %>
21
+ <%= f.text_field :expiration_date, class: "cc-exp-date", placeholder: "MM/YYYY" %>
22
+
23
+ <%= f.label :security_code %>
24
+ <%= f.text_field :security_code, class: "cc-csc" %>
25
+
26
+ <%= f.label :zip_code %>
27
+ <%= f.text_field :zip_code, class: "cc-postal-code" %>
28
+
29
+ <%= f.hidden_field :balanced_uri, class: "cc-balanced-uri" %>
30
+
31
+ <%= f.submit "Submit Credit Card Information", class: "submit-cc-info" %>
32
+ <% end %>
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Writes basic credit card and bank account form partials to app/views
3
+
4
+ Example:
5
+ rails generate transactionable:views
6
+
7
+ This will create:
8
+ app/views/transactionable/shared/_bank_account_form.html.erb
9
+ app/views/transactionable/shared/_credit_card_form.html.erb
@@ -0,0 +1,10 @@
1
+ module Transactionable
2
+ class ViewsGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('../../../../app/views/transactionable/', __FILE__)
4
+ desc "Copies shared transactionable views to your application."
5
+
6
+ def copy_shared_partials
7
+ directory "shared/", "app/views/transactionable/shared/"
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Transactionable
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -2873,3 +2873,14 @@
2873
2873
  Transactionable::Transaction Load (0.1ms) SELECT "transactionable_transactions".* FROM "transactionable_transactions" WHERE "transactionable_transactions"."transactionable_id" = ? AND "transactionable_transactions"."transactionable_type" = ? ORDER BY "transactionable_transactions"."id" ASC LIMIT 1 [["transactionable_id", 1], ["transactionable_type", "Transactionable::CreditCard"]]
2874
2874
  Transactionable::RemoteTransaction Load (0.1ms) SELECT "transactionable_remote_entities".* FROM "transactionable_remote_entities" WHERE "transactionable_remote_entities"."type" IN ('Transactionable::RemoteTransaction') AND "transactionable_remote_entities"."local_entity_id" = ? AND "transactionable_remote_entities"."local_entity_type" = ? ORDER BY "transactionable_remote_entities"."id" ASC LIMIT 1 [["local_entity_id", 1], ["local_entity_type", "Transactionable::Transaction"]]
2875
2875
   (2.2ms) rollback transaction
2876
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2877
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2878
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2879
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2880
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2881
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2882
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2883
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2884
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2885
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
2886
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transactionable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Timoshpolsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-13 00:00:00.000000000 Z
11
+ date: 2014-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -152,11 +152,15 @@ files:
152
152
  - app/models/transactionable/reversal.rb
153
153
  - app/models/transactionable/transaction.rb
154
154
  - app/views/layouts/transactionable/application.html.erb
155
+ - app/views/transactionable/shared/_bank_account_form.html.erb
156
+ - app/views/transactionable/shared/_credit_card_form.html.erb
155
157
  - config/routes.rb
156
158
  - db/migrate/20140108145608_create_transactionable_remote_entities.rb
157
159
  - db/migrate/20140108182203_create_transactionable_credit_cards.rb
158
160
  - db/migrate/20140108190511_create_transactionable_transactions.rb
159
161
  - db/migrate/20140108213120_create_transactionable_bank_accounts.rb
162
+ - lib/generators/transactionable/USAGE
163
+ - lib/generators/transactionable/views_generator.rb
160
164
  - lib/tasks/transactionable_tasks.rake
161
165
  - lib/transactionable.rb
162
166
  - lib/transactionable/acts_as_transactionable.rb
@@ -212,10 +216,7 @@ files:
212
216
  - spec/factories/transactionable_remote_transactions.rb
213
217
  - spec/integration/acts_as_bank_account_transactionable_spec.rb
214
218
  - spec/integration/acts_as_credit_card_transactionable_spec.rb
215
- - spec/integration/models/bank_account_spec.rb
216
219
  - spec/integration/models/credit_card_spec.rb
217
- - spec/integration/models/credit_spec.rb
218
- - spec/integration/models/debit_spec.rb
219
220
  - spec/lib/transactionable_spec.rb
220
221
  - spec/models/transactionable/bank_account_spec.rb
221
222
  - spec/models/transactionable/credit_card_spec.rb
@@ -299,10 +300,7 @@ test_files:
299
300
  - spec/factories/transactionable_remote_transactions.rb
300
301
  - spec/integration/acts_as_bank_account_transactionable_spec.rb
301
302
  - spec/integration/acts_as_credit_card_transactionable_spec.rb
302
- - spec/integration/models/bank_account_spec.rb
303
303
  - spec/integration/models/credit_card_spec.rb
304
- - spec/integration/models/credit_spec.rb
305
- - spec/integration/models/debit_spec.rb
306
304
  - spec/lib/transactionable_spec.rb
307
305
  - spec/models/transactionable/bank_account_spec.rb
308
306
  - spec/models/transactionable/credit_card_spec.rb
File without changes
File without changes
File without changes