erp_commerce 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. data/GPL-3-LICENSE +0 -0
  2. data/README.md +13 -0
  3. data/app/mailers/checkout_mailer.rb +9 -0
  4. data/app/models/bank_account.rb +87 -0
  5. data/app/models/bank_account_type.rb +3 -0
  6. data/app/models/credit_card.rb +21 -6
  7. data/app/models/credit_card_account.rb +119 -0
  8. data/app/models/credit_card_account_party_role.rb +2 -4
  9. data/app/models/credit_card_account_purpose.rb +0 -0
  10. data/app/models/credit_card_token.rb +0 -0
  11. data/app/models/extensions/charge_line.rb +0 -0
  12. data/app/models/extensions/currency.rb +0 -0
  13. data/app/models/extensions/financial_txn.rb +2 -1
  14. data/app/models/extensions/order_txn.rb +0 -0
  15. data/app/models/extensions/party.rb +37 -3
  16. data/app/models/extensions/product_instance.rb +0 -0
  17. data/app/models/extensions/product_type.rb +0 -0
  18. data/app/models/fee.rb +0 -0
  19. data/app/models/fee_type.rb +0 -0
  20. data/app/models/payment.rb +8 -5
  21. data/app/models/payment_gateway.rb +0 -0
  22. data/app/models/payment_gateway_action.rb +0 -0
  23. data/app/models/price.rb +0 -0
  24. data/app/models/price_component.rb +0 -0
  25. data/app/models/price_component_type.rb +0 -0
  26. data/app/models/pricing_plan.rb +0 -0
  27. data/app/models/pricing_plan_assignment.rb +0 -0
  28. data/app/models/pricing_plan_component.rb +0 -0
  29. data/app/models/valid_price_plan_component.rb +0 -0
  30. data/app/views/checkout_mailer/email_confirmation.html.erb +15 -0
  31. data/app/widgets/orders/base.rb +2 -6
  32. data/app/widgets/orders/javascript/orders.js +0 -0
  33. data/app/widgets/orders/views/index.html.erb +0 -0
  34. data/app/widgets/product_catalog/base.rb +0 -4
  35. data/app/widgets/product_catalog/javascript/product_catalog.js +0 -0
  36. data/app/widgets/product_catalog/views/add_to_cart.html.erb +0 -0
  37. data/app/widgets/product_catalog/views/index.html.erb +0 -0
  38. data/app/widgets/product_catalog/views/show.html.erb +0 -0
  39. data/app/widgets/shopping_cart/base.rb +2 -5
  40. data/app/widgets/shopping_cart/javascript/shopping_cart.js +0 -0
  41. data/app/widgets/shopping_cart/views/cart_items.html.erb +0 -0
  42. data/app/widgets/shopping_cart/views/confirmation.html.erb +1 -0
  43. data/app/widgets/shopping_cart/views/demographics.html.erb +0 -0
  44. data/app/widgets/shopping_cart/views/login.html.erb +0 -0
  45. data/app/widgets/shopping_cart/views/payment.html.erb +0 -0
  46. data/app/widgets/shopping_cart/views/price_summary.html.erb +0 -0
  47. data/db/data_migrations/20101011152441_payment_gateway_actions.rb +0 -0
  48. data/db/migrate/20100823174238_erp_commerce_base.rb +50 -25
  49. data/db/migrate/20100913154134_setup_payments.rb +0 -0
  50. data/db/migrate/20101103132342_pricing_migrations.rb +0 -0
  51. data/db/migrate/20120308220606_add_external_identifier_to_payments.rb +5 -0
  52. data/db/migrate/upgrade/20120117170037_add_bank_account.rb +34 -0
  53. data/db/migrate/upgrade/20120117190924_add_credit_card_to_account_roles.rb +7 -0
  54. data/lib/erp_commerce/active_merchant_wrappers/bank_wrapper.rb +17 -0
  55. data/lib/erp_commerce/active_merchant_wrappers/brain_tree_gateway_wrapper.rb +20 -18
  56. data/lib/erp_commerce/active_merchant_wrappers/credit_card_validation.rb +0 -0
  57. data/lib/erp_commerce/active_merchant_wrappers/prismpay_wrapper.rb +108 -0
  58. data/lib/erp_commerce/active_merchant_wrappers.rb +3 -2
  59. data/lib/erp_commerce/config.rb +30 -0
  60. data/lib/erp_commerce/engine.rb +10 -0
  61. data/lib/erp_commerce/extensions/active_record/acts_as_fee.rb +0 -0
  62. data/lib/erp_commerce/extensions/active_record/acts_as_priceable.rb +0 -0
  63. data/lib/erp_commerce/order_helper.rb +10 -19
  64. data/lib/erp_commerce/version.rb +7 -1
  65. data/lib/erp_commerce.rb +2 -0
  66. data/spec/dummy/Rakefile +0 -0
  67. data/spec/dummy/app/assets/javascripts/application.js +0 -0
  68. data/spec/dummy/app/assets/stylesheets/application.css +0 -0
  69. data/spec/dummy/app/controllers/application_controller.rb +0 -0
  70. data/spec/dummy/app/helpers/application_helper.rb +0 -0
  71. data/spec/dummy/app/views/layouts/application.html.erb +0 -0
  72. data/spec/dummy/config/application.rb +0 -0
  73. data/spec/dummy/config/boot.rb +0 -0
  74. data/spec/dummy/config/database.yml +0 -0
  75. data/spec/dummy/config/environment.rb +0 -0
  76. data/spec/dummy/config/environments/spec.rb +0 -0
  77. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -0
  78. data/spec/dummy/config/initializers/inflections.rb +0 -0
  79. data/spec/dummy/config/initializers/mime_types.rb +0 -0
  80. data/spec/dummy/config/initializers/secret_token.rb +0 -0
  81. data/spec/dummy/config/initializers/session_store.rb +0 -0
  82. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -0
  83. data/spec/dummy/config/locales/en.yml +0 -0
  84. data/spec/dummy/config/routes.rb +0 -0
  85. data/spec/dummy/config.ru +0 -0
  86. data/spec/dummy/public/404.html +0 -0
  87. data/spec/dummy/public/422.html +0 -0
  88. data/spec/dummy/public/500.html +0 -0
  89. data/spec/dummy/public/favicon.ico +0 -0
  90. data/spec/dummy/script/rails +0 -0
  91. data/spec/factories/basic.rb +5 -0
  92. data/spec/models/credit_card_account_party_role_spec.rb +0 -0
  93. data/spec/models/credit_card_account_purpose_spec.rb +0 -0
  94. data/spec/models/credit_card_account_spec.rb +0 -0
  95. data/spec/models/credit_card_spec.rb +0 -0
  96. data/spec/models/fee_spec.rb +0 -0
  97. data/spec/models/fee_type_spec.rb +0 -0
  98. data/spec/models/payment_gateway_action_spec.rb +0 -0
  99. data/spec/models/payment_gateway_spec.rb +0 -0
  100. data/spec/models/payment_spec.rb +0 -0
  101. data/spec/models/price_component_spec.rb +0 -0
  102. data/spec/models/price_component_type_spec.rb +0 -0
  103. data/spec/models/price_spec.rb +0 -0
  104. data/spec/models/pricing_plan_assignment_spec.rb +0 -0
  105. data/spec/models/pricing_plan_component_spec.rb +0 -0
  106. data/spec/models/pricing_plan_spec.rb +0 -0
  107. data/spec/models/valid_price_plan_component_spec.rb +0 -0
  108. metadata +164 -141
  109. data/README.rdoc +0 -2
