Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Supports Active Record and uses Rails built in caching

  • Loading branch information...
commit 14cd68a1b5f144f6869d77435f2cdc6d42008834 1 parent cd56186
Jason Waldrip authored
1  .gitignore
View
@@ -1,3 +1,4 @@
+*.gem
.bundle/
log/*.log
pkg/
2  .idea/misc.xml
View
@@ -19,6 +19,6 @@
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
- <component name="ProjectRootManager" version="2" project-jdk-name="ruby-1.9.3-p125" project-jdk-type="RUBY_SDK" />
+ <component name="ProjectRootManager" version="2" project-jdk-name="ruby-1.9.3-p194" project-jdk-type="RUBY_SDK" />
</project>
83 .idea/stripe_rails.iml
View
@@ -4,49 +4,46 @@
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" scope="PROVIDED" name="actionmailer (v3.2.5, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="actionpack (v3.2.5, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="activemodel (v3.2.5, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="activerecord (v3.2.5, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="activeresource (v3.2.5, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="activesupport (v3.2.5, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="arel (v3.0.2, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="builder (v3.0.0, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="bundler (v1.1.4, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.1.3, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="erubis (v2.7.0, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="hike (v1.2.1, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="i18n (v0.6.0, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="journey (v1.0.3, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="jquery-rails (v2.0.2, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="json (v1.7.3, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="mail (v2.4.4, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="mime-types (v1.18, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="mongoid (v3.0.0.rc, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="moped (v1.0.0.rc, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="multi_json (v1.3.6, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="origin (v1.0.0.rc, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="polyglot (v0.3.3, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rack (v1.4.1, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rack-cache (v1.2, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rack-ssl (v1.3.2, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rack-test (v0.6.1, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rails (v3.2.5, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="railties (v3.2.5, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rake (v0.9.2.2, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rdoc (v3.12, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rest-client (v1.6.7, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rspec (v2.10.0, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rspec-core (v2.10.1, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v2.10.0, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v2.10.1, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="rspec-rails (v2.10.1, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="sprockets (v2.1.3, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="stripe (v1.7.0, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="thor (v0.15.2, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="tilt (v1.3.3, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="treetop (v1.4.10, ruby-1.9.3-p125) [gem]" level="application" />
- <orderEntry type="library" scope="PROVIDED" name="tzinfo (v0.3.33, ruby-1.9.3-p125) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="actionmailer (v3.2.5, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="actionpack (v3.2.5, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="activemodel (v3.2.5, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="activerecord (v3.2.5, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="activeresource (v3.2.5, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="activesupport (v3.2.5, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="arel (v3.0.2, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="builder (v3.0.0, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.2.0.pre.1, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.1.3, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="erubis (v2.7.0, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="hike (v1.2.1, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="i18n (v0.6.0, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="journey (v1.0.3, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="jquery-rails (v2.0.2, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="json (v1.7.3, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="mail (v2.4.4, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="mime-types (v1.19, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="multi_json (v1.3.6, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="polyglot (v0.3.3, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rack (v1.4.1, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rack-cache (v1.2, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rack-ssl (v1.3.2, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rack-test (v0.6.1, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rails (v3.2.8, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="railties (v3.2.5, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rake (v0.9.2.2, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rdoc (v3.12, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rest-client (v1.6.7, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v2.10.0, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v2.10.1, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v2.10.0, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v2.10.1, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="rspec-rails (v2.10.1, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="sprockets (v2.1.3, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="stripe (v1.7.1, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="thor (v0.15.2, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="tilt (v1.3.3, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="treetop (v1.4.10, ruby-1.9.3-p194) [gem]" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="tzinfo (v0.3.33, ruby-1.9.3-p194) [gem]" level="application" />
</component>
</module>
326 .idea/workspace.xml
View
@@ -2,7 +2,28 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="a272a977-ad9c-42e3-ae92-f3cbf41f8c93" name="Default" comment="">
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/models/stripe_rails/stripe_customer.rb" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/db/migrate/20120822045452_create_stripe_rails_stripe_customers.rb" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/stripe_rails/cache.rb" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/stripe_rails/helpers.rb" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/fixtures/stripe_rails/stripe_customers.yml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/unit/stripe_rails/stripe_customer_test.rb" />
+ <change type="DELETED" beforePath="$PROJECT_DIR$/app/models/stripe_rails/charge.rb" afterPath="" />
+ <change type="DELETED" beforePath="$PROJECT_DIR$/app/models/stripe_rails/customer.rb" afterPath="" />
+ <change type="DELETED" beforePath="$PROJECT_DIR$/app/models/stripe_rails/invoice.rb" afterPath="" />
+ <change type="DELETED" beforePath="$PROJECT_DIR$/db/migrate/20120608044024_create_stripe_rails_customers.rb" afterPath="" />
+ <change type="DELETED" beforePath="$PROJECT_DIR$/lib/stripe_rails/errors.rb" afterPath="" />
+ <change type="DELETED" beforePath="$PROJECT_DIR$/lib/stripe_rails/pci_compliance.rb" afterPath="" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/stripe_rails.iml" afterPath="$PROJECT_DIR$/.idea/stripe_rails.iml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.gitignore" afterPath="$PROJECT_DIR$/.gitignore" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile.lock" afterPath="$PROJECT_DIR$/Gemfile.lock" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.textile" afterPath="$PROJECT_DIR$/README.textile" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/stripe_rails.rb" afterPath="$PROJECT_DIR$/lib/stripe_rails.rb" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/stripe_rails/acts_as_customer.rb" afterPath="$PROJECT_DIR$/lib/stripe_rails/acts_as_customer.rb" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/stripe_rails/engine.rb" afterPath="$PROJECT_DIR$/lib/stripe_rails/engine.rb" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/stripe_rails/version.rb" afterPath="$PROJECT_DIR$/lib/stripe_rails/version.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/stripe_rails.gemspec" afterPath="$PROJECT_DIR$/stripe_rails.gemspec" />
</list>
<ignored path="stripe_rails.iws" />
@@ -25,17 +46,17 @@
</component>
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="callbacks_controller.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/app/controllers/stripe_rails/callbacks_controller.rb">
+ <file leaf-file-name="cache.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/lib/stripe_rails/cache.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="21" column="0" selection-start="623" selection-end="623" vertical-scroll-proportion="0.0">
+ <state line="5" column="60" selection-start="123" selection-end="123" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="routes.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/config/routes.rb">
+ <file leaf-file-name="callbacks_controller.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/controllers/stripe_rails/callbacks_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
@@ -43,73 +64,73 @@
</provider>
</entry>
</file>
- <file leaf-file-name="customer.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/app/models/stripe_rails/customer.rb">
+ <file leaf-file-name="api_resource.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$USER_HOME$/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/stripe-1.7.1/lib/stripe/api_resource.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="92" column="23" selection-start="2308" selection-end="2308" vertical-scroll-proportion="-19.846153">
+ <state line="21" column="36" selection-start="670" selection-end="670" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="README.textile" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/README.textile">
+ <file leaf-file-name="stripe.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$USER_HOME$/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/stripe-1.7.1/lib/stripe.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="46" column="6" selection-start="1871" selection-end="1871" vertical-scroll-proportion="0.0">
+ <state line="180" column="31" selection-start="5168" selection-end="5188" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="stripe_rails.gemspec" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/stripe_rails.gemspec">
+ <file leaf-file-name="stripe_object.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$USER_HOME$/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/stripe-1.7.1/lib/stripe/stripe_object.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="20" selection-start="317" selection-end="317" vertical-scroll-proportion="0.18223235">
+ <state line="5" column="26" selection-start="90" selection-end="112" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="version.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails/version.rb">
+ <file leaf-file-name="helpers.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/lib/stripe_rails/helpers.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="3" column="31" selection-start="54" selection-end="77" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="20120608044024_create_stripe_rails_customers.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/db/migrate/20120608044024_create_stripe_rails_customers.rb">
+ <file leaf-file-name="acts_as_customer.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/lib/stripe_rails/acts_as_customer.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="4" column="19" selection-start="154" selection-end="154" vertical-scroll-proportion="0.0">
+ <state line="54" column="32" selection-start="1701" selection-end="1701" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="acts_as_customer.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails/acts_as_customer.rb">
+ <file leaf-file-name="stripe_customer.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/models/stripe_rails/stripe_customer.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="39" column="31" selection-start="1242" selection-end="1257" vertical-scroll-proportion="0.0">
+ <state line="0" column="18" selection-start="18" selection-end="18" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="pci_compliance.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails/pci_compliance.rb">
+ <file leaf-file-name="README.textile" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/README.textile">
<provider selected="true" editor-type-id="text-editor">
- <state line="4" column="3" selection-start="177" selection-end="177" vertical-scroll-proportion="0.0">
+ <state line="14" column="178" selection-start="676" selection-end="676" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="errors.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails/errors.rb">
+ <file leaf-file-name=".gitignore" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
- <state line="40" column="11" selection-start="720" selection-end="720" vertical-scroll-proportion="0.0">
+ <state line="0" column="1" selection-start="1" selection-end="1" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -128,22 +149,22 @@
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
- <option value="$PROJECT_DIR$/app/models/stripe_rails/charge.rb" />
- <option value="$PROJECT_DIR$/lib/stripe_rails/errors.rb" />
- <option value="$PROJECT_DIR$/lib/generators/stripe_callback/USAGE" />
+ <option value="$PROJECT_DIR$/README.rdoc" />
+ <option value="$PROJECT_DIR$/lib/stripe_rails/acts_as_customer_mongoid.rb" />
+ <option value="$PROJECT_DIR$/app/models/stripe_rails/customer.rb" />
+ <option value="$PROJECT_DIR$/stripe_rails.gemspec" />
<option value="$PROJECT_DIR$/lib/stripe_rails/engine.rb" />
- <option value="$PROJECT_DIR$/lib/stripe_rails/callback.rb" />
- <option value="$PROJECT_DIR$/app/stripe_callbacks/ping_callback.rb" />
- <option value="$PROJECT_DIR$/lib/generators/stripe_callback/stripe_callback_generator.rb" />
- <option value="$PROJECT_DIR$/lib/stripe_rails/autoload_const_defined.rb" />
- <option value="$PROJECT_DIR$/lib/stripe_rails.rb" />
- <option value="$PROJECT_DIR$/app/controllers/stripe_rails/callbacks_controller.rb" />
+ <option value="$PROJECT_DIR$/lib/stripe_rails/version.rb" />
+ <option value="$PROJECT_DIR$/lib/stripe_rails/api_resource.rb" />
<option value="$PROJECT_DIR$/db/migrate/20120608044024_create_stripe_rails_customers.rb" />
- <option value="$PROJECT_DIR$/README.rdoc" />
+ <option value="$PROJECT_DIR$/db/migrate/20120822045452_create_stripe_rails_stripe_customers.rb" />
+ <option value="$PROJECT_DIR$/app/models/stripe_rails/stripe_customer.rb" />
+ <option value="$PROJECT_DIR$/lib/stripe_rails/helpers.rb" />
+ <option value="$PROJECT_DIR$/lib/stripe_rails.rb" />
<option value="$PROJECT_DIR$/lib/stripe_rails/acts_as_customer.rb" />
- <option value="$PROJECT_DIR$/app/models/stripe_rails/customer.rb" />
+ <option value="$PROJECT_DIR$/lib/stripe_rails/cache.rb" />
<option value="$PROJECT_DIR$/README.textile" />
- <option value="$PROJECT_DIR$/stripe_rails.gemspec" />
+ <option value="$PROJECT_DIR$/.gitignore" />
</list>
</option>
</component>
@@ -178,6 +199,16 @@
<sortByType />
</navigator>
<panes>
+ <pane id="Scope">
+ <subPane subId="Project Files">
+ <PATH>
+ <PATH_ELEMENT USER_OBJECT="Root">
+ <option name="myItemId" value="" />
+ <option name="myItemType" value="" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </pane>
<pane id="ProjectPane">
<subPane>
<PATH>
@@ -185,6 +216,10 @@
<option name="myItemId" value="stripe_rails" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="External Libraries" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
+ </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -228,14 +263,98 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
- </subPane>
- </pane>
- <pane id="Scope">
- <subPane subId="Project Files">
<PATH>
- <PATH_ELEMENT USER_OBJECT="Root">
- <option name="myItemId" value="" />
- <option name="myItemType" value="" />
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="db" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="migrate" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_callbacks" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="models" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="controllers" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="stripe_rails" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
@@ -245,10 +364,17 @@
<component name="PropertiesComponent">
<property name="options.splitter.main.proportions" value="0.3" />
<property name="WebServerToolWindowFactoryState" value="false" />
- <property name="options.lastSelected" value="project.propVCSSupport.Mappings" />
+ <property name="options.lastSelected" value="org.jetbrains.plugins.ruby.settings.RubyIdeSdkConfigurable" />
<property name="FullScreen" value="false" />
- <property name="options.searchVisible" value="true" />
<property name="options.splitter.details.proportions" value="0.2" />
+ <property name="options.searchVisible" value="true" />
+ </component>
+ <component name="RecentsManager">
+ <key name="MoveFile.RECENT_KEYS">
+ <recent name="$PROJECT_DIR$/lib/stripe_rails" />
+ <recent name="$PROJECT_DIR$/lib/stripe" />
+ <recent name="$PROJECT_DIR$/lib" />
+ </key>
</component>
<component name="RunManager">
<configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
@@ -277,9 +403,7 @@
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
- <method>
- <option name="RakeTask" enabled="false" />
- </method>
+ <method />
</configuration>
<configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
<module name="" />
@@ -297,9 +421,7 @@
</EXTENSION>
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
- <method>
- <option name="RakeTask" enabled="false" />
- </method>
+ <method />
</configuration>
<configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
<predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
@@ -323,9 +445,7 @@
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
- <method>
- <option name="RakeTask" enabled="false" />
- </method>
+ <method />
</configuration>
<configuration default="true" type="CucumberRunConfigurationType" factoryName="Cucumber">
<predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
@@ -358,9 +478,7 @@
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
- <method>
- <option name="RakeTask" enabled="false" />
- </method>
+ <method />
</configuration>
<list size="0" />
</component>
@@ -380,6 +498,7 @@
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<option name="FORCE_UPDATE" value="false" />
+ <option name="IGNORE_EXTERNALS" value="false" />
<configuration useDefault="true">$USER_HOME$/.subversion_IDEA</configuration>
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
</component>
@@ -395,17 +514,18 @@
<frame x="0" y="22" width="1680" height="1024" extended-state="0" />
<editor active="true" />
<layout>
- <window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+ <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Heroku" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.29963234" sideWeight="0.67098165" order="0" side_tool="false" content_ui="combo" />
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.21909425" sideWeight="0.3322546" order="1" side_tool="true" content_ui="tabs" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.21909425" sideWeight="0.66019416" order="0" side_tool="false" content_ui="combo" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
@@ -437,7 +557,6 @@
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
- <option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
@@ -447,7 +566,6 @@
<option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
<option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
<option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
- <option name="CREATE_PATCH_EXPAND_DETAILS_DEFAULT" value="true" />
<option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
<option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
@@ -470,102 +588,114 @@
<breakpoint-manager />
</component>
<component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/app/stripe_callbacks/ping_callback.rb">
+ <entry file="file://$USER_HOME$/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/stripe-1.7.1/lib/stripe/customer.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="7" column="4" selection-start="103" selection-end="103" vertical-scroll-proportion="0.0" />
+ <state line="1" column="22" selection-start="36" selection-end="36" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails/callback.rb">
+ <entry file="file://$USER_HOME$/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/bundler/gems/stripe-ruby-462d99c34d27/lib/stripe.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="11" column="0" selection-start="261" selection-end="261" vertical-scroll-proportion="0.0" />
+ <state line="221" column="52" selection-start="5494" selection-end="5538" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails/autoload_const_defined.rb">
+ <entry file="file://$PROJECT_DIR$/app/stripe_callbacks/ping_callback.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="4" column="10" selection-start="108" selection-end="108" vertical-scroll-proportion="0.0" />
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails.rb">
+ <entry file="file://$PROJECT_DIR$/lib/stripe_rails/callback.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="3" column="44" selection-start="142" selection-end="142" vertical-scroll-proportion="0.0" />
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails/pci_compliance.rb">
+ <entry file="file://$PROJECT_DIR$/db/migrate/20120822045452_create_stripe_rails_stripe_customers.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="4" column="3" selection-start="177" selection-end="177" vertical-scroll-proportion="0.0" />
+ <state line="6" column="3" selection-start="180" selection-end="180" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails/errors.rb">
+ <entry file="file://$PROJECT_DIR$/lib/stripe_rails.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="40" column="11" selection-start="720" selection-end="720" vertical-scroll-proportion="0.0" />
+ <state line="1" column="29" selection-start="58" selection-end="58" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/config/routes.rb">
+ <entry file="file://$PROJECT_DIR$/lib/stripe_rails/helpers.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="3" column="31" selection-start="54" selection-end="77" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$USER_HOME$/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/cookie.rb">
+ <entry file="file://$PROJECT_DIR$/lib/stripe_rails/acts_as_customer.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="45" column="10" selection-start="1551" selection-end="1551" vertical-scroll-proportion="0.35079727">
+ <state line="54" column="32" selection-start="1701" selection-end="1701" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$USER_HOME$/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/actionpack-3.2.5/lib/action_dispatch/middleware/session/cookie_store.rb">
+ <entry file="file://$USER_HOME$/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/stripe-1.7.1/lib/stripe/stripe_object.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="42" column="41" selection-start="2060" selection-end="2060" vertical-scroll-proportion="0.3621868">
+ <state line="5" column="26" selection-start="90" selection-end="112" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/db/migrate/20120608044024_create_stripe_rails_customers.rb">
+ <entry file="file://$USER_HOME$/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/stripe-1.7.1/lib/stripe.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="4" column="19" selection-start="154" selection-end="154" vertical-scroll-proportion="0.0">
+ <state line="180" column="31" selection-start="5168" selection-end="5188" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails/acts_as_customer.rb">
+ <entry file="file://$USER_HOME$/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/stripe-1.7.1/lib/stripe/api_resource.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="39" column="31" selection-start="1242" selection-end="1257" vertical-scroll-proportion="0.0">
+ <state line="21" column="36" selection-start="670" selection-end="670" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/controllers/stripe_rails/callbacks_controller.rb">
+ <entry file="file://$PROJECT_DIR$/lib/stripe_rails/cache.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="21" column="0" selection-start="623" selection-end="623" vertical-scroll-proportion="0.0">
+ <state line="5" column="60" selection-start="123" selection-end="123" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/models/stripe_rails/customer.rb">
+ <entry file="file://$PROJECT_DIR$/app/controllers/stripe_rails/callbacks_controller.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="92" column="23" selection-start="2308" selection-end="2308" vertical-scroll-proportion="-19.846153">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/lib/stripe_rails/version.rb">
+ <entry file="file://$PROJECT_DIR$/app/models/stripe_rails/stripe_customer.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="0" column="18" selection-start="18" selection-end="18" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.textile">
<provider selected="true" editor-type-id="text-editor">
- <state line="46" column="6" selection-start="1871" selection-end="1871" vertical-scroll-proportion="0.0">
+ <state line="14" column="178" selection-start="676" selection-end="676" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/stripe_rails.gemspec">
+ <entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="20" selection-start="317" selection-end="317" vertical-scroll-proportion="0.18223235">
+ <state line="0" column="1" selection-start="1" selection-end="1" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
16 Gemfile.lock
View
@@ -1,10 +1,9 @@
PATH
remote: .
specs:
- stripe_rails (0.0.1)
+ stripe_rails (0.0.2)
jquery-rails
- mongoid (~> 3.0.0.rc)
- rails (~> 3.2.5)
+ rails
stripe
GEM
@@ -52,15 +51,8 @@ GEM
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.18)
- mongoid (3.0.0.rc)
- activemodel (~> 3.1)
- moped (~> 1.0.0.rc)
- origin (~> 1.0.0.rc)
- tzinfo (~> 0.3.22)
- moped (1.0.0.rc)
+ mime-types (1.19)
multi_json (1.3.6)
- origin (1.0.0.rc)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
@@ -106,7 +98,7 @@ GEM
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- stripe (1.7.0)
+ stripe (1.7.1)
multi_json (~> 1.1)
rest-client (~> 1.4)
thor (0.15.2)
2  README.textile
View
@@ -12,7 +12,7 @@ gem 'stripe_rails'
h3. Compatibility
-The gem works with rails 3.2.x and mongoid 3.0.0, support for active record will be coming in the very next release.
+The gem works with rails 3.2.x and mongoid and active:record when using model relationships. It uses rails cache to cache the stripe object for 1 hour on subsequent get requests.
h2. Usage
27 app/models/stripe_rails/charge.rb
View
@@ -1,27 +0,0 @@
-module StripeRails
- class Charge
-
- def initialize(customer)
- @customer = customer
- raise Stripe::InvalidObjectError, 'Object is not a stripe customer!' unless @customer.kind_of? Stripe::Customer
- end
-
- def all(options = {})
- Stripe::Charge.all(options.merge({ customer: @customer.id }))
- end
-
- def create(amount, options = {})
- Stripe::Charge.create(options.merge({ amount: amount, customer: @customer.id }))
- end
-
- def retrieve(id)
- charge = Stripe::Charge.retrieve(id)
- raise Stripe::ChargeAssociationError, 'The charge does not belong to this customer!' unless charge.customer == @customer.id
- end
-
- def refund(id)
- retrieve(id).refund
- end
-
- end
-end
135 app/models/stripe_rails/customer.rb
View
@@ -1,135 +0,0 @@
-module StripeRails
- class Customer
-
- # Support for mongoid
- include Mongoid::Document
- include Mongoid::Timestamps
-
- store_in collection: "stripe_customers"
-
- field :data, type: String, default: -> { nil }
- field :unit_price, type: Float
- field :_id, type: String, default: -> { nil }
-
- attr_readonly :_id
-
- def charges
- StripeRails::Charge.new(@customer)
- end
-
- ActionDispatch::Session::CookieStore
-
- def invoices
- StripeRails::Invoice.new(@customer)
- end
-
- def initialize(attributes={}, options={})
- attributes = { data: attributes.to_json.to_a.pack('m') } if self.new_record?
- super(attributes,options)
- end
-
- # All returns items from the stripe API
- def self.all(*args)
- return super(nil) if args.first && args.first[:local] == true
- Stripe::Customer.all(*args)
- end
-
- def self.find(id)
- customer = self.find_or_initialize_by(_id: id)
- customer.save if customer.new_record?
- customer
- end
-
- # Privatize methods that can potential break caching and updating
- class << self
- alias :retrieve :find
- private :find_by
- end
-
- private :attributes=, :update_attributes, :update_attributes!
-
- def method_missing(meth, *args, &block)
- if @customer.respond_to?(meth.to_sym)
- value = @customer.send meth, *args
- refresh_from @customer
- value
- elsif meth =~ /=$/ && %w(card= description= coupon= email=).include?(meth.to_s)
- value = @customer.send meth, *args
- refresh_from @customer
- value
- else
- super
- end
- end
-
- # Callbacks
- after_initialize :stripe_read
- before_update :stripe_update
- before_destroy :stripe_destroy
-
- def delete(options={})
- @customer.delete
- super(options)
- end
-
- def refresh!
- @customer = Stripe::Customer.retrieve(id)
- send :data=, @customer.to_json.to_a.pack('m')
- save
- self
- end
-
- def days_remaining_in_trial
- if subscription && subscription.status == 'trialing'
- ((Time.at(subscription.trial_end) - Time.now) / 24 / 60 / 60).ceil
- elsif subscription
- 0
- else
- nil
- end
- end
-
- # Using a callback so that we can call create and save on a new record
- def create_customer
- params = {}
- params['description'] = stripe_customer.stripe_description if stripe_customer.respond_to? :stripe_description
- refresh_from Stripe::Customer.create(params)
-
- if stripe_customer.respond_to? :stripe_subscription_plan
- @customer.update_subscription({ plan: stripe_customer.stripe_subscription_plan })
- refresh_from @customer
- end
-
- self._id = @customer.id
- self.unit_price = stripe_customer.stripe_unit_price
-
- save
- end
-
- private
-
- def refresh_from(stripe_object)
- raise Stripe::InvalidObjectError, "Is not a stripe customer!" unless stripe_object.kind_of? Stripe::Customer
- @customer = stripe_object
- send :data=, @customer.to_json.to_a.pack('m')
- self
- end
-
- def stripe_read
- if !new_record? && updated_at && updated_at < 1.day.ago
- self.refresh!
- else
- @customer = Stripe::Customer.construct_from(JSON.parse data.unpack('m').first ) if data && data.unpack('m').first.present?
- end
- end
-
- def stripe_update
- refresh_from @customer.save
- end
-
- def stripe_destroy
- @customer.delete
- end
-
- end
-end
5 app/models/stripe_rails/invoice.rb
View
@@ -1,5 +0,0 @@
-module StripeRails
- class Invoice < ActiveRecord::Base
- # attr_accessible :title, :body
- end
-end
7 app/models/stripe_rails/stripe_customer.rb
View
@@ -0,0 +1,7 @@
+module StripeRails
+ if Object.const_defined? 'ActiveRecord'
+ class StripeCustomer < ActiveRecord::Base
+
+ end
+ end
+end
10 db/migrate/20120608044024_create_stripe_rails_customers.rb
View
@@ -1,10 +0,0 @@
-class CreateStripeRailsCharges < ActiveRecord::Migration
- def change
- create_table :stripe_rails_charges do |t|
- t.text :data
- t.float :unit_price
- t.string :_id
- t.timestamps
- end
- end
-end
7 db/migrate/20120822045452_create_stripe_rails_stripe_customers.rb
View
@@ -0,0 +1,7 @@
+class CreateStripeRailsCustomers < ActiveRecord::Migration
+ def change
+ create_table :stripe_rails_stripe_customers do |t|
+ t.primary :stripe_customer_id
+ end
+ end
+end
6 lib/stripe_rails.rb
View
@@ -1,7 +1,7 @@
-require "stripe_rails/engine"
-require "stripe_rails/pci_compliance"
-require "stripe_rails/errors"
+require "stripe_rails/cache"
+require "stripe_rails/helpers"
require "stripe_rails/autoload_const_defined"
+require "stripe_rails/engine"
module StripeRails
end
27 lib/stripe_rails/acts_as_customer.rb
View
@@ -2,11 +2,21 @@ module StripeRails::ActsAsCustomer
extend ActiveSupport::Concern
included do
- has_one :stripe, class_name: 'StripeRails::Customer', autobuild: true, dependent: :destroy, as: :stripe_customer
- before_create :create_stripe_customer
- StripeRails::Customer.send :belongs_to, :stripe_customer, class_name: self.to_s, polymorphic: true
- StripeRails::Customer.send :validates_presence_of, :stripe_customer_id
+ # Mongoid
+ if self.respond_to?(:field)
+ field :stripe_customer_id
+ elsif self.kind_of(ActiveRecord::Base)
+ StripeRails::StripeCustomer.send :belongs_to, :stripe_customerable, class_name: self.to_s, polymorphic: true, dependent: :destroy
+ has_one :stripe_customer, class_name: 'StripeRails::StripeCustomer', as: :stripe_customerable
+ delegate :stripe_customer_id, :stripe_customer
+ else
+ raise "ORM is not supported, use ActiveRecord or Mongoid"
+ end
+
+ def stripe
+ Stripe::Customer.retrieve(stripe_customer_id) if stripe_customer_id
+ end
def self.stripe_description(method)
send :define_method, :stripe_description do
@@ -37,7 +47,14 @@ def self.stripe_units(collection)
end
def create_stripe_customer
- self.stripe.create_customer
+ return false if stripe
+ params = {}
+ params['description'] = stripe_description if respond_to? :stripe_description
+ self.stripe_customer_id = Stripe::Customer.create(params).id
+
+ #stripe.update_subscription(plan: stripe_subscription_plan }) if respond_to? :stripe_subscription_plan
+
+ save!
end
end
25 lib/stripe_rails/cache.rb
View
@@ -0,0 +1,25 @@
+module Stripe
+ class Customer < APIResource
+
+ def refresh
+
+ key = Digest::MD5.hexdigest "#{url}_#{@api_key}_stripe"
+
+ value = Rails.cache.fetch key, expires_in: 1.hour, force: @force, compress: true do
+ @force = false
+ super.to_json
+ end
+
+ response = Util.symbolize_names Stripe::JSON.load value
+
+ refresh_from(response, @api_key)
+
+ end
+
+ def refresh!
+ @force = true
+ refresh
+ end
+
+ end
+end
5 lib/stripe_rails/engine.rb
View
@@ -7,10 +7,5 @@ class Engine < Rails::Engine
config.autoload_paths += Dir["#{config.root}/lib**/"]
config.autoload_paths += Dir["#{config.root}/stripe_callbacks/**"]
- initializer "Pci Compliance" do
- ::Stripe::Token.send(:include, Stripe::PciCompliance) if Rails.application.config.respond_to?(:stripe_pci_compliance) && Rails.application.config.stripe_pci_compliance
- Rails.application.config.autoload_paths += Dir["#{Rails.root.to_s}/app/stripe_callbacks/**"]
- end
-
end
end
45 lib/stripe_rails/errors.rb
View
@@ -1,45 +0,0 @@
-module Stripe
-
- class PciComplianceError < StandardError
- def initialize(msg)
- super
- end
- end
-
- class InvalidObjectError < StandardError
- def initialize(msg)
- super
- end
- end
-
- class CollectionInvalidError < StandardError
- def initialize(msg)
- super
- end
- end
-
- class PriceInvalidError < StandardError
- def initialize(msg)
- super
- end
- end
-
- class ChargeAssociationError < StandardError
- def initialize(msg)
- super
- end
- end
-
- class InvalidEventError < StandardError
- def initialize(msg='Event is invalid!')
- super
- end
- end
-
- class InvalidCallbackResponseError < StandardError
- def initialize(msg='Response must be a hash!')
- super
- end
- end
-
-end
15 lib/stripe_rails/helpers.rb
View
@@ -0,0 +1,15 @@
+module Stripe
+ class Customer < APIResource
+
+ def days_remaining_in_trial
+ if subscription && subscription.status == 'trialing'
+ ((Time.at(subscription.trial_end) - Time.now) / 24 / 60 / 60).ceil
+ elsif subscription
+ 0
+ else
+ nil
+ end
+ end
+
+ end
+end
5 lib/stripe_rails/pci_compliance.rb
View
@@ -1,5 +0,0 @@
-module Stripe::PciCompliance
- ::Stripe::Token.send :define_singleton_method, :create do
- raise Stripe::PciComplianceError, "Method disabled due to pci compliance!"
- end
-end
2  lib/stripe_rails/version.rb
View
@@ -1,3 +1,3 @@
module StripeRails
- VERSION = "0.0.1"
+ VERSION = "0.0.2"
end
5 stripe_rails.gemspec
View
@@ -11,14 +11,13 @@ Gem::Specification.new do |s|
s.email = ["jason@waldrip.net"]
s.homepage = "https://github.com/jwaldrip/stripe_rails"
s.summary = "Stripe Rails was built on top of the official stripe gem for easier integration into a rails project."
- s.description = "Stripe Rails was built on top of the official stripe gem to bring ease of use of stripe in your models. The gem also caches the stripe customer response so that if you often use it to check a customers subscription status, it wont have to reach the stripe API on every page load. Lastly, this gem has built in responses for stripe webhooks/callbacks."
+ s.description = "Stripe Rails was built on top of the official stripe gem to bring ease of use of stripe in your models. The gem also uses your applications cache to store objects locally so that you dont have to continuously hit Stripes API, it wont have to reach the stripe API on every page load. Lastly, this gem has built in responses for stripe webhooks/callbacks."
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.textile"]
- s.add_dependency "rails", "~> 3.2.5"
+ s.add_dependency "rails"
s.add_dependency "jquery-rails"
s.add_dependency "stripe"
- s.add_dependency "mongoid", "~> 3.0.0.rc"
s.add_development_dependency "rspec-rails"
11 test/fixtures/stripe_rails/stripe_customers.yml
View
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
9 test/unit/stripe_rails/stripe_customer_test.rb
View
@@ -0,0 +1,9 @@
+require 'test_helper'
+
+module StripeRails
+ class StripeCustomerTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.