nimbleshop_core 0.0.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +13 -0
- data/Rakefile +15 -0
- data/app/assets/images/engines/nimbleshop_authorizedotnet/american_express.png +0 -0
- data/app/assets/images/engines/nimbleshop_authorizedotnet/authorize_net_big.png +0 -0
- data/app/assets/images/engines/nimbleshop_authorizedotnet/authorizedotnet_big.png +0 -0
- data/app/assets/images/engines/nimbleshop_authorizedotnet/discover.png +0 -0
- data/app/assets/images/engines/nimbleshop_authorizedotnet/mastercard.png +0 -0
- data/app/assets/images/engines/nimbleshop_authorizedotnet/visa.png +0 -0
- data/app/assets/images/engines/nimbleshop_cod/cod_small.png +0 -0
- data/app/assets/images/engines/nimbleshop_paypalwp/paypal_big.png +0 -0
- data/app/assets/images/engines/nimbleshop_paypalwp/paypal_small.png +0 -0
- data/app/assets/images/engines/nimbleshop_splitable/splitable.png +0 -0
- data/app/assets/images/engines/nimbleshop_splitable/splitable_big.png +0 -0
- data/app/assets/images/engines/nimbleshop_splitable/splitable_small.png +0 -0
- data/app/assets/javascripts/admin/products/edit.js.coffee +19 -0
- data/app/assets/javascripts/admin/shipping_methods/edit.js.coffee +6 -0
- data/app/assets/javascripts/admin.js +25 -0
- data/app/assets/javascripts/fadeout_success.js.coffee +2 -0
- data/app/assets/javascripts/payment_method.js.coffee +19 -0
- data/app/assets/javascripts/product-group-condition.js.coffee +33 -0
- data/app/assets/javascripts/remove_deletion_of_product_pictures.js.coffee +5 -0
- data/app/assets/javascripts/shipit.js.coffee +10 -0
- data/app/assets/javascripts/twitter_bootstrap.js.coffee +4 -0
- data/app/assets/stylesheets/admin.css +9 -0
- data/app/assets/stylesheets/admin_bootstrap_and_overrides.css.less +38 -0
- data/app/assets/stylesheets/admin_custom.css +104 -0
- data/app/assets/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/app/assets/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/app/controllers/admin/custom_fields_controller.rb +56 -0
- data/app/controllers/admin/link_groups_controller.rb +76 -0
- data/app/controllers/admin/main_controller.rb +9 -0
- data/app/controllers/admin/navigations_controller.rb +49 -0
- data/app/controllers/admin/orders_controller.rb +47 -0
- data/app/controllers/admin/payment_methods_controller.rb +26 -0
- data/app/controllers/admin/product_groups_controller.rb +70 -0
- data/app/controllers/admin/products_controller.rb +71 -0
- data/app/controllers/admin/shipments_controller.rb +19 -0
- data/app/controllers/admin/shipping_methods_controller.rb +93 -0
- data/app/controllers/admin/shipping_zones_controller.rb +62 -0
- data/app/controllers/admin/shops_controller.rb +33 -0
- data/app/controllers/admin_controller.rb +38 -0
- data/app/helpers/admin_helper.rb +83 -0
- data/app/helpers/nimbleshop_helper.rb +43 -0
- data/app/helpers/payment_method_helper.rb +52 -0
- data/app/mailers/admin_mailer.rb +22 -0
- data/app/mailers/mailer.rb +31 -0
- data/app/models/address.rb +69 -0
- data/app/models/country_shipping_zone.rb +36 -0
- data/app/models/creditcard.rb +95 -0
- data/app/models/custom_field.rb +8 -0
- data/app/models/custom_field_answer/field.rb +101 -0
- data/app/models/custom_field_answer.rb +17 -0
- data/app/models/line_item.rb +48 -0
- data/app/models/link.rb +3 -0
- data/app/models/link_group.rb +8 -0
- data/app/models/navigation.rb +7 -0
- data/app/models/order.rb +158 -0
- data/app/models/payment_method.rb +20 -0
- data/app/models/payment_transaction.rb +11 -0
- data/app/models/picture.rb +30 -0
- data/app/models/product.rb +76 -0
- data/app/models/product_group.rb +65 -0
- data/app/models/product_group_condition.rb +8 -0
- data/app/models/regional_shipping_zone.rb +25 -0
- data/app/models/shipment.rb +19 -0
- data/app/models/shipment_carrier.rb +3 -0
- data/app/models/shipping_cost_calculator.rb +9 -0
- data/app/models/shipping_method.rb +103 -0
- data/app/models/shipping_zone.rb +9 -0
- data/app/models/shop.rb +26 -0
- data/app/models/tax_calculator.rb +18 -0
- data/app/observers/order_observer.rb +53 -0
- data/app/uploaders/picture_uploader.rb +65 -0
- data/app/views/admin/custom_fields/_form.html.erb +45 -0
- data/app/views/admin/custom_fields/edit.html.erb +7 -0
- data/app/views/admin/custom_fields/index.html.erb +31 -0
- data/app/views/admin/custom_fields/new.html.erb +7 -0
- data/app/views/admin/link_groups/_form.html.erb +31 -0
- data/app/views/admin/link_groups/_link_group.html.erb +50 -0
- data/app/views/admin/link_groups/_link_group_title.html.erb +5 -0
- data/app/views/admin/link_groups/edit.html.erb +8 -0
- data/app/views/admin/link_groups/index.html.erb +29 -0
- data/app/views/admin/link_groups/new.html.erb +9 -0
- data/app/views/admin/mailer/new_order_notification.text.erb +31 -0
- data/app/views/admin/main/index.html.erb +5 -0
- data/app/views/admin/navigations/new.html.erb +29 -0
- data/app/views/admin/orders/_line_item.html.erb +11 -0
- data/app/views/admin/orders/_line_items.html.erb +39 -0
- data/app/views/admin/orders/_payment_info.html.erb +20 -0
- data/app/views/admin/orders/_shipping_info.html.erb +40 -0
- data/app/views/admin/orders/index.html.erb +33 -0
- data/app/views/admin/orders/show.html.erb +40 -0
- data/app/views/admin/payment_methods/index.html.erb +6 -0
- data/app/views/admin/product_groups/_condition.html.mustache +20 -0
- data/app/views/admin/product_groups/_form.html.erb +72 -0
- data/app/views/admin/product_groups/edit.html.erb +7 -0
- data/app/views/admin/product_groups/index.html.erb +30 -0
- data/app/views/admin/product_groups/new.html.erb +7 -0
- data/app/views/admin/product_groups/show.html.erb +9 -0
- data/app/views/admin/products/_custom_field_answer.html.erb +9 -0
- data/app/views/admin/products/_form.html.erb +69 -0
- data/app/views/admin/products/_handle_pictures.html.erb +32 -0
- data/app/views/admin/products/_pictures.html.erb +33 -0
- data/app/views/admin/products/edit.html.erb +26 -0
- data/app/views/admin/products/index.html.erb +34 -0
- data/app/views/admin/products/new.html.erb +9 -0
- data/app/views/admin/shipping_methods/_form.html.erb +58 -0
- data/app/views/admin/shipping_methods/_shipping_method.html.erb +31 -0
- data/app/views/admin/shipping_methods/edit.html.erb +18 -0
- data/app/views/admin/shipping_methods/new.html.erb +7 -0
- data/app/views/admin/shipping_zones/_form.html.erb +31 -0
- data/app/views/admin/shipping_zones/_shipping_method.html.erb +13 -0
- data/app/views/admin/shipping_zones/_shipping_zone.html.erb +47 -0
- data/app/views/admin/shipping_zones/edit.html.erb +8 -0
- data/app/views/admin/shipping_zones/index.html.erb +16 -0
- data/app/views/admin/shipping_zones/new.html.erb +8 -0
- data/app/views/admin/shops/edit.html.erb +119 -0
- data/app/views/layouts/_admin_footer.html.erb +23 -0
- data/app/views/layouts/_admin_sidebar.html.erb +0 -0
- data/app/views/layouts/_container.html.erb +33 -0
- data/app/views/layouts/_top_nav_bar.html.erb +30 -0
- data/app/views/layouts/admin.html.erb +35 -0
- data/app/views/layouts/payment_method.html.erb +12 -0
- data/app/views/mailer/order_notification_to_buyer.text.erb +31 -0
- data/app/views/mailer/shipment_notification_to_buyer.text.erb +34 -0
- data/config/initializers/001_settings_application.rb +10 -0
- data/config/initializers/002_load_core_extensions.rb +8 -0
- data/config/initializers/field_with_error.rb +2 -0
- data/config/initializers/strip_and_nullify.rb +13 -0
- data/config/initializers/time_formats.rb +1 -0
- data/config/locales/en.yml +61 -0
- data/config/routes.rb +56 -0
- data/db/development.sqlite3 +0 -0
- data/db/migrate/20111022144421_create_product_groups.rb +12 -0
- data/db/migrate/20111022144426_create_products.rb +16 -0
- data/db/migrate/20111022144653_create_orders.rb +21 -0
- data/db/migrate/20111022144725_create_line_items.rb +15 -0
- data/db/migrate/20111022234951_create_shops.rb +20 -0
- data/db/migrate/20111026193227_create_link_groups.rb +12 -0
- data/db/migrate/20111026193435_create_navigations.rb +10 -0
- data/db/migrate/20111031135810_create_links.rb +10 -0
- data/db/migrate/20111106193938_create_custom_fields.rb +10 -0
- data/db/migrate/20111106195112_create_custom_field_answers.rb +14 -0
- data/db/migrate/20111106201548_create_product_group_conditions.rb +12 -0
- data/db/migrate/20111107035350_create_creditcard_transactions.rb +15 -0
- data/db/migrate/20111109190754_create_addresses.rb +24 -0
- data/db/migrate/20111125173344_create_pictures.rb +16 -0
- data/db/migrate/20111201024408_create_shipping_methods.rb +16 -0
- data/db/migrate/20111202143154_create_shipping_zones.rb +17 -0
- data/db/migrate/20111203034020_create_payment_methods.rb +14 -0
- data/db/migrate/20111221190000_create_preferences.rb +14 -0
- data/db/migrate/20120105234047_create_shipments.rb +11 -0
- data/db/migrate/20120105234553_create_shipment_carriers.rb +11 -0
- data/db/migrate/20120606165355_create_delayed_jobs.rb +22 -0
- data/db/production.sqlite3 +0 -0
- data/db/schema.rb +265 -0
- data/db/seeds.rb +1 -0
- data/db/test.sqlite3 +0 -0
- data/lib/assets/javascripts/loading_state_for_buttons.js.coffee +3 -0
- data/lib/assets/javascripts/show_help_on_hover.js.coffee +2 -0
- data/lib/assets/javascripts/utils/autoresize.js.coffee +3 -0
- data/lib/assets/javascripts/utils/focus.js.coffee +3 -0
- data/lib/assets/javascripts/utils/formatNumber.js.coffee +25 -0
- data/lib/assets/javascripts/utils/formatPrice.js.coffee +24 -0
- data/lib/generators/nimbleshop/app/app_generator.rb +84 -0
- data/lib/generators/nimbleshop/app/templates/config/application.yml +61 -0
- data/lib/generators/nimbleshop/app/templates/config/initializers/airbrake.rb +3 -0
- data/lib/generators/nimbleshop/app/templates/config/initializers/cache_images.rb +4 -0
- data/lib/generators/nimbleshop/app/templates/config/initializers/carrierwave.rb +36 -0
- data/lib/generators/nimbleshop/app/templates/config/initializers/delayed_job.rb +15 -0
- data/lib/generators/nimbleshop/app/templates/config/initializers/setup_email.rb +24 -0
- data/lib/nimbleshop/core_ext/activerecord_base.rb +18 -0
- data/lib/nimbleshop/core_ext/filelessio.rb +4 -0
- data/lib/nimbleshop/core_ext/force_ssl.rb +26 -0
- data/lib/nimbleshop/core_ext/mustache_templater_handler.rb +10 -0
- data/lib/nimbleshop/engine.rb +23 -0
- data/lib/nimbleshop/permalink/builder.rb +46 -0
- data/lib/nimbleshop/processor/base.rb +51 -0
- data/lib/nimbleshop/processor.rb +3 -0
- data/lib/nimbleshop/product_group_search/base_field.rb +19 -0
- data/lib/nimbleshop/product_group_search/core_field_strategy.rb +31 -0
- data/lib/nimbleshop/product_group_search/custom_field_strategy.rb +39 -0
- data/lib/nimbleshop/product_group_search/date_field.rb +16 -0
- data/lib/nimbleshop/product_group_search/extension.rb +46 -0
- data/lib/nimbleshop/product_group_search/number_field.rb +17 -0
- data/lib/nimbleshop/product_group_search/text_field.rb +33 -0
- data/lib/nimbleshop/product_group_search.rb +74 -0
- data/lib/nimbleshop/sampledata/data.rb +246 -0
- data/lib/nimbleshop/sampledata/pictures/product1/pic1.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product2/pic1.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product2/pic2.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product3/pic1.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product3/pic2.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product3/pic3.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product3/pic4.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product3/pic5.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product4/pic1.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product4/pic2.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product5/pic1.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product5/pic2.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic1.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic10.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic11.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic12.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic13.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic14.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic15.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic16.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic17.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic2.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic3.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic4.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic5.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic6.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic7.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic8.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product6/pic9.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product7/pic1.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product7/pic2.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product7/pic3.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product8/pic1.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product8/pic2.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product8/pic3.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product8/pic4.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product8/pic5.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product8/pic6.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product8/pic7.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product8/pic8.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product9/pic1.jpg +0 -0
- data/lib/nimbleshop/sampledata/pictures/product9/pic2.jpg +0 -0
- data/lib/nimbleshop/util.rb +60 -0
- data/lib/nimbleshop/version.rb +18 -0
- data/lib/nimbleshop_core.rb +23 -0
- data/lib/tasks/localhost2public.rake +8 -0
- data/lib/tasks/setup.rake +26 -0
- data/test/factories/address_factory.rb +31 -0
- data/test/factories/creditcard_factory.rb +30 -0
- data/test/factories/custom_field_answer_factory.rb +6 -0
- data/test/factories/custom_field_factory.rb +21 -0
- data/test/factories/line_item_factory.rb +7 -0
- data/test/factories/link_factory.rb +6 -0
- data/test/factories/link_group_factory.rb +5 -0
- data/test/factories/navigation_factory.rb +6 -0
- data/test/factories/order_factory.rb +49 -0
- data/test/factories/payment_method_factory.rb +6 -0
- data/test/factories/payment_transaction_factory.rb +42 -0
- data/test/factories/picture_factory.rb +11 -0
- data/test/factories/product_group_condition_factory.rb +40 -0
- data/test/factories/product_group_factory.rb +5 -0
- data/test/factories/products_factory.rb +11 -0
- data/test/factories/shipment_carrier_factory.rb +6 -0
- data/test/factories/shipment_factory.rb +6 -0
- data/test/factories/shipping_method_factory.rb +15 -0
- data/test/factories/shipping_zone_factory.rb +5 -0
- data/test/factories/shop_factory.rb +8 -0
- data/test/fixtures/files/avatar.png +0 -0
- data/test/fixtures/link_groups.yml +13 -0
- data/test/fixtures/payment_methods.yml +39 -0
- data/test/fixtures/shops.yml +15 -0
- data/test/helpers/admin_helper_test.rb +37 -0
- data/test/helpers/nimbleshop_helper_test.rb +17 -0
- data/test/integration/admin/link_groups_acceptance_test.rb +39 -0
- data/test/integration/admin/orders_acceptance_test.rb +63 -0
- data/test/integration/admin/payment_methods_acceptance_test.rb +13 -0
- data/test/integration/admin/product_groups_acceptance_test.rb +89 -0
- data/test/integration/admin/products_acceptance_test.rb +105 -0
- data/test/integration/admin/shipping_methods_acceptance_test.rb +63 -0
- data/test/integration/admin/shipping_zones_acceptance_test.rb +16 -0
- data/test/integration/admin/shops_acceptance_test.rb +44 -0
- data/test/integration/checkout/cart_acceptance_test.rb +113 -0
- data/test/integration/checkout/payment_confirmation_acceptance_test.rb +24 -0
- data/test/integration/checkout/paypal_acceptance_test.rb +34 -0
- data/test/integration/checkout/shipping_address_acceptance_test.rb +91 -0
- data/test/integration/checkout/shipping_method_acceptance_test.rb +51 -0
- data/test/integration/homepage_acceptance_test.rb +24 -0
- data/test/integration/products_acceptance_test.rb +12 -0
- data/test/integration/static_pages_acceptance_test.rb +13 -0
- data/test/mailers/mailer_test.rb +25 -0
- data/test/rails_app/Gemfile +27 -0
- data/test/rails_app/Gemfile.lock +218 -0
- data/test/rails_app/Rakefile +10 -0
- data/test/rails_app/app/controllers/application_controller.rb +6 -0
- data/test/rails_app/app/helpers/application_helper.rb +3 -0
- data/test/rails_app/app/views/layouts/application.html.erb +10 -0
- data/test/rails_app/config/application.rb +25 -0
- data/test/rails_app/config/application.yml +61 -0
- data/test/rails_app/config/boot.rb +5 -0
- data/test/rails_app/config/database.yml +18 -0
- data/test/rails_app/config/environment.rb +5 -0
- data/test/rails_app/config/environments/development.rb +18 -0
- data/test/rails_app/config/environments/production.rb +33 -0
- data/test/rails_app/config/environments/test.rb +33 -0
- data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_app/config/initializers/inflections.rb +2 -0
- data/test/rails_app/config/initializers/secret_token.rb +2 -0
- data/test/rails_app/config/routes.rb +10 -0
- data/test/rails_app/config.ru +4 -0
- data/test/rails_app/db/development.sqlite3 +0 -0
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +74 -0
- data/test/rails_app/db/schema.rb +52 -0
- data/test/rails_app/log/development.log +94 -0
- data/test/rails_app/log/test.log +0 -0
- data/test/rails_app/public/404.html +26 -0
- data/test/rails_app/public/422.html +26 -0
- data/test/rails_app/public/500.html +26 -0
- data/test/rails_app/public/favicon.ico +0 -0
- data/test/rails_app/script/rails +10 -0
- data/test/support/address_test_helper.rb +24 -0
- data/test/support/checkout_test_helper.rb +40 -0
- data/test/support/dbify_sql_helper.rb +12 -0
- data/test/support/images/cookware.jpg +0 -0
- data/test/support/must_be_like.rb +24 -0
- data/test/support/shipping_method_test_helper.rb +5 -0
- data/test/support/wait_for_ajax.rb +4 -0
- data/test/test_helper.rb +65 -0
- data/test/unit/address_test.rb +33 -0
- data/test/unit/country_shipping_zone_test.rb +17 -0
- data/test/unit/creditcard_test.rb +33 -0
- data/test/unit/custom_field_answer/field_test.rb +93 -0
- data/test/unit/order_test.rb +70 -0
- data/test/unit/payment_method/authorizedotnet_test.rb +21 -0
- data/test/unit/payment_method/paypalwp_test.rb +17 -0
- data/test/unit/payment_method/splitable_test.rb +18 -0
- data/test/unit/picture_test.rb +24 -0
- data/test/unit/processor/authorize_net_test.rb +236 -0
- data/test/unit/processor/paypal_test.rb +40 -0
- data/test/unit/processor/splitable_test.rb +123 -0
- data/test/unit/product_group_condition_test.rb +188 -0
- data/test/unit/product_group_test.rb +109 -0
- data/test/unit/product_test.rb +60 -0
- data/test/unit/shipping_cost_calculator_test.rb +19 -0
- data/test/unit/shipping_method_test.rb +197 -0
- data/test/unit/shop_test.rb +11 -0
- data/test/unit/tax_calculator_test.rb +13 -0
- data/test/vcr_cassettes/authorize_net/authorize-failure.yml +38 -0
- data/test/vcr_cassettes/authorize_net/authorize-success.yml +38 -0
- data/test/vcr_cassettes/authorize_net/capture-failure.yml +38 -0
- data/test/vcr_cassettes/authorize_net/capture-success.yml +38 -0
- data/test/vcr_cassettes/authorize_net/purchase-failure.yml +38 -0
- data/test/vcr_cassettes/authorize_net/purchase-success.yml +38 -0
- data/test/vcr_cassettes/authorize_net/refund-failure.yml +38 -0
- data/test/vcr_cassettes/authorize_net/refund-success.yml +38 -0
- data/test/vcr_cassettes/authorize_net/void-authorize.yml +38 -0
- data/test/vcr_cassettes/authorize_net/void-failure.yml +38 -0
- data/test/vcr_cassettes/authorize_net/void-success.yml +38 -0
- data/test/vcr_cassettes/splitable/split-create-failure.yml +48 -0
- data/test/vcr_cassettes/splitable/split-create-success.yml +50 -0
- data/test/vcr_cassettes/splitable/split-draft-create-failure.yml +50 -0
- data/test/vcr_cassettes/splitable/split-draft-create-success.yml +50 -0
- data/vendor/assets/javascripts/accounting.js +406 -0
- data/vendor/assets/javascripts/autoresize.js +275 -0
- data/vendor/assets/javascripts/jquery-1.7.1.js +9267 -0
- data/vendor/assets/javascripts/jquery-form.js +980 -0
- data/vendor/assets/javascripts/jquery-json.js +193 -0
- data/vendor/assets/javascripts/jquery-ui-1.8.16.js +11768 -0
- data/vendor/assets/javascripts/jquery-ujs.js +374 -0
- data/vendor/assets/javascripts/mustache.js +436 -0
- data/vendor/assets/javascripts/nested_form.js +51 -0
- metadata +740 -0
@@ -0,0 +1,109 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ProductGroupTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
@text = create :text_custom_field
|
7
|
+
@date = create :date_custom_field
|
8
|
+
@number = create :number_custom_field
|
9
|
+
|
10
|
+
@p1 = create(:product)
|
11
|
+
@p2 = create(:product)
|
12
|
+
@p3 = create(:product)
|
13
|
+
@p4 = create(:product)
|
14
|
+
@p5 = create(:product)
|
15
|
+
|
16
|
+
@p1.custom_field_answers.create(custom_field: @number, value: 23)
|
17
|
+
@p2.custom_field_answers.create(custom_field: @number, value: 73)
|
18
|
+
@p3.custom_field_answers.create(custom_field: @number, value: 75)
|
19
|
+
@p5.custom_field_answers.create(custom_field: @number, value: 179)
|
20
|
+
|
21
|
+
@p1.custom_field_answers.create(custom_field: @text, value: 'george washington')
|
22
|
+
@p2.custom_field_answers.create(custom_field: @text, value: 'george murphy')
|
23
|
+
@p3.custom_field_answers.create(custom_field: @text, value: 'steve jobs')
|
24
|
+
@p4.custom_field_answers.create(custom_field: @text, value: 'bill gates')
|
25
|
+
|
26
|
+
@p1.custom_field_answers.create(custom_field: @date, value: '12/2/2009')
|
27
|
+
@p2.custom_field_answers.create(custom_field: @date, value: '1/15/2008')
|
28
|
+
@p3.custom_field_answers.create(custom_field: @date, value: '2/7/2011')
|
29
|
+
@p4.custom_field_answers.create(custom_field: @date, value: '8/5/2009')
|
30
|
+
@p5.custom_field_answers.create(custom_field: @date, value: '6/7/2010')
|
31
|
+
end
|
32
|
+
|
33
|
+
test '.fields' do
|
34
|
+
assert_equal 3, CustomField.count
|
35
|
+
assert_equal ["Name", "Price", "#{@text.name}", "#{@date.name}", "#{@number.name}"], ProductGroup.fields.map { |r| r['name'] }
|
36
|
+
assert_equal ["text", "number", "text", "date", "number"], ProductGroup.fields.map { |r| r['field_type'] }
|
37
|
+
end
|
38
|
+
|
39
|
+
test "returns products using equality operator" do
|
40
|
+
group = create(:product_group)
|
41
|
+
condition = group.product_group_conditions.build(name: @text.id)
|
42
|
+
|
43
|
+
condition.operator = 'eq'
|
44
|
+
condition.value = 'george washington'
|
45
|
+
assert_equal [ @p1 ], group.products
|
46
|
+
assert_equal "#{@text.name} is equal to george washington", group.summarize
|
47
|
+
|
48
|
+
condition.value = 'george murphy'
|
49
|
+
assert_equal [ @p2 ], group.products
|
50
|
+
|
51
|
+
condition.value = 'steve jobs'
|
52
|
+
assert_equal [ @p3 ], group.products
|
53
|
+
|
54
|
+
condition.value = 'bill gates'
|
55
|
+
assert_equal [ @p4 ], group.products
|
56
|
+
end
|
57
|
+
|
58
|
+
test "returns products using starts with operator" do
|
59
|
+
group = create(:product_group)
|
60
|
+
condition = group.product_group_conditions.build(name: @text.id)
|
61
|
+
condition.operator = 'starts'
|
62
|
+
|
63
|
+
condition.value = 'george'
|
64
|
+
assert_equal [ @p1, @p2 ], group.products
|
65
|
+
assert_equal "#{@text.name} starts with 'george'", group.summarize
|
66
|
+
|
67
|
+
condition.value = 'steve'
|
68
|
+
assert_equal [ @p3 ], group.products
|
69
|
+
|
70
|
+
condition.value = 'bill gates'
|
71
|
+
assert_equal [ @p4 ], group.products
|
72
|
+
|
73
|
+
condition.value = 'george m'
|
74
|
+
assert_equal [ @p2 ], group.products
|
75
|
+
end
|
76
|
+
|
77
|
+
test "returns products using ends with operator" do
|
78
|
+
group = create(:product_group)
|
79
|
+
condition = group.product_group_conditions.build(name: @text.id)
|
80
|
+
condition.operator = 'ends'
|
81
|
+
|
82
|
+
condition.value = 'murphy'
|
83
|
+
assert_equal [ @p2 ], group.products
|
84
|
+
assert_equal "#{@text.name} ends with 'murphy'", group.summarize
|
85
|
+
|
86
|
+
condition.value = 'jobs'
|
87
|
+
assert_equal [ @p3 ], group.products
|
88
|
+
|
89
|
+
condition.value = 'bill gates'
|
90
|
+
assert_equal [ @p4 ], group.products
|
91
|
+
end
|
92
|
+
|
93
|
+
test "show results to equality operator" do
|
94
|
+
group = create(:product_group)
|
95
|
+
condition = group.product_group_conditions.create(name: @number.id.to_s, operator: 'eq', value: 23)
|
96
|
+
|
97
|
+
assert_equal [ @p1 ], group.products
|
98
|
+
condition.value = 73
|
99
|
+
assert_equal [ @p2 ], group.products
|
100
|
+
end
|
101
|
+
|
102
|
+
test "returs products with multiple vlaues" do
|
103
|
+
group = create(:product_group)
|
104
|
+
group.product_group_conditions.create(name: @number.id.to_s, operator: 'lt', value: 25)
|
105
|
+
group.product_group_conditions.create(name: @text.id.to_s, operator: 'starts', value: 'george')
|
106
|
+
|
107
|
+
assert_equal [ @p1 ], group.products
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ProductTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
test 'validate status' do
|
6
|
+
assert_equal 'active', Product.new.status
|
7
|
+
assert_equal 'hidden', Product.new(status: 'hidden').status
|
8
|
+
end
|
9
|
+
|
10
|
+
test 'should create a default picture record' do
|
11
|
+
assert_equal 1, create(:product).pictures.size
|
12
|
+
end
|
13
|
+
|
14
|
+
test '#to_param' do
|
15
|
+
assert_equal 'test', Product.new(permalink: 'test').to_param
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
class ProductStatusTest < ActiveSupport::TestCase
|
21
|
+
|
22
|
+
setup do
|
23
|
+
#Product.delete_all
|
24
|
+
@product1 = create :product, status: 'active', name: 'product1'
|
25
|
+
@product2 = create :product, status: 'hidden', name: 'product2'
|
26
|
+
@product3 = create :product, status: 'hidden', name: 'product3'
|
27
|
+
@product4 = create :product, name: 'product4'
|
28
|
+
@product5 = create :product, status: 'sold_out', name: 'product5'
|
29
|
+
end
|
30
|
+
|
31
|
+
test 'various status' do
|
32
|
+
assert_equal 5, Product.count
|
33
|
+
assert_must_have_same_records [ @product2, @product3 ], Product.hidden
|
34
|
+
assert_must_have_same_records [ @product5 ], Product.sold_out
|
35
|
+
end
|
36
|
+
|
37
|
+
test 'active status' do
|
38
|
+
assert_must_have_same_records [ @product1, @product4 ], Product.active
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
class ProductFindOrBuildForField < ActiveSupport::TestCase
|
44
|
+
setup do
|
45
|
+
@product = create(:product)
|
46
|
+
@field1 = create(:text_custom_field)
|
47
|
+
@field2 = create(:number_custom_field)
|
48
|
+
@answer = @product.custom_field_answers.create(custom_field: @field1, value: 23)
|
49
|
+
end
|
50
|
+
|
51
|
+
test 'needs to build new answer' do
|
52
|
+
@answer = @product.find_or_build_answer_for_field(@field2)
|
53
|
+
assert_equal nil, @answer.id
|
54
|
+
end
|
55
|
+
|
56
|
+
test 'needs to return exisitng answer' do
|
57
|
+
assert_equal @answer, @product.find_or_build_answer_for_field(@field1)
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ShippingCostCalculatorTest < ActiveRecord::TestCase
|
4
|
+
|
5
|
+
test "shipping method is nil" do
|
6
|
+
order = Order.new
|
7
|
+
calculator= ShippingCostCalculator.new(order)
|
8
|
+
|
9
|
+
assert_equal 0, calculator.shipping_cost
|
10
|
+
end
|
11
|
+
|
12
|
+
test "shipping method is not nil" do
|
13
|
+
shipping_method = build :country_shipping_method
|
14
|
+
order = build :order, shipping_method: shipping_method
|
15
|
+
calculator= ShippingCostCalculator.new(order)
|
16
|
+
|
17
|
+
assert_equal 2.99, calculator.shipping_cost.round(2).to_f
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,197 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class ShippingMethodTest < ActiveSupport::TestCase
|
4
|
+
include RegionalShippingMethodTestHelper
|
5
|
+
|
6
|
+
test "validations" do
|
7
|
+
s = create(:country_shipping_method, higher_price_limit: 20)
|
8
|
+
s.minimum_order_amount = 19
|
9
|
+
assert s.valid?
|
10
|
+
|
11
|
+
s.minimum_order_amount = 20
|
12
|
+
refute s.valid?
|
13
|
+
|
14
|
+
s.minimum_order_amount = 21
|
15
|
+
refute s.valid?
|
16
|
+
end
|
17
|
+
|
18
|
+
test 'validations round2' do
|
19
|
+
s = build(:country_shipping_method, minimum_order_amount:0, higher_price_limit: 0)
|
20
|
+
s.valid?
|
21
|
+
assert_equal 'Maximum order amount must be greater than 0', s.errors.full_messages.first
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
class ShippingMethodScopesTest < ActiveSupport::TestCase
|
27
|
+
include ::RegionalShippingMethodTestHelper
|
28
|
+
|
29
|
+
def with_regions(countries)
|
30
|
+
countries + countries.map(&:regions).flatten
|
31
|
+
end
|
32
|
+
|
33
|
+
def assert_data_exists_in_result(data, result)
|
34
|
+
assert (data.map(&:id) - result.map(&:id)).blank?
|
35
|
+
end
|
36
|
+
|
37
|
+
setup do
|
38
|
+
@us = create(:country_shipping_zone, country_code: 'US')
|
39
|
+
@ca = create(:country_shipping_zone, country_code: 'CA')
|
40
|
+
@hk = create(:country_shipping_zone, country_code: 'HK')
|
41
|
+
|
42
|
+
@usground1 = create(:shipping_method, minimum_order_amount: 0, higher_price_limit: nil, base_price: 3.99, shipping_zone: @us)
|
43
|
+
@usair1 = create(:shipping_method, minimum_order_amount: 0, higher_price_limit: 600, base_price: 8.99, shipping_zone: @us)
|
44
|
+
@hkground1 = create(:shipping_method, minimum_order_amount: 100, higher_price_limit: 1000, base_price: 8.99, shipping_zone: @hk)
|
45
|
+
@caground1 = create(:shipping_method, minimum_order_amount: 0, higher_price_limit: 700, base_price: 5.99, shipping_zone: @ca)
|
46
|
+
@hkair1 = create(:shipping_method, minimum_order_amount: 900, higher_price_limit: 2000, base_price: 28.99, shipping_zone: @hk)
|
47
|
+
end
|
48
|
+
|
49
|
+
test "#in_price_range - knows in which shipping methods are available" do
|
50
|
+
assert_data_exists_in_result with_regions([@hkair1, @usground1]) , ShippingMethod.in_price_range(1500).to_ary
|
51
|
+
end
|
52
|
+
|
53
|
+
test "#atmost - knows who price is less than the given amount" do
|
54
|
+
assert_data_exists_in_result with_regions([ @usground1, @hkground1, @hkair1]), ShippingMethod.atmost(1000).to_ary
|
55
|
+
assert_data_exists_in_result with_regions([ @usground1, @usair1, @hkground1, @caground1, @hkair1]), ShippingMethod.atmost(0).to_ary
|
56
|
+
end
|
57
|
+
|
58
|
+
test "#aleast - knows who price is greater than the given amount" do
|
59
|
+
assert_data_exists_in_result with_regions([ @usground1, @usair1, @caground1]), ShippingMethod.atleast(10).to_ary
|
60
|
+
end
|
61
|
+
|
62
|
+
test "#in_country - knows by country code" do
|
63
|
+
assert_data_exists_in_result with_regions([@usground1, @usair1]) , ShippingMethod.in_country('US').to_ary
|
64
|
+
end
|
65
|
+
|
66
|
+
test "#available_countries" do
|
67
|
+
assert_sorted_equal ShippingMethod.available_for_countries(1000).sort, ['US', 'HK'].sort
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
class ShippingMethodMiscTest < ActiveSupport::TestCase
|
72
|
+
include RegionalShippingMethodTestHelper
|
73
|
+
|
74
|
+
test "making country level shipping method inactive should make children inactive - updating record" do
|
75
|
+
shipping_method = create(:country_shipping_method)
|
76
|
+
region = shipping_method.regions.first
|
77
|
+
assert region.active
|
78
|
+
shipping_method.update_attributes!(active: false)
|
79
|
+
region.reload
|
80
|
+
refute region.active
|
81
|
+
end
|
82
|
+
|
83
|
+
test "making country level shipping method inactive should make children inactive - creating record" do
|
84
|
+
shipping_method = create(:country_shipping_method, active: false)
|
85
|
+
region = shipping_method.regions.first
|
86
|
+
refute region.active
|
87
|
+
end
|
88
|
+
|
89
|
+
test "#enable! #disable!" do
|
90
|
+
shipping = create(:country_shipping_method)
|
91
|
+
|
92
|
+
shipping.enable!
|
93
|
+
assert shipping.active
|
94
|
+
|
95
|
+
shipping.disable!
|
96
|
+
refute shipping.active
|
97
|
+
end
|
98
|
+
|
99
|
+
test "of country - is not going to update" do
|
100
|
+
shipment = ShippingMethod.new(base_price: 10)
|
101
|
+
shipment.shipping_zone = CountryShippingZone.new
|
102
|
+
shipment.update_offset(0.20)
|
103
|
+
assert_equal 0.0, shipment.offset.to_f
|
104
|
+
end
|
105
|
+
|
106
|
+
test "#update_offset - of state - is going to increase by 0.20" do
|
107
|
+
shipment = ShippingMethod.new(base_price: 10)
|
108
|
+
shipment.shipping_zone = RegionalShippingZone.new
|
109
|
+
shipment.update_offset(0.20)
|
110
|
+
assert_equal 0.20, shipment.offset.to_f
|
111
|
+
end
|
112
|
+
|
113
|
+
test "#update_offset - of state - is going to decreate by 0.20" do
|
114
|
+
shipment = ShippingMethod.new(base_price: 10)
|
115
|
+
shipment.shipping_zone = RegionalShippingZone.new
|
116
|
+
shipment.offset = 0.80
|
117
|
+
shipment.update_offset(-0.20)
|
118
|
+
assert_in_delta 0.60, shipment.offset.to_f
|
119
|
+
end
|
120
|
+
|
121
|
+
test "of country type - #shipping_price - ignores offset value" do
|
122
|
+
shipping = build(:country_shipping_method)
|
123
|
+
shipping.offset = 0.10
|
124
|
+
shipping.base_price = 10
|
125
|
+
assert_equal 10.0, shipping.shipping_price
|
126
|
+
end
|
127
|
+
|
128
|
+
test "of country type - on create #callbacks - creates all regional shipping zone records" do
|
129
|
+
shipping = build(:country_shipping_method)
|
130
|
+
shipping.save
|
131
|
+
assert_equal 57, shipping.regions.count
|
132
|
+
end
|
133
|
+
|
134
|
+
test "of state type - #shipping_price - ignores base_price value" do
|
135
|
+
shipping = create_regional_shipping_method
|
136
|
+
shipping.parent.base_price = 10
|
137
|
+
shipping.offset = 0.10
|
138
|
+
shipping.base_price = 20
|
139
|
+
|
140
|
+
assert_equal 10.10, shipping.shipping_price.to_f
|
141
|
+
end
|
142
|
+
|
143
|
+
test "of state type - on create #callbacks - does not create all regional shipping zone records" do
|
144
|
+
shipping = create_regional_shipping_method
|
145
|
+
shipping.save
|
146
|
+
assert_equal 0, shipping.regions.count
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
150
|
+
|
151
|
+
class A < ActiveSupport::TestCase
|
152
|
+
include RegionalShippingMethodTestHelper
|
153
|
+
|
154
|
+
setup do
|
155
|
+
CountryShippingZone.delete_all
|
156
|
+
RegionalShippingZone.delete_all
|
157
|
+
end
|
158
|
+
|
159
|
+
test "#available_for - with one shipping method" do
|
160
|
+
shipping_method = create(:country_shipping_method, minimum_order_amount: 10, maximum_order_amount: 51)
|
161
|
+
assert_equal 1, CountryShippingZone.count
|
162
|
+
assert_equal 57, RegionalShippingZone.count
|
163
|
+
assert_equal 'US', shipping_method.shipping_zone.country_code
|
164
|
+
|
165
|
+
address = create(:shipping_address, state_code: 'FL', country_code: 'US')
|
166
|
+
assert_equal 'FL', address.state_code
|
167
|
+
assert_equal 1, RegionalShippingZone.count(conditions: {state_code: 'FL', country_code: 'US'})
|
168
|
+
|
169
|
+
assert_equal 1, ShippingMethod.available_for(25, address).size
|
170
|
+
assert_equal 0, ShippingMethod.available_for(200, address).size
|
171
|
+
end
|
172
|
+
|
173
|
+
test "#available_for - with two shipping methods" do
|
174
|
+
create(:country_shipping_method, minimum_order_amount: 10, maximum_order_amount: 51, name: 'General')
|
175
|
+
create(:country_shipping_method, minimum_order_amount: 10, maximum_order_amount: 51, name: 'Express')
|
176
|
+
assert_equal 2, RegionalShippingZone.count(conditions: {state_code: 'FL', country_code: 'US'})
|
177
|
+
|
178
|
+
address = create(:shipping_address, state_code: 'FL', country_code: 'US')
|
179
|
+
assert_equal 2, ShippingMethod.available_for(25, address).size
|
180
|
+
assert_equal 0, ShippingMethod.available_for(200, address).size
|
181
|
+
end
|
182
|
+
|
183
|
+
test "#available_for - with two shipping methods and make one active" do
|
184
|
+
s1 = create(:country_shipping_method, minimum_order_amount: 1, maximum_order_amount: 51, name: 'General')
|
185
|
+
s2 = create(:country_shipping_method, minimum_order_amount: 1, maximum_order_amount: 51, active: false, name: 'Express')
|
186
|
+
assert s1.active
|
187
|
+
s1.regions.each { |r| assert r.active }
|
188
|
+
|
189
|
+
refute s2.active
|
190
|
+
s2.regions.each { |r| refute r.active }
|
191
|
+
|
192
|
+
address = create(:shipping_address, state_code: 'FL', country_code: 'US')
|
193
|
+
assert_equal 1, ShippingMethod.available_for(25, address).size
|
194
|
+
assert_equal 0, ShippingMethod.available_for(200, address).size
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TaxCalculatorTest < ActiveRecord::TestCase
|
4
|
+
|
5
|
+
test "tax for the order" do
|
6
|
+
order = create :order_with_line_items
|
7
|
+
Shop.first.update_column(:tax_percentage, 10)
|
8
|
+
|
9
|
+
assert_equal 50.00, order.reload.line_items_total
|
10
|
+
assert_equal 5.0, TaxCalculator.new(order).tax
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://test.authorize.net/gateway/transact.dll
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=AUTH_ONLY&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_invoice_num=&x_description=&x_card_num=2&x_card_code=123&x_exp_date=0413&x_first_name=Meda&x_last_name=McClure&x_amount=100.48&x_test_request=FALSE
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/x-www-form-urlencoded
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Connection:
|
22
|
+
- close
|
23
|
+
Date:
|
24
|
+
- Sun, 22 Apr 2012 14:59:28 GMT
|
25
|
+
Server:
|
26
|
+
- Microsoft-IIS/6.0
|
27
|
+
X-Powered-By:
|
28
|
+
- ASP.NET
|
29
|
+
Content-Type:
|
30
|
+
- text/html
|
31
|
+
Content-Length:
|
32
|
+
- "307"
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: $3$,$1$,$6$,$The credit card number is invalid.$,$$,$P$,$0$,$$,$$,$100.48$,$CC$,$auth_only$,$$,$Meda$,$McClure$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$82AF683896C71D9FCD99BE1D5AFFEEA8$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX2$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
|
36
|
+
http_version:
|
37
|
+
recorded_at: Sun, 22 Apr 2012 14:59:28 GMT
|
38
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://test.authorize.net/gateway/transact.dll
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=AUTH_ONLY&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_invoice_num=&x_description=&x_card_num=4007000000027&x_card_code=123&x_exp_date=0413&x_first_name=Clarabelle&x_last_name=Stiedemann&x_amount=100.48&x_test_request=FALSE
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/x-www-form-urlencoded
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Connection:
|
22
|
+
- close
|
23
|
+
Date:
|
24
|
+
- Sun, 22 Apr 2012 14:59:29 GMT
|
25
|
+
Server:
|
26
|
+
- Microsoft-IIS/6.0
|
27
|
+
X-Powered-By:
|
28
|
+
- ASP.NET
|
29
|
+
Content-Type:
|
30
|
+
- text/html
|
31
|
+
Content-Length:
|
32
|
+
- "341"
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: $1$,$1$,$1$,$This transaction has been approved.$,$FI4KFO$,$Y$,$2171213293$,$$,$$,$100.48$,$CC$,$auth_only$,$$,$Clarabelle$,$Stiedemann$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$C5FD3839F84A696E8F8727D8B387A800$,$P$,$2$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX0027$,$Visa$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
|
36
|
+
http_version:
|
37
|
+
recorded_at: Sun, 22 Apr 2012 14:59:30 GMT
|
38
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://test.authorize.net/gateway/transact.dll
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=PRIOR_AUTH_CAPTURE&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_trans_id=%7B%7D&x_amount=&x_test_request=FALSE
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/x-www-form-urlencoded
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Connection:
|
22
|
+
- close
|
23
|
+
Date:
|
24
|
+
- Sun, 22 Apr 2012 15:19:50 GMT
|
25
|
+
Server:
|
26
|
+
- Microsoft-IIS/6.0
|
27
|
+
X-Powered-By:
|
28
|
+
- ASP.NET
|
29
|
+
Content-Type:
|
30
|
+
- text/html
|
31
|
+
Content-Length:
|
32
|
+
- "311"
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: $3$,$2$,$33$,$A valid referenced transaction ID is required.$,$$,$P$,$0$,$$,$$,$0.00$,$CC$,$prior_auth_capture$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$E4D08D153C02147DACEF435A63672D69$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
|
36
|
+
http_version:
|
37
|
+
recorded_at: Sun, 22 Apr 2012 15:19:50 GMT
|
38
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://test.authorize.net/gateway/transact.dll
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=PRIOR_AUTH_CAPTURE&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_trans_id=2171213293&x_amount=100.48&x_test_request=FALSE
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/x-www-form-urlencoded
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Connection:
|
22
|
+
- close
|
23
|
+
Date:
|
24
|
+
- Sun, 22 Apr 2012 14:59:32 GMT
|
25
|
+
Server:
|
26
|
+
- Microsoft-IIS/6.0
|
27
|
+
X-Powered-By:
|
28
|
+
- ASP.NET
|
29
|
+
Content-Type:
|
30
|
+
- text/html
|
31
|
+
Content-Length:
|
32
|
+
- "315"
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: $1$,$1$,$311$,$This transaction has already been captured.$,$$,$P$,$0$,$$,$$,$100.48$,$CC$,$prior_auth_capture$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$82AF683896C71D9FCD99BE1D5AFFEEA8$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$Visa$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
|
36
|
+
http_version:
|
37
|
+
recorded_at: Sun, 22 Apr 2012 14:59:33 GMT
|
38
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://test.authorize.net/gateway/transact.dll
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=AUTH_CAPTURE&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_invoice_num=&x_description=&x_card_num=2&x_card_code=123&x_exp_date=0413&x_first_name=Nova&x_last_name=Weimann&x_amount=100.48&x_test_request=FALSE
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/x-www-form-urlencoded
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Connection:
|
22
|
+
- close
|
23
|
+
Date:
|
24
|
+
- Sun, 22 Apr 2012 14:59:34 GMT
|
25
|
+
Server:
|
26
|
+
- Microsoft-IIS/6.0
|
27
|
+
X-Powered-By:
|
28
|
+
- ASP.NET
|
29
|
+
Content-Type:
|
30
|
+
- text/html
|
31
|
+
Content-Length:
|
32
|
+
- "310"
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: $3$,$1$,$6$,$The credit card number is invalid.$,$$,$P$,$0$,$$,$$,$100.48$,$CC$,$auth_capture$,$$,$Nova$,$Weimann$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$82AF683896C71D9FCD99BE1D5AFFEEA8$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX2$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
|
36
|
+
http_version:
|
37
|
+
recorded_at: Sun, 22 Apr 2012 14:59:34 GMT
|
38
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://test.authorize.net/gateway/transact.dll
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=AUTH_CAPTURE&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_invoice_num=&x_description=&x_card_num=4007000000027&x_card_code=123&x_exp_date=0413&x_first_name=Elias&x_last_name=Goldner&x_amount=100.48&x_test_request=FALSE
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/x-www-form-urlencoded
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Connection:
|
22
|
+
- close
|
23
|
+
Date:
|
24
|
+
- Sun, 22 Apr 2012 14:59:35 GMT
|
25
|
+
Server:
|
26
|
+
- Microsoft-IIS/6.0
|
27
|
+
X-Powered-By:
|
28
|
+
- ASP.NET
|
29
|
+
Content-Type:
|
30
|
+
- text/html
|
31
|
+
Content-Length:
|
32
|
+
- "336"
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: $1$,$1$,$1$,$This transaction has been approved.$,$8XZB16$,$Y$,$2171213294$,$$,$$,$100.48$,$CC$,$auth_capture$,$$,$Elias$,$Goldner$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$B49F0B0B6E4EDB37B26F2618E8E3780A$,$P$,$2$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX0027$,$Visa$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
|
36
|
+
http_version:
|
37
|
+
recorded_at: Sun, 22 Apr 2012 14:59:36 GMT
|
38
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://test.authorize.net/gateway/transact.dll
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=CREDIT&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_trans_id=2171213294&x_card_num=1234&x_invoice_num=&x_description=&x_amount=100.48&x_test_request=FALSE
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/x-www-form-urlencoded
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Connection:
|
22
|
+
- close
|
23
|
+
Date:
|
24
|
+
- Wed, 02 May 2012 19:52:39 GMT
|
25
|
+
Server:
|
26
|
+
- Microsoft-IIS/6.0
|
27
|
+
X-Powered-By:
|
28
|
+
- ASP.NET
|
29
|
+
Content-Type:
|
30
|
+
- text/html
|
31
|
+
Content-Length:
|
32
|
+
- "342"
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: $3$,$2$,$54$,$The referenced transaction does not meet the criteria for issuing a credit.$,$$,$P$,$0$,$$,$$,$100.48$,$CC$,$credit$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$82AF683896C71D9FCD99BE1D5AFFEEA8$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX1234$,$Visa$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
|
36
|
+
http_version:
|
37
|
+
recorded_at: Wed, 02 May 2012 19:52:39 GMT
|
38
|
+
recorded_with: VCR 2.0.0
|