@@ -2,7 +2,7 @@ class ErpCommerceBase < ActiveRecord::Migration
2
2
  def self.up
3
3
  #tables
4
4
  unless table_exists?(:credit_cards)
5
- create_table :credit_cards do |t|
5
+ create_table :credit_cards do |t|
6
6
 
7
7
  t.column :crypted_private_card_number, :string
8
8
  t.column :expiration_month, :integer
@@ -14,7 +14,6 @@ class ErpCommerceBase < ActiveRecord::Migration
14
14
  t.column :card_type, :string
15
15
 
16
16
  t.column :postal_address_id, :integer
17
- t.column :credit_card_account_party_role_id, :integer
18
17
  t.column :credit_card_account_purpose_id, :integer
19
18
  t.column :credit_card_token, :string
20
19
 
@@ -30,47 +29,71 @@ class ErpCommerceBase < ActiveRecord::Migration
30
29
  end
31
30
 
32
31
  unless table_exists?(:credit_card_account_party_roles)
33
- create_table :credit_card_account_party_roles do |t|
34
- t.column :credit_card_account_id, :integer
35
- t.column :role_type_id, :integer
36
- t.column :party_id, :integer
32
+ create_table :credit_card_account_party_roles do |t|
33
+ t.column :credit_card_account_id, :integer
34
+ t.column :role_type_id, :integer
35
+ t.column :party_id, :integer
36
+ t.column :credit_card_id, :integer
37
37
 
