servicemerchant 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/MIT-LICENSE.txt +20 -0
  2. data/README.txt +231 -0
  3. data/Rakefile +122 -0
  4. data/demo.rb +69 -0
  5. data/recurring_billing/lib/am_extensions.rb +1 -0
  6. data/recurring_billing/lib/am_extensions/paypal_extension.rb +170 -0
  7. data/recurring_billing/lib/dependencies.rb +14 -0
  8. data/recurring_billing/lib/gateways.rb +5 -0
  9. data/recurring_billing/lib/gateways/authorize_net.rb +103 -0
  10. data/recurring_billing/lib/gateways/paypal.rb +124 -0
  11. data/recurring_billing/lib/recurring_billing.rb +130 -0
  12. data/recurring_billing/lib/recurring_billing.rdoc +87 -0
  13. data/recurring_billing/lib/utils.rb +81 -0
  14. data/recurring_billing/test/fixtures.yml +33 -0
  15. data/recurring_billing/test/remote/authorize_net_test.rb +36 -0
  16. data/recurring_billing/test/remote/paypal_test.rb +46 -0
  17. data/recurring_billing/test/remote/recurring_billing_test.rb +41 -0
  18. data/recurring_billing/test/test_helper.rb +153 -0
  19. data/recurring_billing/test/unit/authorize_net_gateway_class_test.rb +42 -0
  20. data/recurring_billing/test/unit/paypal_gateway_class_test.rb +23 -0
  21. data/recurring_billing/test/unit/recurring_billing_gateway_class_test.rb +35 -0
  22. data/recurring_billing/test/unit/utils_test.rb +17 -0
  23. data/subscription_management/Rakefile +29 -0
  24. data/subscription_management/lib/models/subscription.rb +9 -0
  25. data/subscription_management/lib/models/subscription_profile.rb +4 -0
  26. data/subscription_management/lib/subscription_management.rb +326 -0
  27. data/subscription_management/samples/backpack.yml +101 -0
  28. data/subscription_management/samples/basecamp.yml +71 -0
  29. data/subscription_management/samples/brainkeeper.yml +90 -0
  30. data/subscription_management/samples/campfire.yml +74 -0
  31. data/subscription_management/samples/clickandpledge.yml +24 -0
  32. data/subscription_management/samples/demo.rb +19 -0
  33. data/subscription_management/samples/elm.yml +174 -0
  34. data/subscription_management/samples/freshbooks.yml +78 -0
  35. data/subscription_management/samples/highrise.yml +100 -0
  36. data/subscription_management/samples/presets.yml +10 -0
  37. data/subscription_management/samples/tariff.outline.yml +0 -0
  38. data/subscription_management/samples/taxes.yml +21 -0
  39. data/subscription_management/subscription_management.rb +7 -0
  40. data/subscription_management/tasks/schema.rb +50 -0
  41. data/subscription_management/test/connection.rb +10 -0
  42. data/subscription_management/test/remote/subscription_management_test.rb +112 -0
  43. data/subscription_management/test/test_helper.rb +84 -0
  44. data/subscription_management/test/unit/subscription_management_test.rb +40 -0
  45. data/tracker/README +12 -0
  46. data/tracker/Rakefile +40 -0
  47. data/tracker/db/migrations/empty-directory +0 -0
  48. data/tracker/demo.rb +12 -0
  49. data/tracker/lib/models/recurring_payment_profile.rb +134 -0
  50. data/tracker/lib/models/transaction.rb +19 -0
  51. data/tracker/lib/recurring_billing_extension.rb +103 -0
  52. data/tracker/lib/recurring_billing_extension.rdoc +34 -0
  53. data/tracker/tasks/schema.rb +66 -0
  54. data/tracker/test/connection.rb +10 -0
  55. data/tracker/test/recurring_payment_profile.rb +35 -0
  56. data/tracker/test/remote/authorize_net_test.rb +68 -0
  57. data/tracker/test/remote/paypal_test.rb +115 -0
  58. data/tracker/test/test_helper.rb +87 -0
  59. data/tracker/test/unit/recurring_payment_profile_test.rb +62 -0
  60. data/tracker/tracker.rb +10 -0
  61. data/vendor/money-1.7.1/MIT-LICENSE +20 -0
  62. data/vendor/money-1.7.1/README +75 -0
  63. data/vendor/money-1.7.1/lib/bank/no_exchange_bank.rb +9 -0
  64. data/vendor/money-1.7.1/lib/bank/variable_exchange_bank.rb +30 -0
  65. data/vendor/money-1.7.1/lib/money.rb +29 -0
  66. data/vendor/money-1.7.1/lib/money/core_extensions.rb +26 -0
  67. data/vendor/money-1.7.1/lib/money/money.rb +209 -0
  68. data/vendor/money-1.7.1/lib/support/cattr_accessor.rb +57 -0
  69. metadata +153 -0