38
- t.timestamps
39
- end
38
+ t.timestamps
39
+ end
40
40
 
41
- add_index :credit_card_account_party_roles, :credit_card_account_id
42
- add_index :credit_card_account_party_roles, :role_type_id
43
- add_index :credit_card_account_party_roles, :party_id
41
+ add_index :credit_card_account_party_roles, :credit_card_account_id
42
+ add_index :credit_card_account_party_roles, :role_type_id
43
+ add_index :credit_card_account_party_roles, :party_id
44
+ add_index :credit_card_account_party_roles, :credit_card_id
44
45
  end
45
46
 
46
47
  unless table_exists?(:credit_card_account_purposes)
47
- create_table :credit_card_account_purposes do |t|
48
+ create_table :credit_card_account_purposes do |t|
49
+
50
+ t.column :parent_id, :integer
51
+ t.column :lft, :integer
52
+ t.column :rgt, :integer
53
+
54
+ #custom columns go here
48
55
 
49
- t.column :parent_id, :integer
50
- t.column :lft, :integer
51
- t.column :rgt, :integer
56
+ t.column :description, :string
57
+ t.column :comments, :string
52
58
 
53
- #custom columns go here
59
+ t.column :internal_identifier, :string
60
+ t.column :external_identifier, :string
61
+ t.column :external_id_source, :string
62
+
63
+ t.timestamps
64
+ end
65
+ end
54
66
 
55
- t.column :description, :string
56
- t.column :comments, :string
67
+ unless table_exists?(:bank_account_types)
68
+ create_table :bank_account_types do |t|
69
+ t.string :description
70
+ t.string :internal_identifier
57
71
 
58
- t.column :internal_identifier, :string
59
- t.column :external_identifier, :string
60
- t.column :external_id_source, :string
72
+ t.timestamps
73
+ end
74
+ end
75
+
76
+ unless table_exists?(:bank_accounts)
77
+ create_table :bank_accounts do |t|
78
+ t.string :routing_number
79
+ t.string :crypted_private_account_number
80
+ t.string :name_on_account
81
+ t.references :bank_account_type
82
+
83
+ t.timestamps
84
+ end
61
85
 
62
- t.timestamps
63
- end
86
+ add_index :bank_accounts, :bank_account_type_id, :name => 'bank_accounts_account_type_idx'
64
87
  end
65
88
  #end tables
66
89
 
67
90
  #columns
68
91
  unless columns(:order_txns).collect {|c| c.name}.include?('payment_gateway_txn_id')
69
- add_column :order_txns, :payment_gateway_txn_id, :string
92
+ add_column :order_txns, :payment_gateway_txn_id, :string
70
93
  end
71
94
 
72
95
  unless columns(:order_txns).collect {|c| c.name}.include?('credit_card_id')
73
- add_column :order_txns, :credit_card_id, :integer
96
+ add_column :order_txns, :credit_card_id, :integer
74
97
  end
75
98
 
76
99
  unless columns(:order_txns).collect {|c| c.name}.include?('bill_to_first_name')
@@ -159,6 +182,8 @@ class ErpCommerceBase < ActiveRecord::Migration
159
182
 
160
183
  #tables