@@ -0,0 +1,101 @@
1
+ # Tariff configuration for backpack
2
+ # http://www.backpackit.com/signup
3
+ #
4
+
5
+ backpack:
6
+ features:
7
+ user: &user
8
+ name: User Accounts
9
+ description: "User accounts available within application"
10
+ storage: &storage
11
+ name: "File Storage"
12
+ unit: Gigabyte
13
+ description: "File storage maximum disk quota"
14
+ page: &page
15
+ name: Pages
16
+ description: "Backpack Pages are the core of Backpack. You can add any combination of notes, to-dos, files, photos, and dividers to a Backpack Page."
17
+ group_calendar: &group_calendar
18
+ name: Group calendar
19
+ description: "Shared calendar for all users"
20
+ message_boards: &message_boards
21
+ name: Message Boards
22
+ description: "Backpack's Message Boards allow you to centralize your communications and discussions online."
23
+ ssl: &ssl
24
+ name: SSL Security
25
+ description: "Whether SSL encryption for online sessions is available or not"
26
+ free_campfire_premium: &free_campfire_premium
27
+ name: Free Campfire Premium
28
+ description: "Free Premium Campfire membership. Campfire is real-time group chat tool for businesses."
29
+ payment_terms:
30
+ monthly: &monthly
31
+ name: Monthly payments
32
+ periodicity: 1m
33
+ trial_days: 30
34
+ services:
35
+ solo: &solo
36
+ name: Solo
37
+ features:
38
+ - feature: *user
39
+ quantity: 1
40
+ - feature: *storage
41
+ quantity: 1
42
+ - feature: *page
43
+ quantity: 0
44
+ - feature: *ssl
45
+ basic: &basic
46
+ name: Basic
47
+ features:
48
+ - feature: *user
49
+ quantity: 6
50
+ - feature: *storage
51
+ quantity: 4
52
+ - feature: *page
53
+ quantity: 1000
54
+ - feature: *group_calendar
55
+ - feature: *message_boards
56
+ plus: &plus
57
+ name: Plus
58
+ features:
59
+ - feature: *user
60
+ quantity: 15
61
+ - feature: *storage
62
+ quantity: 10
63
+ - feature: *page
64
+ quantity: 2500
65
+ - feature: *group_calendar
66
+ - feature: *message_boards
67
+ - feature: *ssl
68
+ pro: &pro
69
+ name: Pro
70
+ features:
71
+ - feature: *user
72
+ quantity: 40
73
+ - feature: *storage
74
+ quantity: 20
75
+ - feature: *page
76
+ quantity: 5000
77
+ - feature: *group_calendar
78
+ - feature: *message_boards
79
+ - feature: *ssl
80
+ - feature: *free_campfire_premium
81
+ tariff_plans:
82
+ solo_monthly:
83
+ service: *solo
84
+ payment_term: *monthly
85
+ currency: USD
86
+ price: 700
87
+ basic_monthly:
88
+ service: *basic
89
+ payment_term: *monthly
90
+ currency: USD
91
+ price: 2400
92
+ plus_monthly:
93
+ service: *plus
94
+ payment_term: *monthly
95
+ currency: USD
96
+ price: 4900
97
+ pro_monthly:
98
+ service: *pro
99
+ payment_term: *monthly
100
+ currency: USD
101
+ price: 9900
@@ -0,0 +1,71 @@
1
+ # Tariff configuration for basecamp
2
+ # http://www.basecamphq.com/signup
3
+ #
4
+
5
+ basecamp:
6
+ features:
7
+ user: &project
8
+ name: Projects
9
+ unit: project
10
+ description: "Basecamp project"
11
+ storage: &storage
12
+ name: "File Storage"
13
+ unit: Gigabyte
14
+ description: "File storage maximum disk quota "
15
+ time_tracking: &time_tracking
16
+ name: Time Tracking
17
+ description: "Basecamp Time Tracking allows you to keep track of how much time your group is spending on tasks. You can run reports on individual people, date ranges, or total aggregate time across all projects."
18
+ ssl: &ssl
19
+ name: SSL Security
20
+ description: "Whether SSL encryption for online sessions is available or not"
21
+ free_campfire_premium: &free_campfire_premium
22
+ name: Free Campfire Premium
23
+ description: "Free Premium Campfire membership. Campfire is real-time group chat tool for businesses."
24
+ payment_terms:
25
+ monthly: &monthly
26
+ name: Monthly payments
27
+ periodicity: 1m
28
+ trial_days: 30
29
+ services:
30
+ basic: &basic
31
+ name: Basic
32
+ features:
33
+ - feature: *project
34
+ quantity: 15
35
+ - feature: *storage
36
+ quantity: 3
37
+ plus: &plus
38
+ name: Plus
39
+ features:
40
+ - feature: *project
41
+ quantity: 35
42
+ - feature: *storage
43
+ quantity: 10
44
+ - feature: *time_tracking
45
+ - feature: *ssl
46
+ max: &max
47
+ name: Max
48
+ features:
49
+ - feature: *project
50
+ quantity: 0
51
+ - feature: *storage
52
+ quantity: 50
53
+ - feature: *time_tracking
54
+ - feature: *ssl
55
+ - feature: *free_campfire_premium
56
+ tariff_plans:
57
+ basic_monthly:
58
+ service: *basic
59
+ payment_term: *monthly
60
+ currency: USD
61
+ price: 2400
62
+ plus_monthly:
63
+ service: *plus
64
+ payment_term: *monthly
65
+ currency: USD
66
+ price: 4900
67
+ max_monthly:
68
+ service: *max
69
+ payment_term: *monthly
70
+ currency: USD
71
+ price: 14900
@@ -0,0 +1,90 @@
1
+ # Tariff configuration for brainkeeper
2
+ # http://www.brainkeeper.com/pricing/
3
+ #
4
+ # Orginal tariffs
5
+ # ===============
6
+ # Some tariffs were removed
7
+ #
8
+ # Total of 10 User Accounts $ 35 USD $ 385 USD
9
+ # Total of 35 User Accounts $ 95 USD $ 1,045 USD
10
+ # Total of 100 User Accounts $ 199 USD $ 2,189 USD
11
+ # Total of 500 User Accounts $ 399 USD $ 4,389 USD
12
+
13
+ brainkeeper: # namespace
14
+ features:
15
+ account: &account
16
+ name: User Accounts
17
+ description: "Available user accounts"
18
+ # It's recommended to reuse default payment terms.
19
+ payment_terms:
20
+ monthly: &monthly
21
+ name: Monthly payments
22
+ periodicity: 1m
23
+ yearly: &yearly
24
+ name: Annual payments
25
+ periodicity: 1y
26
+ services:
27
+ 10accounts: &10accounts
28
+ name: 10 User Accounts
29
+ features:
30
+ - feature: *account # YAML reference. Features can be declared inline
31
+ # if nessesary.
32
+ quantity: 10
33
+ 35accounts: &35accounts
34
+ name: 35 User Accounts
35
+ features:
36
+ - feature: *account
37
+ quantity: 35
38
+ 100accounts: &100accounts
39
+ name: 100 User Accounts
40
+ features:
41
+ - feature: *account
42
+ quantity: 100
43
+ 500accounts: &500accounts
44
+ name: 500 User Accounts
45
+ features:
46
+ - feature: *account
47
+ quantity: 500
48
+ tariff_plans:
49
+ 10accounts_monthly:
50
+ service: *10accounts
51
+ payment_term: *monthly
52
+ currency: USD # ISO 4217
53
+ price: 3500 # Cents, pens, etc
54
+ 10accounts_yearly:
55
+ service: *10accounts
56
+ payment_term: *yearly
57
+ currency: USD
58
+ price: 38500
59
+ 35accounts_monthly:
60
+ service: *35accounts
61
+ payment_term: *monthly
62
+ currency: USD
63
+ price: 9500
64
+ 35accounts_yearly:
65
+ service: *35accounts
66
+ payment_term: *yearly
67
+ currency: USD
68
+ price: 104500
69
+ 100accounts_monthly:
70
+ service: *100accounts
71
+ payment_term: *monthly
72
+ currency: USD
73
+ price: 19900
74
+ 100accounts_yearly:
75
+ service: *100accounts
76
+ payment_term: *yearly
77
+ currency: USD
78
+ price: 218900
79
+ 500accounts_monthly:
80
+ service: *500accounts
81
+ payment_term: *default_monthly # Reusing payment policy from presets.yml
82
+ currency: USD
83
+ price: 9500
84
+ 500accounts_yearly:
85
+ service: *500accounts
86
+ payment_term: *default_yearly
87
+ currency: USD
88
+ price: 104500
89
+
90
+
@@ -0,0 +1,74 @@
1
+ # Tariff configuration for campfire
2
+ # http://www.campfirenow.com/signup
3
+ #
4
+
5
+ campfire:
6
+ features:
7
+ chatter: &chatter
8
+ name: Simultaneous Chatters
9
+ description: "Simultaneous chatters are the total number of people chatting across your account in all your rooms at one time."
10
+ storage: &storage
11
+ name: "File Storage"
12
+ unit: Gigabyte
13
+ description: "File storage maximum disk quota "
14
+ ssl: &ssl
15
+ name: SSL Security
16
+ description: "Whether SSL encryption for online sessions is available or not"
17
+ payment_terms:
18
+ monthly: &monthly
19
+ name: Monthly payments
20
+ periodicity: 1m
21
+ trial_days: 30
22
+ services:
23
+ basic: &basic
24
+ name: Basic
25
+ features:
26
+ - feature: *chatter
27
+ quantity: 12
28
+ - feature: *storage
29
+ quantity: 1
30
+ plus: &plus
31
+ name: Plus
32
+ features:
33
+ - feature: *chatter
34
+ quantity: 25
35
+ - feature: *storage
36
+ quantity: 3
37
+ - feature: *ssl
38
+ premium: &premium
39
+ name: premium
40
+ features:
41
+ - feature: *chatter
42
+ quantity: 60
43
+ - feature: *storage
44
+ quantity: 10
45
+ - feature: *ssl
46
+ max: &max
47
+ name: Max
48
+ features:
49
+ - feature: *chatter
50
+ quantity: 100
51
+ - feature: *storage
52
+ quantity: 25
53
+ - feature: *ssl
54
+ tariff_plans:
55
+ basic_monthly:
56
+ service: *basic
57
+ payment_term: *monthly
58
+ currency: USD
59
+ price: 1200
60
+ plus_monthly:
61
+ service: *plus
62
+ payment_term: *monthly
63
+ currency: USD
64
+ price: 2400
65
+ premium_monthly:
66
+ service: *premium
67
+ payment_term: *monthly
68
+ currency: USD
69
+ price: 4900
70
+ max_monthly:
71
+ service: *solo
72
+ payment_term: *monthly
73
+ currency: USD
74
+ price: 9900
@@ -0,0 +1,24 @@
1
+ # Tariff configuration for clickandpledge
2
+ # http://www.clickandpledge.com/
3
+ #
4
+
5
+ clickandpledge: # namespace
6
+ features:
7
+ payment_system: &payment_system
8
+ name: Payment System
9
+ description: "Payment processing module"
10
+ payment_terms:
11
+ monthly: &monthly
12
+ name: Monthly payments
13
+ periodicity: 1m
14
+ services:
15
+ merchant_account: &merchant_account
16
+ name: Merchant Account
17
+ features:
18
+ - feature: *payment_system
19
+ tariff_plans:
20
+ merchant_account_monthly:
21
+ service: *merchant_account
22
+ payment_term: *monthly
23
+ currency: USD # ISO 4217
24
+ price: 2500
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # Demo of configuration file reading and parsing
4
+ require 'yaml'
5
+
6
+ PRESET_FILE = 'presets.yml'
7
+ # Reads settings from specified file with applied presets.yml
8
+ def read_settings(filename)
9
+ raw_config = [File.read(PRESET_FILE), File.read(filename)].join("\n")
10
+ YAML.load(raw_config)
11
+ end
12
+
13
+ Dir["*.yml"].each do |file|
14
+ puts "file: #{file}\n============\n"
15
+ settings = read_settings(file)
16
+ settings.delete('defaults') unless file == 'presets.yml'
17
+ puts settings.inspect
18
+ puts "\n\n"
19
+ end
@@ -0,0 +1,174 @@
1
+ # Tariff configuration for e-lm
2
+ # http://www.e-lm.com/subscribe.php?theme=normal&textsize=small&lang=us
3
+ #
4
+
5
+ elm:
6
+ features:
7
+ add_programs: &add_programs
8
+ name: "Add programs"
9
+ description: "Add programs"
10
+ add_projects_and_subprojects: &add_projects_and_subprojects
11
+ name: "Add projects and sub-projects"
12
+ description: "Add projects and sub-projects"
13
+ manage_budget: &manage_budget
14
+ name: "Manage budget"
15
+ description: "Manage budget"
16
+ manage_milestones: &manage_milestones
17
+ name: "Manage milestones"
18
+ description: "Manage milestones"
19
+ manage_risks: &manage_risks
20
+ name: "Manage risks"
21
+ description: "Manage risks"
22
+ manage_issues: &manage_issues
23
+ name: "Manage issues"
24
+ description: "Manage issues"
25
+ manage_change_requests: &manage_change_requests
26
+ name: "Manage change requests"
27
+ description: "Manage change requests"
28
+ manage_requirements: &manage_requirements
29
+ name: "Manage requirements"
30
+ description: "Manage requirements"
31
+ manage_traceability: &manage_traceability
32
+ name: "Manage traceability"
33
+ description: "Manage traceability"
34
+ manage_testcases: &manage_testcases
35
+ name: "Manage test-cases"
36
+ description: "Manage test-cases"
37
+ manage_test_results: &manage_test_results
38
+ name: "Manage test results"
39
+ description: "Manage test results"
40
+ manage_defects: &manage_defects
41
+ name: "Manage defects"
42
+ description: "Manage defects"
43
+ manage_products: &manage_products
44
+ name: "Manage products"
45
+ description: "Manage products"
46
+ manage_releases_roadmap: &manage_releases_roadmap
47
+ name: "Manage releases (roadmap)"
48
+ description: "Manage releases (roadmap)"
49
+ manage_features: &manage_features
50
+ name: "Manage features"
51
+ description: "Manage features"
52
+ manage_release_notes: &manage_release_notes
53
+ name: "Manage release notes"
54
+ description: "Manage release notes"
55
+ add_edit_or_delete_users: &add_edit_or_delete_users
56
+ name: "Add, edit or delete users"
57
+ description: "Add, edit or delete users"
58
+ set_the_licenses_a_user_has_accees_to: &set_the_licenses_a_user_has_accees_to
59
+ name: "Set the licenses a user has accees to"
60
+ description: "Set the licenses a user has accees to"
61
+ add_users_to_access_control_groups: &add_users_to_access_control_groups
62
+ name: "Add users to access control groups"
63
+ description: "Add users to access control groups"
64
+ define_report_templates: &define_report_templates
65
+ name: "Define report templates"
66
+ description: "Define report templates"
67
+ define_lifecycles_workflow: &define_lifecycles_workflow
68
+ name: "Define lifecycles (workflow)"
69
+ description: "Define lifecycles (workflow)"
70
+ define_access_control_groups: &define_access_control_groups
71
+ name: "Define access control groups"
72
+ description: "Define access control groups"
73
+ services:
74
+ program_project: &program_project
75
+ name: "Program & Project Management"
76
+ features:
77
+ - feature: *add_programs
78
+ - feature: *add_projects_and_subprojects
79
+ - feature: *manage_budget
80
+ - feature: *manage_milestones
81
+ - feature: *manage_risks
82
+ - feature: *manage_issues
83
+ - feature: *manage_change_requests
84
+ scope: &scope
85
+ name: Scope Management
86
+ features:
87
+ - feature: *add_programs
88
+ - feature: *add_projects_and_subprojects
89
+ - feature: *manage_change_requests
90
+ - feature: *manage_requirements
91
+ - feature: *manage_traceability
92
+ test: &test
93
+ name: Test Management
94
+ features:
95
+ - feature: *add_programs
96
+ - feature: *add_projects_and_subprojects
97
+ - feature: *manage_traceability
98
+ - feature: *manage_testcases
99
+ - feature: *manage_test_results
100
+ - feature: *manage_defects
101
+ - feature: *manage_products
102
+ product: &product
103
+ name: Product Management
104
+ features:
105
+ - feature: *add_programs
106
+ - feature: *manage_issues
107
+ - feature: *manage_change_requests
108
+ - feature: *manage_defects
109
+ - feature: *manage_products
110
+ - feature: *manage_releases_roadmap
111
+ - feature: *manage_features
112
+ - feature: *manage_release_notes
113
+ account: &account
114
+ name: Account Management
115
+ features:
116
+ - feature: *add_edit_or_delete_users
117
+ - feature: *set_the_licenses_a_user_has_accees_to
118
+ - feature: *add_users_to_access_control_groups
119
+ system: &system
120
+ name: System Administration
121
+ features:
122
+ - feature: *add_programs
123
+ - feature: *add_projects_and_subprojects
124
+ - feature: *manage_budget
125
+ - feature: *manage_milestones
126
+ - feature: *manage_risks
127
+ - feature: *manage_issues
128
+ - feature: *manage_change_requests
129
+ - feature: *manage_requirements
130
+ - feature: *manage_traceability
131
+ - feature: *manage_testcases
132
+ - feature: *manage_test_results
133
+ - feature: *manage_defects
134
+ - feature: *manage_products
135
+ - feature: *manage_releases_roadmap
136
+ - feature: *manage_features
137
+ - feature: *manage_release_notes
138
+ - feature: *add_edit_or_delete_users
139
+ - feature: *set_the_licenses_a_user_has_accees_to
140
+ - feature: *add_users_to_access_control_groups
141
+ - feature: *define_report_templates
142
+ - feature: *define_lifecycles_workflow
143
+ - feature: *define_access_control_groups
144
+ tariff_plans:
145
+ program_project_monthly:
146
+ service: *program_project
147
+ payment_term: *monthly
148
+ currency: USD
149
+ price: 1400
150
+ scope_monthly:
151
+ service: *scope
152
+ payment_term: *monthly
153
+ currency: USD
154
+ price: 2700
155
+ test_monthly:
156
+ service: *test
157
+ payment_term: *monthly
158
+ currency: USD
159
+ price: 3900
160
+ product_monthly:
161
+ service: *product
162
+ payment_term: *monthly
163
+ currency: USD
164
+ price: 8900
165
+ account_monthly:
166
+ service: *account
167
+ payment_term: *monthly
168
+ currency: USD
169
+ price: 14900
170
+ system_monthly:
171
+ service: *system
172
+ payment_term: *monthly
173
+ currency: USD
174
+ price: 14900