161
184
  drop_tables = [
185
+ :bank_account_types,
186
+ :bank_accounts,
162
187
  :credit_cards,
163
188
  :credit_card_accounts,
164
189
  :credit_card_account_party_roles,
File without changes
File without changes
@@ -0,0 +1,5 @@
1
+ class AddExternalIdentifierToPayments < ActiveRecord::Migration
2
+ def change
3
+ add_column :payments, :external_identifier, :string
4
+ end
5
+ end
@@ -0,0 +1,34 @@
1
+ class AddBankAccount < ActiveRecord::Migration
2
+ def up
3
+ unless table_exists?(:bank_account_types)
4
+ create_table :bank_account_types do |t|
5
+ t.string :description
6
+ t.string :internal_identifier
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ unless table_exists?(:bank_accounts)
13
+ create_table :bank_accounts do |t|
14
+ t.string :routing_number
15
+ t.string :crypted_private_account_number
16
+ t.string :name_on_account
17
+ t.references :bank_account_type
18
+
19
+ t.timestamps
20
+ end
21
+
22
+ add_index :bank_accounts, :bank_account_type_id, :name => 'bank_accounts_account_type_idx'
23
+ end
24
+
25
+ end
26
+
27
+ def down
28
+ [:bank_account_types, :bank_accounts].each do |tbl|
29
+ if table_exists?(tbl)
30
+ drop_table tbl
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,7 @@
1
+ class AddCreditCardToAccountRoles < ActiveRecord::Migration
2
+ def change
3
+ unless columns(:credit_card_account_party_roles).collect {|c| c.name}.include?('credit_card_id')
4
+ add_column :credit_card_account_party_roles, :credit_card_id, :integer
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ module ErpCommerce
2
+ module ActiveMerchantWrappers
3
+ class BankWrapper
4
+ def self.purchase(account_number, routing_number, amount)
5
+ result = {}
6
+
7
+ result[:message] = "Payment applied"
8
+ result[:payment] = Payment.create
9
+ result[:payment].authorization_code = '123456789'
10
+ result[:payment].success = true
11
+ #result[:payment].purchase
12
+
13
+ result
14
+ end
15
+ end
16
+ end
17
+ end
@@ -4,29 +4,31 @@ module ErpCommerce
4
4
  module ActiveMerchantWrappers
5
5
  class BrainTreeGatewayWrapper
6
6
 
7
- def self.purchase(credit_card_hash, gateway_options={})
7
+ def self.purchase(credit_card, amount, cvv, gateway_options={})
8
8
  result = {}
9
-
10
- #test
9
+
10
+ #this needs config options
11
+ gateway_options.merge!({:login => 'demo', :password => 'password'})
12
+
11
13
  ActiveMerchant::Billing::Base.mode = :test
12
14
 
13
15
  #setup gateway
14
16
  gateway = ActiveMerchant::Billing::BraintreeGateway.new(gateway_options)
15
17
 
16
18
  #set credit card info
17
- credit_card = ActiveMerchant::Billing::CreditCard.new({
18
- :first_name => credit_card_hash[:first_name],
19
- :last_name => credit_card_hash[:last_name],
20
- :number => credit_card_hash[:number],
21
- :month => credit_card_hash[:exp_month],
22
- :year => credit_card_hash[:exp_year],
23
- :verification_value => credit_card_hash[:cvvs],
24
- :type => ErpCommerce::ActiveMerchantWrappers::CreditCardValidation.get_card_type(credit_card_hash[:number])
19
+ credit_card_result = ActiveMerchant::Billing::CreditCard.new({
20
+ :first_name => credit_card.first_name_on_card,
21
+ :last_name => credit_card.last_name_on_card,
22
+ :number => credit_card.private_card_number,
23
+ :month => credit_card.expiration_month,
24
+ :year => credit_card.expiration_year,
25
+ :verification_value => cvv,
26
+ :type => ErpCommerce::ActiveMerchantWrappers::CreditCardValidation.get_card_type(credit_card.private_card_number)
25
27
  })
26
28
 
27
- if credit_card.valid?
28
- cents = (credit_card_hash[:charge_amount].to_f * 100)
29
- response = gateway.purchase(cents, credit_card)
29
+ if credit_card_result.valid?
30
+ cents = (amount.to_f * 100)
31
+ response = gateway.purchase(cents, credit_card_result)
30
32
 
31
33
  if response.success?
32
34
  result[:message] = response.message
@@ -50,7 +52,7 @@ module ErpCommerce
50
52
  result[:payment].save
51
53
  else
52
54
  result[:message] = "<ul>"
53
- credit_card.errors.full_messages.each do |current_notice_msg|
55
+ credit_card_result.errors.full_messages.each do |current_notice_msg|
54
56
  result[:message] << "<li>"
55
57
  result[:message] << current_notice_msg
56
58
  result[:message] << "</li>"
@@ -61,6 +63,6 @@ module ErpCommerce
61
63
  result
62
64
  end
63
65
 
64
- end
65
- end
66
- end
66
+ end#BrainTreeGatewayWrapper
67
+ end#ActiveMerchantWrappers
68
+ end#ErpCommerce
@@ -0,0 +1,108 @@
1
+ require 'prismpay'
2
+ require 'prismpay_am'
3
+ require 'active_merchant'
4
+
5
+ module ErpCommerce
6
+ module ActiveMerchantWrappers
7
+ class PrismPayWrapper
8
+
9
+ def self.authorize(credit_card, amount, cvv, gateway_options ={})
10
+ # same as purchase
11
+ end
12
+
13
+ def self.capture(credit_card, payment, cvv, gw_options ={})
14
+ # payment.external_identifier
15
+ # payment.financial_txn.money.amount
16
+ # payment.authorization_code
17
+ end
18
+
19
+ def self.void()
20
+ # payment.external_identifier
21
+ # payment.financial_txn.money.amount
22
+ # payment.authorization_code
23
+ end
24
+
25
+ def self.refund()
26
+ # payment.external_identifier
27
+ # payment.financial_txn.money.amount
28
+ # payment.authorization_code
29
+ end
30
+
31
+ def self.profile_sale(profile_id, amount, last_four, gw_options = {})
32
+ # conducts a profile_sale transaction
33
+
34
+ result = {}
35
+
36
+ gw_options.merge!({:login => 'TEST0'}) unless gw_options[:login]
37
+
38
+ # ActiveMerchant::Billing:Base.mode = :test
39
+
40
+ gatway = ActiveMerchant::Billing::PrismPayAM.new(gw_options)
41
+
42
+
43
+ end
44
+
45
+ def self.purchase(credit_card, amount, cvv, gateway_options={})
46
+ # returns a hash with the possible parameters of :message and
47
+ # :payment ... if a credit card error occurs it returns with
48
+ # just :message set
49
+ result = {}
50
+
51
+ #this needs config options
52
+ gateway_options.merge!({:login => 'TEST0'}) unless gateway_options
53
+
54
+ # ActiveMerchant::Billing::Base.mode = :test
55
+
56
+ #setup gateway
57
+ gateway = ActiveMerchant::Billing::PrismPayAM.new(gateway_options)
58
+
59
+ #set credit card info
60
+ credit_card_result = ActiveMerchant::Billing::CreditCard.new({
61
+ :first_name => credit_card.first_name_on_card,
62
+ :last_name => credit_card.last_name_on_card,
63
+ :number => credit_card.private_card_number,
64
+ :month => credit_card.expiration_month,
65
+ :year => credit_card.expiration_year,
66
+ :verification_value => cvv,
67
+ :type => ErpCommerce::ActiveMerchantWrappers::CreditCardValidation.get_card_type(credit_card.private_card_number)
68
+ })
69
+
70
+ if credit_card_result.valid?
71
+ response = gateway.purchase(amount, credit_card_result)
72
+
73
+ if response.success?
74
+ result[:message] = response.message
75
+ result[:payment] = Payment.new
76
+ result[:payment].authorization_code = response.authorization
77
+ result[:payment].success = true
78
+ result[:payment].purchase
79
+ else
80
+ result[:message] = response.message
81
+ result[:payment] = Payment.new
82
+ result[:payment].success = false
83
+ result[:payment].decline
84
+ end
85
+
86
+ gateway = PaymentGateway.create(
87
+ :response => response.message,
88
+ :payment_gateway_action => PaymentGatewayAction.find_by_internal_identifier('authorize')
89
+ )
90
+
91
+ result[:payment].payment_gateways << gateway
92
+ result[:payment].save
93
+ else
94
+ result[:message] = "<ul>"
95
+ credit_card_result.errors.full_messages.each do |current_notice_msg|
96
+ result[:message] << "<li>"
97
+ result[:message] << current_notice_msg
98
+ result[:message] << "</li>"
99
+ end
100
+ result[:message] << "<ul>"
101
+ end
102
+
103
+ result
104
+ end
105
+
106
+ end#PrismPayWrapper
107
+ end#ActiveMerchantWrappers
108
+ end#ErpCommerce
@@ -1,2 +1,3 @@
1
- require 'erp_commerce/active_merchant_wrappers/credit_card_validation'
2
- require 'erp_commerce/active_merchant_wrappers/brain_tree_gateway_wrapper'
1
+ Dir.glob("#{File.dirname(__FILE__)}/active_merchant_wrappers/**/*.rb").each do |file|
2
+ require "erp_commerce/active_merchant_wrappers/#{File.basename(file)}"
3
+ end
@@ -0,0 +1,30 @@
1
+ module ErpCommerce
2
+ module Config
3
+ class << self
4
+ attr_accessor :encryption_key, :active_merchant_gateway_wrapper
5
+
6
+ def init!
7
+ @defaults = {
8
+ :@encryption_key => 'my_secret_code',
9
+ :@active_merchant_gateway_wrapper => ErpCommerce::ActiveMerchantWrappers::BrainTreeGatewayWrapper
10
+ }
11
+ end
12
+
13
+ def reset!
14
+ @defaults.each do |k,v|
15
+ instance_variable_set(k,v)
16
+ end
17
+ end
18
+
19
+ def configure(&blk)
20
+ @configure_blk = blk
21
+ end
22
+
23
+ def configure!
24
+ @configure_blk.call(self) if @configure_blk
25
+ end
26
+ end
27
+ init!
28
+ reset!
29
+ end
30
+ end
@@ -1,6 +1,8 @@
1
1
  module ErpCommerce
2
2
  class Engine < Rails::Engine
3
3
  isolate_namespace ErpCommerce
4
+
5
+ config.erp_commerce = ErpCommerce::Config
4
6
 
5
7
  initializer "erp_commerce.merge_public" do |app|
6
8
  app.middleware.insert_before Rack::Lock, ::ActionDispatch::Static, "#{root}/public"
@@ -10,6 +12,14 @@ module ErpCommerce
10
12
  include ErpCommerce::Extensions::ActiveRecord::ActsAsFee
11
13
  include ErpCommerce::Extensions::ActiveRecord::ActsAsPriceable
12
14
  end
15
+
16
+ #TODO
17
+ #this will be removed once rails 3.2 adds the ability to set the order of engine loading
18
+ engine = self
19
+ config.to_prepare do
20
+ ErpBaseErpSvcs.register_compass_ae_engine(engine)
21
+ ::ErpApp::Widgets::Loader.load_compass_ae_widgets(engine)
22
+ end
13
23
 
14
24
  end#Engine
15
25
  end#ErpCommerce
@@ -141,12 +141,16 @@ module ErpCommerce
141
141
  #make credit financial txns and payment txns
142
142
  #create financial txn for order
143
143
  financial_txn = create_financial_txns(order)
144
- #fire the purchase method with the passed gatewaywrapper
145
- result = financial_txn.purchase(
146
- build_credit_card_hash(params),
147
- ErpCommerce::ActiveMerchantWrappers::BrainTreeGatewayWrapper,
148
- {:login => 'demo', :password => 'password'}
144
+
145
+ credit_card = CreditCard.new(
146
+ :first_name_on_card => params[:first_name],
147
+ :last_name_on_card => params[:last_name],
148
+ :expiration_month => params[:exp_month],
149
+ :expiration_year => params[:exp_year]
149
150
  )
151
+ credit_card.card_number = params[:card_number]
152
+ result = CreditCardAccount.new.purchase(financial_txn, params[:cvvs], ErpCommerce::Config.active_merchant_gateway_wrapper, {}, credit_card)
153
+
150
154
  #make sure cedit card payment was successful
151
155
  if result[:payment].nil? or !result[:payment].success
152
156
  success = false
@@ -170,7 +174,7 @@ module ErpCommerce
170
174
  end
171
175
 
172
176
  order.save
173
- return success, message, order
177
+ return success, message, order, result[:payment]
174
178
  end
175
179
 
176
180
  #remove line item
@@ -237,18 +241,5 @@ module ErpCommerce
237
241
  financial_txn
238
242
  end
239
243
 
240
- def build_credit_card_hash(params)
241
- credit_card = {}
242
-
243
- credit_card[:number] = params[:card_number]
244
- credit_card[:exp_month] = params[:exp_month]
245
- credit_card[:exp_year] = params[:exp_year]
246
- credit_card[:cvvs] = params[:cvvs]
247
- credit_card[:first_name] = params[:first_name]
248
- credit_card[:last_name] = params[:last_name]
249
-
250
- credit_card
251
- end
252
-
253
244
  end#ErpCommerce
254
245
  end#OrderHelper
@@ -1,3 +1,9 @@
1
1
  module ErpCommerce
2
- VERSION = "3.0.0"
2
+ module VERSION #:nodoc:
3
+ MAJOR = 3
4
+ MINOR = 0
5
+ TINY = 1
6
+
7
+ STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
+ end
3
9
  end
data/lib/erp_commerce.rb CHANGED
@@ -1,5 +1,7 @@
1
+ require "erp_commerce/version"
1
2
  require 'erp_commerce/active_merchant_wrappers'
2
3
  require 'erp_commerce/extensions'
4
+ require 'erp_commerce/config'
3
5
  require "erp_commerce/engine"
4
6
  require 'erp_commerce/order_helper'
5
7
  require 'aasm'
data/spec/dummy/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/spec/dummy/config.ru CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,5 @@
1
+ FactoryGirl.define do
2
+ factory :payment
3
+ factory :pricing_plan
4
+ factory :credit_card_account
5
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes