spree_core 1.2.5 → 1.3.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/admin/address_states.js +5 -4
- data/app/assets/javascripts/admin/admin.js.erb +106 -58
- data/app/assets/javascripts/admin/calculator.js +2 -2
- data/app/assets/javascripts/admin/checkouts/edit.js +5 -5
- data/app/assets/javascripts/admin/image_settings.js.erb +62 -0
- data/app/assets/javascripts/admin/images/index.js.coffee +3 -0
- data/app/assets/javascripts/admin/images/new.js.coffee +3 -0
- data/app/assets/javascripts/admin/orders/edit.js +1 -1
- data/app/assets/javascripts/admin/progress.coffee +27 -0
- data/app/assets/javascripts/admin/shipping_methods.js.coffee +1 -1
- data/app/assets/javascripts/admin/spree-select2.js.erb +24 -0
- data/app/assets/javascripts/admin/spree_core.js +10 -0
- data/app/assets/javascripts/admin/taxon_autocomplete.js.erb +1 -1
- data/app/assets/javascripts/admin/taxonomy.js +9 -9
- data/app/assets/javascripts/admin/variant_autocomplete.js.erb +40 -0
- data/app/assets/javascripts/store/checkout.js.coffee +23 -5
- data/app/assets/javascripts/store/product.js.coffee +15 -8
- data/app/assets/javascripts/store/spree_core.js +0 -1
- data/app/assets/stylesheets/admin/components/_actions.scss +31 -0
- data/app/assets/stylesheets/admin/components/_date-picker.scss +154 -0
- data/app/assets/stylesheets/admin/components/_messages.scss +43 -0
- data/app/assets/stylesheets/admin/components/_navigation.scss +150 -0
- data/app/assets/stylesheets/admin/components/_pagination.scss +17 -0
- data/app/assets/stylesheets/admin/components/_product_autocomplete.scss +29 -0
- data/app/assets/stylesheets/admin/components/_progress.scss +35 -0
- data/app/assets/stylesheets/admin/components/_sidebar.scss +23 -0
- data/app/assets/stylesheets/admin/components/_states.scss +30 -0
- data/app/assets/stylesheets/admin/components/_table-filter.scss +14 -0
- data/app/assets/stylesheets/admin/globals/_functions.scss +25 -0
- data/app/assets/stylesheets/admin/globals/_mixins.scss +25 -0
- data/app/assets/stylesheets/admin/globals/_variables.scss +134 -0
- data/app/assets/stylesheets/admin/globals/_variables_override.scss +7 -0
- data/app/assets/stylesheets/admin/hacks/_ie.scss +73 -0
- data/app/assets/stylesheets/admin/hacks/_mozilla.scss +32 -0
- data/app/assets/stylesheets/admin/hacks/_opera.scss +17 -0
- data/app/assets/stylesheets/admin/plugins/_jstree.scss +132 -0
- data/app/assets/stylesheets/admin/plugins/_powertip.scss +86 -0
- data/app/assets/stylesheets/admin/plugins/_select2.scss +176 -0
- data/app/assets/stylesheets/admin/{token-input.css → plugins/_token-input.scss} +9 -8
- data/app/assets/stylesheets/admin/plugins/font-awesome.scss +303 -0
- data/app/assets/stylesheets/admin/{edit_checkouts.css → sections/_edit_checkouts.scss} +1 -1
- data/app/assets/stylesheets/admin/sections/_image_settings.scss +3 -0
- data/app/assets/stylesheets/admin/sections/_orders.scss +38 -0
- data/app/assets/stylesheets/admin/sections/_overview.scss +86 -0
- data/app/assets/stylesheets/admin/sections/_products.scss +26 -0
- data/app/assets/stylesheets/admin/sections/_promotions.scss +100 -0
- data/app/assets/stylesheets/admin/shared/_forms.scss +250 -0
- data/app/assets/stylesheets/admin/shared/_icons.scss +21 -0
- data/app/assets/stylesheets/admin/shared/_layout.scss +84 -0
- data/app/assets/stylesheets/admin/shared/_tables.scss +180 -0
- data/app/assets/stylesheets/admin/shared/_typography.scss +132 -0
- data/app/assets/stylesheets/admin/spree_admin.scss +38 -0
- data/app/assets/stylesheets/admin/spree_core.css +7 -7
- data/app/assets/stylesheets/store/screen.css.scss +57 -49
- data/app/assets/stylesheets/store/spree_core.css +2 -3
- data/app/assets/stylesheets/store/variables.css.scss +2 -0
- data/app/controllers/spree/admin/adjustments_controller.rb +3 -7
- data/app/controllers/spree/admin/base_controller.rb +1 -1
- data/app/controllers/spree/admin/countries_controller.rb +11 -0
- data/app/controllers/spree/admin/general_settings_controller.rb +7 -8
- data/app/controllers/spree/admin/image_settings_controller.rb +2 -7
- data/app/controllers/spree/admin/inventory_settings_controller.rb +2 -6
- data/app/controllers/spree/admin/mail_methods_controller.rb +1 -1
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +3 -4
- data/app/controllers/spree/admin/orders_controller.rb +3 -9
- data/app/controllers/spree/admin/payment_methods_controller.rb +5 -2
- data/app/controllers/spree/admin/payments_controller.rb +4 -4
- data/app/controllers/spree/admin/product_properties_controller.rb +0 -12
- data/app/controllers/spree/admin/products_controller.rb +19 -42
- data/app/controllers/spree/admin/properties_controller.rb +2 -2
- data/app/controllers/spree/admin/prototypes_controller.rb +0 -8
- data/app/controllers/spree/admin/reports_controller.rb +7 -4
- data/app/controllers/spree/admin/resource_controller.rb +3 -3
- data/app/controllers/spree/admin/return_authorizations_controller.rb +1 -1
- data/app/controllers/spree/admin/shipments_controller.rb +3 -3
- data/app/controllers/spree/admin/shipping_methods_controller.rb +1 -1
- data/app/controllers/spree/admin/tax_categories_controller.rb +1 -1
- data/app/controllers/spree/admin/taxons_controller.rb +4 -4
- data/app/controllers/spree/admin/variants_controller.rb +11 -15
- data/app/controllers/spree/base_controller.rb +4 -1
- data/app/controllers/spree/checkout_controller.rb +3 -3
- data/app/controllers/spree/content_controller.rb +1 -1
- data/app/controllers/spree/countries_controller.rb +12 -0
- data/app/controllers/spree/home_controller.rb +2 -1
- data/app/controllers/spree/locale_controller.rb +3 -3
- data/app/controllers/spree/orders_controller.rb +7 -9
- data/app/controllers/spree/products_controller.rb +5 -4
- data/app/controllers/spree/states_controller.rb +1 -1
- data/app/controllers/spree/store_controller.rb +11 -0
- data/app/controllers/spree/taxons_controller.rb +2 -1
- data/app/helpers/spree/admin/base_helper.rb +16 -15
- data/app/helpers/spree/admin/navigation_helper.rb +38 -28
- data/app/helpers/spree/admin/orders_helper.rb +1 -7
- data/app/helpers/spree/admin/tables_helper.rb +15 -0
- data/app/helpers/spree/admin/taxons_helper.rb +0 -13
- data/app/helpers/spree/base_helper.rb +14 -28
- data/app/helpers/spree/checkout_helper.rb +0 -15
- data/app/helpers/spree/products_helper.rb +23 -10
- data/app/mailers/spree/order_mailer.rb +6 -17
- data/app/mailers/spree/shipment_mailer.rb +3 -8
- data/app/mailers/spree/test_mailer.rb +0 -5
- data/app/models/spree/address.rb +2 -1
- data/app/models/spree/adjustment.rb +5 -1
- data/app/models/spree/app_configuration.rb +2 -7
- data/app/models/spree/calculator/default_tax.rb +2 -6
- data/app/models/spree/calculator/flat_rate.rb +3 -1
- data/app/models/spree/calculator/flexi_rate.rb +2 -1
- data/app/models/spree/calculator/per_item.rb +3 -4
- data/app/models/spree/calculator/price_sack.rb +3 -1
- data/app/models/spree/country.rb +11 -0
- data/app/models/spree/credit_card.rb +5 -1
- data/app/models/spree/gateway.rb +2 -8
- data/app/models/spree/image.rb +1 -1
- data/app/models/spree/inventory_unit.rb +7 -3
- data/app/models/spree/line_item.rb +16 -2
- data/app/models/spree/order.rb +64 -137
- data/app/models/spree/order/checkout.rb +1 -8
- data/app/models/spree/order_updater.rb +134 -0
- data/app/models/spree/payment.rb +8 -19
- data/app/models/spree/payment/processing.rb +3 -3
- data/app/models/spree/payment_method.rb +6 -4
- data/app/models/spree/preference.rb +1 -1
- data/app/models/spree/preferences/preferable_class_methods.rb +9 -6
- data/app/models/spree/preferences/store.rb +11 -26
- data/app/models/spree/price.rb +51 -0
- data/app/models/spree/product.rb +22 -14
- data/app/models/spree/product/scopes.rb +20 -28
- data/app/models/spree/prototype.rb +1 -1
- data/app/models/spree/return_authorization.rb +8 -0
- data/app/models/spree/shipment.rb +13 -5
- data/app/models/spree/shipping_method.rb +10 -1
- data/app/models/spree/shipping_rate.rb +2 -2
- data/app/models/spree/taxon.rb +0 -5
- data/app/models/spree/variant.rb +75 -25
- data/app/models/spree/zone.rb +1 -1
- data/app/views/spree/address/_form.html.erb +75 -0
- data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +23 -22
- data/app/views/spree/admin/adjustments/_form.html.erb +15 -12
- data/app/views/spree/admin/adjustments/edit.html.erb +15 -6
- data/app/views/spree/admin/adjustments/index.html.erb +12 -2
- data/app/views/spree/admin/adjustments/new.html.erb +15 -6
- data/app/views/spree/admin/banners/_gateway.html.erb +3 -1
- data/app/views/spree/admin/countries/_form.html.erb +22 -0
- data/app/views/spree/admin/countries/edit.html.erb +21 -0
- data/app/views/spree/admin/countries/index.html.erb +33 -0
- data/app/views/spree/admin/general_settings/edit.html.erb +75 -27
- data/app/views/spree/admin/image_settings/edit.html.erb +112 -99
- data/app/views/spree/admin/images/_form.html.erb +16 -12
- data/app/views/spree/admin/images/edit.html.erb +20 -11
- data/app/views/spree/admin/images/index.html.erb +70 -46
- data/app/views/spree/admin/images/new.html.erb +11 -8
- data/app/views/spree/admin/inventory_settings/edit.html.erb +16 -18
- data/app/views/spree/admin/inventory_settings/show.html.erb +14 -4
- data/app/views/spree/admin/line_items/create.js.erb +0 -3
- data/app/views/spree/admin/mail_methods/_form.html.erb +46 -47
- data/app/views/spree/admin/mail_methods/edit.html.erb +12 -3
- data/app/views/spree/admin/mail_methods/index.html.erb +37 -33
- data/app/views/spree/admin/mail_methods/new.html.erb +16 -4
- data/app/views/spree/admin/option_types/_form.html.erb +16 -12
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +7 -3
- data/app/views/spree/admin/option_types/edit.html.erb +45 -27
- data/app/views/spree/admin/option_types/index.html.erb +31 -26
- data/app/views/spree/admin/option_types/new.html.erb +1 -1
- data/app/views/spree/admin/orders/_add_product.html.erb +13 -10
- data/app/views/spree/admin/orders/_form.html.erb +53 -42
- data/app/views/spree/admin/orders/_line_item.html.erb +7 -9
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +59 -41
- data/app/views/spree/admin/orders/customer_details/edit.html.erb +11 -2
- data/app/views/spree/admin/orders/edit.html.erb +5 -8
- data/app/views/spree/admin/orders/index.html.erb +105 -67
- data/app/views/spree/admin/orders/new.html.erb +16 -5
- data/app/views/spree/admin/orders/show.html.erb +23 -14
- data/app/views/spree/admin/payment_methods/_form.html.erb +46 -45
- data/app/views/spree/admin/payment_methods/edit.html.erb +19 -6
- data/app/views/spree/admin/payment_methods/index.html.erb +33 -27
- data/app/views/spree/admin/payment_methods/new.html.erb +16 -5
- data/app/views/spree/admin/payments/_form.html.erb +27 -16
- data/app/views/spree/admin/payments/_list.html.erb +23 -19
- data/app/views/spree/admin/payments/credit.html.erb +4 -0
- data/app/views/spree/admin/payments/index.html.erb +12 -11
- data/app/views/spree/admin/payments/new.html.erb +13 -7
- data/app/views/spree/admin/payments/show.html.erb +13 -5
- data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +36 -26
- data/app/views/spree/admin/payments/source_views/_gateway.html.erb +26 -31
- data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +3 -1
- data/app/views/spree/admin/product_properties/index.html.erb +37 -30
- data/app/views/spree/admin/products/_form.html.erb +115 -87
- data/app/views/spree/admin/products/_properties_form.erb +6 -3
- data/app/views/spree/admin/products/edit.html.erb +8 -2
- data/app/views/spree/admin/products/index.html.erb +88 -55
- data/app/views/spree/admin/products/new.html.erb +24 -20
- data/app/views/spree/admin/products/new.js.erb +4 -0
- data/app/views/spree/admin/properties/_form.html.erb +15 -12
- data/app/views/spree/admin/properties/edit.html.erb +11 -3
- data/app/views/spree/admin/properties/index.html.erb +18 -17
- data/app/views/spree/admin/properties/new.html.erb +4 -2
- data/app/views/spree/admin/prototypes/_form.html.erb +22 -43
- data/app/views/spree/admin/prototypes/_prototypes.html.erb +7 -3
- data/app/views/spree/admin/prototypes/edit.html.erb +14 -3
- data/app/views/spree/admin/prototypes/index.html.erb +19 -16
- data/app/views/spree/admin/prototypes/new.html.erb +1 -1
- data/app/views/spree/admin/prototypes/new.js.erb +3 -0
- data/app/views/spree/admin/reports/index.html.erb +3 -1
- data/app/views/spree/admin/reports/sales_total.html.erb +31 -17
- data/app/views/spree/admin/return_authorizations/_form.html.erb +36 -27
- data/app/views/spree/admin/return_authorizations/edit.html.erb +16 -17
- data/app/views/spree/admin/return_authorizations/index.html.erb +47 -40
- data/app/views/spree/admin/return_authorizations/new.html.erb +5 -3
- data/app/views/spree/admin/shared/_address.html.erb +2 -2
- data/app/views/spree/admin/shared/_address_form.html.erb +58 -78
- data/app/views/spree/admin/shared/_calculator_fields.html.erb +16 -13
- data/app/views/spree/admin/shared/_configuration_menu.html.erb +23 -19
- data/app/views/spree/admin/shared/_edit_resource_links.html.erb +5 -4
- data/app/views/spree/admin/shared/_head.html.erb +10 -2
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +5 -4
- data/app/views/spree/admin/shared/_order_details.html.erb +16 -15
- data/app/views/spree/admin/shared/_order_tabs.html.erb +65 -51
- data/app/views/spree/admin/shared/_product_sub_menu.html.erb +2 -2
- data/app/views/spree/admin/shared/_product_tabs.html.erb +23 -20
- data/app/views/spree/admin/shared/_report_criteria.html.erb +13 -11
- data/app/views/spree/admin/shared/_routes.html.erb +1 -2
- data/app/views/spree/admin/shared/_tabs.html.erb +5 -4
- data/app/views/spree/admin/shared/_translations.html.erb +22 -18
- data/app/views/spree/admin/shipments/_form.html.erb +54 -58
- data/app/views/spree/admin/shipments/edit.html.erb +20 -15
- data/app/views/spree/admin/shipments/index.html.erb +40 -33
- data/app/views/spree/admin/shipments/new.html.erb +4 -0
- data/app/views/spree/admin/shipping_categories/_form.html.erb +4 -6
- data/app/views/spree/admin/shipping_categories/edit.html.erb +17 -3
- data/app/views/spree/admin/shipping_categories/index.html.erb +18 -14
- data/app/views/spree/admin/shipping_categories/new.html.erb +15 -3
- data/app/views/spree/admin/shipping_methods/_form.html.erb +36 -24
- data/app/views/spree/admin/shipping_methods/edit.html.erb +18 -5
- data/app/views/spree/admin/shipping_methods/index.html.erb +21 -15
- data/app/views/spree/admin/shipping_methods/new.html.erb +18 -6
- data/app/views/spree/admin/states/_form.html.erb +13 -10
- data/app/views/spree/admin/states/_state_list.html.erb +10 -14
- data/app/views/spree/admin/states/edit.html.erb +13 -3
- data/app/views/spree/admin/states/index.html.erb +12 -4
- data/app/views/spree/admin/states/new.html.erb +9 -3
- data/app/views/spree/admin/tax_categories/_form.html.erb +23 -15
- data/app/views/spree/admin/tax_categories/edit.html.erb +11 -3
- data/app/views/spree/admin/tax_categories/index.html.erb +20 -15
- data/app/views/spree/admin/tax_categories/new.html.erb +12 -3
- data/app/views/spree/admin/tax_rates/_form.html.erb +38 -27
- data/app/views/spree/admin/tax_rates/edit.html.erb +18 -3
- data/app/views/spree/admin/tax_rates/index.html.erb +59 -40
- data/app/views/spree/admin/tax_rates/new.html.erb +20 -3
- data/app/views/spree/admin/tax_settings/edit.html.erb +10 -9
- data/app/views/spree/admin/taxonomies/_form.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/_list.html.erb +24 -18
- data/app/views/spree/admin/taxonomies/edit.erb +24 -10
- data/app/views/spree/admin/taxonomies/get_children.json.erb +1 -1
- data/app/views/spree/admin/taxonomies/index.html.erb +8 -9
- data/app/views/spree/admin/taxonomies/new.html.erb +15 -5
- data/app/views/spree/admin/taxons/_form.html.erb +23 -18
- data/app/views/spree/admin/taxons/_taxon_table.html.erb +1 -1
- data/app/views/spree/admin/taxons/edit.html.erb +13 -5
- data/app/views/spree/admin/trackers/_form.html.erb +29 -24
- data/app/views/spree/admin/trackers/edit.html.erb +15 -3
- data/app/views/spree/admin/trackers/index.html.erb +43 -31
- data/app/views/spree/admin/trackers/new.html.erb +14 -3
- data/app/views/spree/admin/variants/_autocomplete.js.erb +30 -0
- data/app/views/spree/admin/variants/_form.html.erb +50 -31
- data/app/views/spree/admin/variants/index.html.erb +64 -46
- data/app/views/spree/admin/variants/new.html.erb +1 -0
- data/app/views/spree/admin/variants/new.js.erb +1 -0
- data/app/views/spree/admin/variants/search.rabl +15 -0
- data/app/views/spree/admin/zones/_country_member.html.erb +1 -1
- data/app/views/spree/admin/zones/_form.html.erb +30 -27
- data/app/views/spree/admin/zones/_member_type.html.erb +12 -9
- data/app/views/spree/admin/zones/_state_member.html.erb +2 -2
- data/app/views/spree/admin/zones/edit.html.erb +16 -3
- data/app/views/spree/admin/zones/index.html.erb +45 -36
- data/app/views/spree/admin/zones/new.html.erb +12 -1
- data/app/views/spree/checkout/_address.html.erb +17 -165
- data/app/views/spree/checkout/_confirm.html.erb +1 -1
- data/app/views/spree/checkout/_delivery.html.erb +1 -1
- data/app/views/spree/checkout/_payment.html.erb +1 -1
- data/app/views/spree/checkout/_summary.html.erb +4 -4
- data/app/views/spree/checkout/edit.html.erb +2 -0
- data/app/views/spree/checkout/payment/_gateway.html.erb +2 -2
- data/app/views/spree/checkout/registration.html.erb +1 -1
- data/app/views/spree/countries/index.js.erb +1 -0
- data/app/views/spree/layouts/admin.html.erb +125 -61
- data/app/views/spree/layouts/spree_application.html.erb +17 -6
- data/app/views/spree/order_mailer/cancel_email.text.erb +4 -4
- data/app/views/spree/order_mailer/confirm_email.text.erb +3 -3
- data/app/views/spree/orders/_adjustments.html.erb +1 -1
- data/app/views/spree/orders/_line_item.html.erb +3 -3
- data/app/views/spree/orders/show.html.erb +15 -15
- data/app/views/spree/products/_cart_form.html.erb +5 -5
- data/app/views/spree/products/_properties.html.erb +4 -3
- data/app/views/spree/products/_thumbnails.html.erb +15 -17
- data/app/views/spree/products/index.html.erb +1 -1
- data/app/views/spree/products/show.html.erb +1 -1
- data/app/views/spree/shared/_google_analytics.html.erb +9 -9
- data/app/views/spree/shared/_order_details.html.erb +14 -14
- data/app/views/spree/shared/_products.html.erb +1 -2
- data/app/views/spree/taxons/show.html.erb +1 -1
- data/config/locales/en.yml +43 -4
- data/config/routes.rb +4 -5
- data/db/migrate/20120831092320_spree_one_two.rb +481 -0
- data/db/migrate/20120929093553_remove_unused_preference_columns.rb +8 -0
- data/db/migrate/20121010142909_add_states_required_to_countries.rb +5 -0
- data/db/migrate/20121012071449_add_on_demand_to_product_and_variant.rb +6 -0
- data/db/migrate/20121031162139_split_prices_from_variants.rb +30 -0
- data/db/migrate/20121107003422_remove_not_null_from_spree_prices_amount.rb +9 -0
- data/db/migrate/20121107184631_add_currency_to_line_items.rb +5 -0
- data/db/migrate/20121107194006_add_currency_to_orders.rb +5 -0
- data/db/migrate/20121109173623_add_cost_currency_to_variants.rb +5 -0
- data/db/migrate/20121111231553_remove_display_on_from_payment_methods.rb +5 -0
- data/lib/generators/spree/custom_user/custom_user_generator.rb +1 -1
- data/lib/generators/spree/dummy/templates/rails/database.yml +6 -9
- data/lib/generators/spree/install/templates/config/initializers/spree.rb +2 -2
- data/lib/spree/core.rb +0 -7
- data/lib/spree/core/action_callbacks.rb +4 -4
- data/lib/spree/core/calculated_adjustments.rb +2 -2
- data/lib/spree/core/controller_helpers/auth.rb +65 -0
- data/lib/spree/core/controller_helpers/common.rb +90 -0
- data/lib/spree/core/controller_helpers/order.rb +71 -0
- data/lib/spree/core/{respond_with.rb → controller_helpers/respond_with.rb} +27 -25
- data/lib/spree/core/engine.rb +6 -5
- data/lib/spree/core/search/base.rb +3 -1
- data/lib/spree/core/testing_support/factories/payment_factory.rb +24 -0
- data/lib/spree/core/testing_support/factories/payment_method_factory.rb +0 -3
- data/lib/spree/core/testing_support/factories/price_factory.rb +8 -0
- data/lib/spree/core/testing_support/factories/zone_factory.rb +1 -1
- data/lib/spree/core/testing_support/flash.rb +17 -5
- data/lib/spree/core/testing_support/preferences.rb +6 -12
- data/lib/spree/core/validators/email.rb +1 -1
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/money.rb +3 -12
- data/lib/spree/product_filters.rb +8 -8
- data/lib/tasks/core.rake +3 -3
- data/lib/tasks/taxon.rake +1 -1
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.svg +255 -0
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/images/flags/ad.png +0 -0
- data/vendor/assets/images/flags/ae.png +0 -0
- data/vendor/assets/images/flags/af.png +0 -0
- data/vendor/assets/images/flags/ag.png +0 -0
- data/vendor/assets/images/flags/ai.png +0 -0
- data/vendor/assets/images/flags/al.png +0 -0
- data/vendor/assets/images/flags/am.png +0 -0
- data/vendor/assets/images/flags/an.png +0 -0
- data/vendor/assets/images/flags/ao.png +0 -0
- data/vendor/assets/images/flags/ar.png +0 -0
- data/vendor/assets/images/flags/as.png +0 -0
- data/vendor/assets/images/flags/at.png +0 -0
- data/vendor/assets/images/flags/au.png +0 -0
- data/vendor/assets/images/flags/aw.png +0 -0
- data/vendor/assets/images/flags/ax.png +0 -0
- data/vendor/assets/images/flags/az.png +0 -0
- data/vendor/assets/images/flags/ba.png +0 -0
- data/vendor/assets/images/flags/bb.png +0 -0
- data/vendor/assets/images/flags/bd.png +0 -0
- data/vendor/assets/images/flags/be.png +0 -0
- data/vendor/assets/images/flags/bf.png +0 -0
- data/vendor/assets/images/flags/bg.png +0 -0
- data/vendor/assets/images/flags/bh.png +0 -0
- data/vendor/assets/images/flags/bi.png +0 -0
- data/vendor/assets/images/flags/bj.png +0 -0
- data/vendor/assets/images/flags/bm.png +0 -0
- data/vendor/assets/images/flags/bn.png +0 -0
- data/vendor/assets/images/flags/bo.png +0 -0
- data/vendor/assets/images/flags/br.png +0 -0
- data/vendor/assets/images/flags/bs.png +0 -0
- data/vendor/assets/images/flags/bt.png +0 -0
- data/vendor/assets/images/flags/bv.png +0 -0
- data/vendor/assets/images/flags/bw.png +0 -0
- data/vendor/assets/images/flags/by.png +0 -0
- data/vendor/assets/images/flags/bz.png +0 -0
- data/vendor/assets/images/flags/ca.png +0 -0
- data/vendor/assets/images/flags/catalonia.png +0 -0
- data/vendor/assets/images/flags/cc.png +0 -0
- data/vendor/assets/images/flags/cd.png +0 -0
- data/vendor/assets/images/flags/cf.png +0 -0
- data/vendor/assets/images/flags/cg.png +0 -0
- data/vendor/assets/images/flags/ch.png +0 -0
- data/vendor/assets/images/flags/ci.png +0 -0
- data/vendor/assets/images/flags/ck.png +0 -0
- data/vendor/assets/images/flags/cl.png +0 -0
- data/vendor/assets/images/flags/cm.png +0 -0
- data/vendor/assets/images/flags/cn.png +0 -0
- data/vendor/assets/images/flags/co.png +0 -0
- data/vendor/assets/images/flags/cr.png +0 -0
- data/vendor/assets/images/flags/cs.png +0 -0
- data/vendor/assets/images/flags/cu.png +0 -0
- data/vendor/assets/images/flags/cv.png +0 -0
- data/vendor/assets/images/flags/cx.png +0 -0
- data/vendor/assets/images/flags/cy.png +0 -0
- data/vendor/assets/images/flags/cz.png +0 -0
- data/vendor/assets/images/flags/de.png +0 -0
- data/vendor/assets/images/flags/dj.png +0 -0
- data/vendor/assets/images/flags/dk.png +0 -0
- data/vendor/assets/images/flags/dm.png +0 -0
- data/vendor/assets/images/flags/do.png +0 -0
- data/vendor/assets/images/flags/dz.png +0 -0
- data/vendor/assets/images/flags/ec.png +0 -0
- data/vendor/assets/images/flags/ee.png +0 -0
- data/vendor/assets/images/flags/eg.png +0 -0
- data/vendor/assets/images/flags/eh.png +0 -0
- data/vendor/assets/images/flags/england.png +0 -0
- data/vendor/assets/images/flags/er.png +0 -0
- data/vendor/assets/images/flags/es.png +0 -0
- data/vendor/assets/images/flags/et.png +0 -0
- data/vendor/assets/images/flags/europeanunion.png +0 -0
- data/vendor/assets/images/flags/fam.png +0 -0
- data/vendor/assets/images/flags/fi.png +0 -0
- data/vendor/assets/images/flags/fj.png +0 -0
- data/vendor/assets/images/flags/fk.png +0 -0
- data/vendor/assets/images/flags/fm.png +0 -0
- data/vendor/assets/images/flags/fo.png +0 -0
- data/vendor/assets/images/flags/fr.png +0 -0
- data/vendor/assets/images/flags/ga.png +0 -0
- data/vendor/assets/images/flags/gb.png +0 -0
- data/vendor/assets/images/flags/gd.png +0 -0
- data/vendor/assets/images/flags/ge.png +0 -0
- data/vendor/assets/images/flags/gf.png +0 -0
- data/vendor/assets/images/flags/gh.png +0 -0
- data/vendor/assets/images/flags/gi.png +0 -0
- data/vendor/assets/images/flags/gl.png +0 -0
- data/vendor/assets/images/flags/gm.png +0 -0
- data/vendor/assets/images/flags/gn.png +0 -0
- data/vendor/assets/images/flags/gp.png +0 -0
- data/vendor/assets/images/flags/gq.png +0 -0
- data/vendor/assets/images/flags/gr.png +0 -0
- data/vendor/assets/images/flags/gs.png +0 -0
- data/vendor/assets/images/flags/gt.png +0 -0
- data/vendor/assets/images/flags/gu.png +0 -0
- data/vendor/assets/images/flags/gw.png +0 -0
- data/vendor/assets/images/flags/gy.png +0 -0
- data/vendor/assets/images/flags/hk.png +0 -0
- data/vendor/assets/images/flags/hm.png +0 -0
- data/vendor/assets/images/flags/hn.png +0 -0
- data/vendor/assets/images/flags/hr.png +0 -0
- data/vendor/assets/images/flags/ht.png +0 -0
- data/vendor/assets/images/flags/hu.png +0 -0
- data/vendor/assets/images/flags/id.png +0 -0
- data/vendor/assets/images/flags/ie.png +0 -0
- data/vendor/assets/images/flags/il.png +0 -0
- data/vendor/assets/images/flags/in.png +0 -0
- data/vendor/assets/images/flags/io.png +0 -0
- data/vendor/assets/images/flags/iq.png +0 -0
- data/vendor/assets/images/flags/ir.png +0 -0
- data/vendor/assets/images/flags/is.png +0 -0
- data/vendor/assets/images/flags/it.png +0 -0
- data/vendor/assets/images/flags/ja.png +0 -0
- data/vendor/assets/images/flags/jm.png +0 -0
- data/vendor/assets/images/flags/jo.png +0 -0
- data/vendor/assets/images/flags/ke.png +0 -0
- data/vendor/assets/images/flags/kg.png +0 -0
- data/vendor/assets/images/flags/kh.png +0 -0
- data/vendor/assets/images/flags/ki.png +0 -0
- data/vendor/assets/images/flags/km.png +0 -0
- data/vendor/assets/images/flags/kn.png +0 -0
- data/vendor/assets/images/flags/kp.png +0 -0
- data/vendor/assets/images/flags/kr.png +0 -0
- data/vendor/assets/images/flags/kw.png +0 -0
- data/vendor/assets/images/flags/ky.png +0 -0
- data/vendor/assets/images/flags/kz.png +0 -0
- data/vendor/assets/images/flags/la.png +0 -0
- data/vendor/assets/images/flags/lb.png +0 -0
- data/vendor/assets/images/flags/lc.png +0 -0
- data/vendor/assets/images/flags/li.png +0 -0
- data/vendor/assets/images/flags/lk.png +0 -0
- data/vendor/assets/images/flags/lr.png +0 -0
- data/vendor/assets/images/flags/ls.png +0 -0
- data/vendor/assets/images/flags/lt.png +0 -0
- data/vendor/assets/images/flags/lu.png +0 -0
- data/vendor/assets/images/flags/lv.png +0 -0
- data/vendor/assets/images/flags/ly.png +0 -0
- data/vendor/assets/images/flags/ma.png +0 -0
- data/vendor/assets/images/flags/mc.png +0 -0
- data/vendor/assets/images/flags/md.png +0 -0
- data/vendor/assets/images/flags/me.png +0 -0
- data/vendor/assets/images/flags/mg.png +0 -0
- data/vendor/assets/images/flags/mh.png +0 -0
- data/vendor/assets/images/flags/mk.png +0 -0
- data/vendor/assets/images/flags/ml.png +0 -0
- data/vendor/assets/images/flags/mm.png +0 -0
- data/vendor/assets/images/flags/mn.png +0 -0
- data/vendor/assets/images/flags/mo.png +0 -0
- data/vendor/assets/images/flags/mp.png +0 -0
- data/vendor/assets/images/flags/mq.png +0 -0
- data/vendor/assets/images/flags/mr.png +0 -0
- data/vendor/assets/images/flags/ms.png +0 -0
- data/vendor/assets/images/flags/mt.png +0 -0
- data/vendor/assets/images/flags/mu.png +0 -0
- data/vendor/assets/images/flags/mv.png +0 -0
- data/vendor/assets/images/flags/mw.png +0 -0
- data/vendor/assets/images/flags/mx.png +0 -0
- data/vendor/assets/images/flags/my.png +0 -0
- data/vendor/assets/images/flags/mz.png +0 -0
- data/vendor/assets/images/flags/na.png +0 -0
- data/vendor/assets/images/flags/nc.png +0 -0
- data/vendor/assets/images/flags/ne.png +0 -0
- data/vendor/assets/images/flags/nf.png +0 -0
- data/vendor/assets/images/flags/ng.png +0 -0
- data/vendor/assets/images/flags/ni.png +0 -0
- data/vendor/assets/images/flags/nl.png +0 -0
- data/vendor/assets/images/flags/no.png +0 -0
- data/vendor/assets/images/flags/np.png +0 -0
- data/vendor/assets/images/flags/nr.png +0 -0
- data/vendor/assets/images/flags/nu.png +0 -0
- data/vendor/assets/images/flags/nz.png +0 -0
- data/vendor/assets/images/flags/om.png +0 -0
- data/vendor/assets/images/flags/pa.png +0 -0
- data/vendor/assets/images/flags/pe.png +0 -0
- data/vendor/assets/images/flags/pf.png +0 -0
- data/vendor/assets/images/flags/pg.png +0 -0
- data/vendor/assets/images/flags/ph.png +0 -0
- data/vendor/assets/images/flags/pk.png +0 -0
- data/vendor/assets/images/flags/pl.png +0 -0
- data/vendor/assets/images/flags/pm.png +0 -0
- data/vendor/assets/images/flags/pn.png +0 -0
- data/vendor/assets/images/flags/pr.png +0 -0
- data/vendor/assets/images/flags/ps.png +0 -0
- data/vendor/assets/images/flags/pt.png +0 -0
- data/vendor/assets/images/flags/pw.png +0 -0
- data/vendor/assets/images/flags/py.png +0 -0
- data/vendor/assets/images/flags/qa.png +0 -0
- data/vendor/assets/images/flags/re.png +0 -0
- data/vendor/assets/images/flags/ro.png +0 -0
- data/vendor/assets/images/flags/rs.png +0 -0
- data/vendor/assets/images/flags/ru.png +0 -0
- data/vendor/assets/images/flags/rw.png +0 -0
- data/vendor/assets/images/flags/sa.png +0 -0
- data/vendor/assets/images/flags/sb.png +0 -0
- data/vendor/assets/images/flags/sc.png +0 -0
- data/vendor/assets/images/flags/scotland.png +0 -0
- data/vendor/assets/images/flags/sd.png +0 -0
- data/vendor/assets/images/flags/se.png +0 -0
- data/vendor/assets/images/flags/sg.png +0 -0
- data/vendor/assets/images/flags/sh.png +0 -0
- data/vendor/assets/images/flags/si.png +0 -0
- data/vendor/assets/images/flags/sj.png +0 -0
- data/vendor/assets/images/flags/sk.png +0 -0
- data/vendor/assets/images/flags/sl.png +0 -0
- data/vendor/assets/images/flags/sm.png +0 -0
- data/vendor/assets/images/flags/sn.png +0 -0
- data/vendor/assets/images/flags/so.png +0 -0
- data/vendor/assets/images/flags/sr.png +0 -0
- data/vendor/assets/images/flags/st.png +0 -0
- data/vendor/assets/images/flags/sv.png +0 -0
- data/vendor/assets/images/flags/sy.png +0 -0
- data/vendor/assets/images/flags/sz.png +0 -0
- data/vendor/assets/images/flags/tc.png +0 -0
- data/vendor/assets/images/flags/td.png +0 -0
- data/vendor/assets/images/flags/tf.png +0 -0
- data/vendor/assets/images/flags/tg.png +0 -0
- data/vendor/assets/images/flags/th.png +0 -0
- data/vendor/assets/images/flags/tj.png +0 -0
- data/vendor/assets/images/flags/tk.png +0 -0
- data/vendor/assets/images/flags/tl.png +0 -0
- data/vendor/assets/images/flags/tm.png +0 -0
- data/vendor/assets/images/flags/tn.png +0 -0
- data/vendor/assets/images/flags/to.png +0 -0
- data/vendor/assets/images/flags/tr.png +0 -0
- data/vendor/assets/images/flags/tt.png +0 -0
- data/vendor/assets/images/flags/tv.png +0 -0
- data/vendor/assets/images/flags/tw.png +0 -0
- data/vendor/assets/images/flags/tz.png +0 -0
- data/vendor/assets/images/flags/ua.png +0 -0
- data/vendor/assets/images/flags/ug.png +0 -0
- data/vendor/assets/images/flags/um.png +0 -0
- data/vendor/assets/images/flags/us.png +0 -0
- data/vendor/assets/images/flags/uy.png +0 -0
- data/vendor/assets/images/flags/uz.png +0 -0
- data/vendor/assets/images/flags/va.png +0 -0
- data/vendor/assets/images/flags/vc.png +0 -0
- data/vendor/assets/images/flags/ve.png +0 -0
- data/vendor/assets/images/flags/vg.png +0 -0
- data/vendor/assets/images/flags/vi.png +0 -0
- data/vendor/assets/images/flags/vn.png +0 -0
- data/vendor/assets/images/flags/vu.png +0 -0
- data/vendor/assets/images/flags/wales.png +0 -0
- data/vendor/assets/images/flags/wf.png +0 -0
- data/vendor/assets/images/flags/ws.png +0 -0
- data/vendor/assets/images/flags/ye.png +0 -0
- data/vendor/assets/images/flags/yt.png +0 -0
- data/vendor/assets/images/flags/za.png +0 -0
- data/vendor/assets/images/flags/zm.png +0 -0
- data/vendor/assets/images/flags/zw.png +0 -0
- data/vendor/assets/javascripts/css_browser_selector_dev.js +156 -0
- data/vendor/assets/javascripts/equalize.js +41 -0
- data/vendor/assets/javascripts/handlebars.js +1920 -0
- data/vendor/assets/javascripts/jquery.adaptivemenu.js +60 -0
- data/vendor/assets/javascripts/jquery.horizontalNav.js +141 -0
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/style.css +3 -3
- data/vendor/assets/javascripts/jquery.powertip.js +796 -0
- data/vendor/assets/javascripts/jquery.vAlign.js +11 -0
- data/vendor/assets/javascripts/modernizr.js +4 -0
- data/vendor/assets/javascripts/responsive-tables.js +42 -0
- data/vendor/assets/javascripts/spin.js +319 -0
- data/vendor/assets/javascripts/trunk8.js +233 -0
- data/vendor/assets/stylesheets/font-awesome-ie7.css +645 -0
- data/vendor/assets/stylesheets/jquery.powertip.css +85 -0
- data/vendor/assets/stylesheets/normalize.css +375 -0
- data/vendor/assets/stylesheets/responsive-tables.css +21 -0
- data/vendor/assets/stylesheets/skeleton.css +4 -4
- metadata +394 -281
- checksums.yaml +0 -7
- data/app/assets/images/admin/bg/active-tab.png +0 -0
- data/app/assets/images/admin/bg/admin_tab_back.png +0 -0
- data/app/assets/images/admin/bg/admin_tab_selected_back.png +0 -0
- data/app/assets/images/admin/bg/content-back-blue.png +0 -0
- data/app/assets/images/admin/bg/content-back-green.png +0 -0
- data/app/assets/images/admin/bg/content-back.png +0 -0
- data/app/assets/images/admin/bg/flash-error.png +0 -0
- data/app/assets/images/admin/bg/flash-notice.png +0 -0
- data/app/assets/images/admin/bg/green-stripes.gif +0 -0
- data/app/assets/images/admin/bg/green-stripes.png +0 -0
- data/app/assets/images/admin/bg/grid_header_back.png +0 -0
- data/app/assets/images/admin/bg/grid_header_back_green.png +0 -0
- data/app/assets/images/admin/bg/header-bg.png +0 -0
- data/app/assets/images/admin/bg/header.png +0 -0
- data/app/assets/images/admin/bg/header_bg.jpg +0 -0
- data/app/assets/images/admin/bg/menu-current.png +0 -0
- data/app/assets/images/admin/bg/red-stripes.gif +0 -0
- data/app/assets/images/admin/bg/red-stripes.png +0 -0
- data/app/assets/images/admin/bg/subnav-divider.png +0 -0
- data/app/assets/images/admin/bg/subnav.png +0 -0
- data/app/assets/images/admin/bg/tab-back.png +0 -0
- data/app/assets/images/admin/buttons/blue/left_01.png +0 -0
- data/app/assets/images/admin/buttons/blue/right_01.png +0 -0
- data/app/assets/images/admin/buttons/drag-handle-green.png +0 -0
- data/app/assets/images/admin/buttons/green/left_01.png +0 -0
- data/app/assets/images/admin/buttons/green/right_01.png +0 -0
- data/app/assets/images/admin/buttons/left_01.png +0 -0
- data/app/assets/images/admin/buttons/left_01_small.png +0 -0
- data/app/assets/images/admin/buttons/orange/left_03.png +0 -0
- data/app/assets/images/admin/buttons/orange/right_03.png +0 -0
- data/app/assets/images/admin/buttons/right_01.png +0 -0
- data/app/assets/images/admin/buttons/right_01_small.png +0 -0
- data/app/assets/images/admin/icons/16x16/1.png +0 -0
- data/app/assets/images/admin/icons/16x16/10.png +0 -0
- data/app/assets/images/admin/icons/16x16/2.png +0 -0
- data/app/assets/images/admin/icons/16x16/3.png +0 -0
- data/app/assets/images/admin/icons/16x16/4.png +0 -0
- data/app/assets/images/admin/icons/16x16/5.png +0 -0
- data/app/assets/images/admin/icons/16x16/6.png +0 -0
- data/app/assets/images/admin/icons/16x16/7.png +0 -0
- data/app/assets/images/admin/icons/16x16/8.png +0 -0
- data/app/assets/images/admin/icons/16x16/9.png +0 -0
- data/app/assets/images/admin/icons/32x32/1.png +0 -0
- data/app/assets/images/admin/icons/32x32/10.png +0 -0
- data/app/assets/images/admin/icons/32x32/11.png +0 -0
- data/app/assets/images/admin/icons/32x32/2.png +0 -0
- data/app/assets/images/admin/icons/32x32/3.png +0 -0
- data/app/assets/images/admin/icons/32x32/4.png +0 -0
- data/app/assets/images/admin/icons/32x32/5.png +0 -0
- data/app/assets/images/admin/icons/32x32/6.png +0 -0
- data/app/assets/images/admin/icons/32x32/7.png +0 -0
- data/app/assets/images/admin/icons/32x32/8.png +0 -0
- data/app/assets/images/admin/icons/32x32/9.png +0 -0
- data/app/assets/images/admin/icons/accept.png +0 -0
- data/app/assets/images/admin/icons/add.gif +0 -0
- data/app/assets/images/admin/icons/add.png +0 -0
- data/app/assets/images/admin/icons/arrow-down.gif +0 -0
- data/app/assets/images/admin/icons/cross.png +0 -0
- data/app/assets/images/admin/icons/delete.gif +0 -0
- data/app/assets/images/admin/icons/delete.png +0 -0
- data/app/assets/images/admin/icons/drag.gif +0 -0
- data/app/assets/images/admin/icons/edit.gif +0 -0
- data/app/assets/images/admin/icons/edit.png +0 -0
- data/app/assets/images/admin/icons/email.png +0 -0
- data/app/assets/images/admin/icons/error.png +0 -0
- data/app/assets/images/admin/icons/exclamation.png +0 -0
- data/app/assets/images/admin/icons/feed.png +0 -0
- data/app/assets/images/admin/icons/pdf.png +0 -0
- data/app/assets/images/admin/icons/reorder.gif +0 -0
- data/app/assets/images/admin/icons/search.gif +0 -0
- data/app/assets/images/admin/icons/send-email.png +0 -0
- data/app/assets/images/admin/icons/stop.png +0 -0
- data/app/assets/images/admin/icons/switch.png +0 -0
- data/app/assets/images/admin/icons/tick.png +0 -0
- data/app/assets/images/admin/icons/up.gif +0 -0
- data/app/assets/images/admin/icons/xls.png +0 -0
- data/app/assets/images/credit_cards/icons/diners_club.png +0 -0
- data/app/assets/javascripts/admin/image_settings.js +0 -49
- data/app/assets/javascripts/admin/product_autocomplete.js.erb +0 -117
- data/app/assets/stylesheets/admin/admin-form.css.erb +0 -167
- data/app/assets/stylesheets/admin/admin-reset.css +0 -69
- data/app/assets/stylesheets/admin/admin-tables.css.erb +0 -40
- data/app/assets/stylesheets/admin/admin-typography.css +0 -117
- data/app/assets/stylesheets/admin/admin.css.erb +0 -682
- data/app/controllers/spree/admin/configurations_controller.rb +0 -7
- data/app/controllers/spree/admin/mail_settings_controller.rb +0 -17
- data/app/controllers/spree/admin/option_values_controller.rb +0 -11
- data/app/helpers/spree/account_helper.rb +0 -4
- data/app/helpers/spree/admin/overview_helper.rb +0 -16
- data/app/helpers/spree/admin/users_helper.rb +0 -10
- data/app/helpers/spree/admin/zones_helper.rb +0 -15
- data/app/helpers/spree/orders_helper.rb +0 -5
- data/app/helpers/spree/search_helper.rb +0 -12
- data/app/helpers/spree/trackers_helper.rb +0 -4
- data/app/views/spree/admin/configurations/index.html.erb +0 -68
- data/app/views/spree/admin/general_settings/show.html.erb +0 -40
- data/app/views/spree/admin/image_settings/show.html.erb +0 -11
- data/app/views/spree/admin/shared/_new_adjustment_button.html.erb +0 -8
- data/app/views/spree/admin/shared/_order_sub_menu.html.erb +0 -0
- data/app/views/spree/admin/tax_settings/show.html.erb +0 -14
- data/config/initializers/rails_3_1.rb +0 -12
- data/db/migrate/20090823005402_spree_zero_nine_zero.rb +0 -391
- data/db/migrate/20090904192342_create_indexes_for_inventory_units.rb +0 -6
- data/db/migrate/20090923100315_add_count_on_hand_to_variants_and_products.rb +0 -49
- data/db/migrate/20091007134354_change_taxons_to_nested_set.rb +0 -46
- data/db/migrate/20091008091614_move_to_configurable_gateways.rb +0 -54
- data/db/migrate/20091015110842_add_open_id_authentication_tables.rb +0 -15
- data/db/migrate/20091015153048_add_openid_field_to_users.rb +0 -26
- data/db/migrate/20091016174634_change_preference_value_type.rb +0 -10
- data/db/migrate/20091017175558_create_billing_integrations.rb +0 -12
- data/db/migrate/20091021133257_charge_refactoring.rb +0 -39
- data/db/migrate/20091104151730_add_some_indexes.rb +0 -11
- data/db/migrate/20091126190904_checkout_state_machine.rb +0 -5
- data/db/migrate/20091209153045_state_for_shipments.rb +0 -5
- data/db/migrate/20091209202200_make_state_events_polymorphic.rb +0 -12
- data/db/migrate/20091211203813_ship_address_id_for_checkouts.rb +0 -5
- data/db/migrate/20091212161118_shipping_method_id_for_checkouts.rb +0 -5
- data/db/migrate/20091213222815_creditcard_last_four_digits.rb +0 -14
- data/db/migrate/20091214183826_populate_legacy_shipment_state.rb +0 -15
- data/db/migrate/20100105090147_add_cost_price.rb +0 -5
- data/db/migrate/20100105132138_shipment_id_for_inventory_units.rb +0 -25
- data/db/migrate/20100111205525_cim_fields_for_creditcards.rb +0 -6
- data/db/migrate/20100112151511_create_return_authorizations.rb +0 -12
- data/db/migrate/20100113090919_add_return_authorization_to_inventory_units.rb +0 -5
- data/db/migrate/20100113203104_create_trackers.rb +0 -10
- data/db/migrate/20100121160010_creditcard_id_for_creditcard_txns.rb +0 -5
- data/db/migrate/20100121183934_original_creditcard_txn_id_for_creditcard_txns.rb +0 -5
- data/db/migrate/20100125145351_add_test_mode_to_billing_integration.rb +0 -6
- data/db/migrate/20100209025806_create_payment_methods.rb +0 -16
- data/db/migrate/20100209144531_polymorphic_payments.rb +0 -42
- data/db/migrate/20100213103131_change_payments_payment_method_to_belongs_to.rb +0 -11
- data/db/migrate/20100214212536_assign_creditcard_txns_to_payment.rb +0 -23
- data/db/migrate/20100223170312_sti_for_transactions.rb +0 -15
- data/db/migrate/20100223183812_drop_billing_integrations.rb +0 -16
- data/db/migrate/20100224153127_deleted_at_for_payment_methods.rb +0 -14
- data/db/migrate/20100301163454_add_adjustments_index.rb +0 -6
- data/db/migrate/20100317120946_add_alt_text_to_images.rb +0 -5
- data/db/migrate/20100419194457_fix_existing_coupon_credits.rb +0 -13
- data/db/migrate/20100427121301_add_display_to_payment_methods.rb +0 -5
- data/db/migrate/20100504142133_add_addresses_checkouts_indexes.rb +0 -8
- data/db/migrate/20100506180619_add_icon_to_taxons.rb +0 -17
- data/db/migrate/20100506185838_add_description_to_taxons.rb +0 -11
- data/db/migrate/20100528155333_index_for_shipments_number.rb +0 -5
- data/db/migrate/20100528185820_add_index_on_users_persistence_token.rb +0 -7
- data/db/migrate/20100605152042_add_default_to_tax_categories.rb +0 -5
- data/db/migrate/20100624110730_add_display_to_shipping_methods.rb +0 -5
- data/db/migrate/20100624123336_rename_payment_method_display.rb +0 -5
- data/db/migrate/20100624175547_rename_preferences_field.rb +0 -5
- data/db/migrate/20100811163637_add_guest_flag.rb +0 -7
- data/db/migrate/20100811205836_drop_order_token.rb +0 -9
- data/db/migrate/20100812162326_payments_state_and_assigned_to_order_only.rb +0 -14
- data/db/migrate/20100813023502_create_address_keys_for_order.rb +0 -6
- data/db/migrate/20100813185745_payment_total_for_orders.rb +0 -5
- data/db/migrate/20100816212146_shipping_method_id_for_orders.rb +0 -5
- data/db/migrate/20100817152723_add_shipment_and_payment_state.rb +0 -6
- data/db/migrate/20100819170125_refactor_adjustments.rb +0 -29
- data/db/migrate/20100820135707_response_code_and_avs_response_for_payments.rb +0 -6
- data/db/migrate/20100901171814_change_guest_flag_to_anonymous.rb +0 -7
- data/db/migrate/20100903203949_email_for_orders.rb +0 -5
- data/db/migrate/20100923162011_create_mail_methods.rb +0 -10
- data/db/migrate/20100929151905_rename_frozen_to_locked.rb +0 -5
- data/db/migrate/20101008190536_move_special_instructions_to_orders.rb +0 -10
- data/db/migrate/20101026184700_create_log_entries.rb +0 -11
- data/db/migrate/20101026184714_migrate_transactions_to_payment_state.rb +0 -98
- data/db/migrate/20101026184746_delete_in_progress_orders.rb +0 -19
- data/db/migrate/20101026184808_migrate_checkout_to_orders.rb +0 -23
- data/db/migrate/20101026184855_remove_shipped_state.rb +0 -12
- data/db/migrate/20101026184916_prevent_nil_payment_total.rb +0 -8
- data/db/migrate/20101026184932_prevent_nil_email.rb +0 -9
- data/db/migrate/20101026184959_generate_anonymous_users.rb +0 -20
- data/db/migrate/20101026185022_update_order_state.rb +0 -12
- data/db/migrate/20101026192225_cleanup_legacy_tables.rb +0 -11
- data/db/migrate/20101028151745_remove_number_and_cvv_from_credicard.rb +0 -11
- data/db/migrate/20101103212716_drop_anonymous_field_for_user.rb +0 -11
- data/db/migrate/20101111133551_renamed_rma_cancelled_state.rb +0 -9
- data/db/migrate/20101117031806_fix_problematic_index_names.rb +0 -13
- data/db/migrate/20101223215658_add_position_to_variants.rb +0 -5
- data/db/migrate/20110110130847_add_next_state_to_state_events.rb +0 -5
- data/db/migrate/20110111122537_add_position_to_option_types.rb +0 -5
- data/db/migrate/20110314192118_remove_trailing_slashes_in_taxon_permalinks.rb +0 -19
- data/db/migrate/20110329141434_create_activators.rb +0 -14
- data/db/migrate/20110418151136_eligible_for_adjustments.rb +0 -5
- data/db/migrate/20111007143030_namespace_top_level_models.rb +0 -66
- data/db/migrate/20111107143030_migrate_namespaced_polymorphic_models.rb +0 -52
- data/db/migrate/20111201024007_make_adjustments_polymorphic.rb +0 -9
- data/db/migrate/20111215032408_add_company_to_addresses.rb +0 -5
- data/db/migrate/20111216154844_add_inc_tax_to_tax_rates.rb +0 -5
- data/db/migrate/20111219203242_rename_inc_price_attribute.rb +0 -5
- data/db/migrate/20111219205902_add_default_tax_zone.rb +0 -5
- data/db/migrate/20120105193911_associate_shipping_methods_and_shipping_categories.rb +0 -7
- data/db/migrate/20120105195817_add_match_rules_to_shipping_methods.rb +0 -7
- data/db/migrate/20120119024710_new_preferences.rb +0 -48
- data/db/migrate/20120203001428_rename_state_events_to_state_changes.rb +0 -9
- data/db/migrate/20120203153759_add_deleted_at_to_tax_category.rb +0 -5
- data/db/migrate/20120315064358_migrate_images_from_products_to_variants.rb +0 -37
- data/db/migrate/20120416233427_rename_attachment_size_to_attachment_file_size.rb +0 -5
- data/db/migrate/20120507232704_increase_scale_of_tax_rate_amount.rb +0 -9
- data/db/migrate/20120509055454_create_tokenized_permissions_table.rb +0 -16
- data/db/migrate/20120523061241_convert_sales_tax_to_default_tax.rb +0 -9
- data/db/migrate/20120530012000_rename_creditcards_to_credit_cards.rb +0 -11
- data/db/migrate/20120604030249_add_deleted_at_to_spree_shipping_methods.rb +0 -5
- data/db/migrate/20120604203654_remove_credit_total_from_orders.rb +0 -5
- data/db/migrate/20120712172620_add_counter_cache_to_zone_members.rb +0 -14
- data/db/migrate/20130203232234_add_identifier_to_spree_payments.rb +0 -5
- data/db/migrate/20130222032153_add_order_id_index_to_shipments.rb +0 -5
- data/lib/spree/core/authorize_net_cim_hack.rb +0 -871
- data/lib/spree/core/controller_helpers.rb +0 -185
- data/lib/spree/core/current_order.rb +0 -38
- data/lib/spree/core/file_utilz.rb +0 -74
- data/lib/tasks/assets.rake +0 -58
- data/vendor/assets/stylesheets/html5reset.css +0 -177
@@ -1,9 +0,0 @@
|
|
1
|
-
class MakeAdjustmentsPolymorphic < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def change
|
4
|
-
add_column :spree_adjustments, :adjustable_type, :string
|
5
|
-
rename_column :spree_adjustments, :order_id, :adjustable_id
|
6
|
-
execute "UPDATE spree_adjustments SET adjustable_type = 'Spree::Order'"
|
7
|
-
end
|
8
|
-
|
9
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'spree/core/preference_rescue'
|
2
|
-
|
3
|
-
class NewPreferences < ActiveRecord::Migration
|
4
|
-
|
5
|
-
def up
|
6
|
-
add_column :spree_preferences, :key, :string
|
7
|
-
add_column :spree_preferences, :value_type, :string
|
8
|
-
add_index :spree_preferences, :key, :unique => true
|
9
|
-
|
10
|
-
remove_index :spree_preferences, :name => 'ix_prefs_on_owner_attr_pref'
|
11
|
-
|
12
|
-
# remove old constraints for migration
|
13
|
-
change_column :spree_preferences, :name, :string, :null => true
|
14
|
-
change_column :spree_preferences, :owner_id, :integer, :null => true
|
15
|
-
change_column :spree_preferences, :owner_type, :string, :null => true
|
16
|
-
change_column :spree_preferences, :group_id, :integer, :null => true
|
17
|
-
change_column :spree_preferences, :group_type, :string, :null => true
|
18
|
-
|
19
|
-
cfgs = execute("select id, type from spree_configurations").to_a
|
20
|
-
execute("select id, owner_id, name from spree_preferences where owner_type = 'Spree::Configuration'").each do |pref|
|
21
|
-
configuration = cfgs.detect { |c| c[0].to_s == pref[1].to_s }
|
22
|
-
|
23
|
-
value_type = configuration[1].constantize.new.send "preferred_#{pref[2]}_type" rescue 'string'
|
24
|
-
|
25
|
-
execute "UPDATE spree_preferences set `key` = '#{configuration[1].underscore}/#{pref[2]}', `value_type` = '#{value_type}' where id = #{pref[0]}" rescue nil
|
26
|
-
end
|
27
|
-
|
28
|
-
# remove orphaned calculator preferences
|
29
|
-
Spree::Preference.where(:owner_type => 'Spree::Calculator').each do |preference|
|
30
|
-
preference.destroy unless Spree::Calculator.exists? preference.owner_id
|
31
|
-
end
|
32
|
-
|
33
|
-
Spree::PreferenceRescue.try
|
34
|
-
|
35
|
-
Spree::Preference.where(:value_type => nil).update_all(:value_type => 'string')
|
36
|
-
end
|
37
|
-
|
38
|
-
def down
|
39
|
-
remove_column :spree_preferences, :key
|
40
|
-
remove_column :spree_preferences, :value_type
|
41
|
-
|
42
|
-
add_column :spree_preferences, :name, :string
|
43
|
-
add_column :spree_preferences, :owner_id, :integer
|
44
|
-
add_column :spree_preferences, :owner_type, :string
|
45
|
-
add_column :spree_preferences, :group_id, :integer
|
46
|
-
add_column :spree_preferences, :group_type, :string
|
47
|
-
end
|
48
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
class MigrateImagesFromProductsToVariants < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
images = select_all("SELECT spree_assets.* FROM spree_assets
|
4
|
-
WHERE spree_assets.type = 'Spree::Image'
|
5
|
-
AND spree_assets.viewable_type = 'Spree::Product'
|
6
|
-
AND spree_assets.viewable_id IS NOT NULL")
|
7
|
-
|
8
|
-
images.each do |image|
|
9
|
-
master_variant_id = select_value("SELECT id FROM spree_variants
|
10
|
-
WHERE product_id = #{image['viewable_id']}
|
11
|
-
AND is_master = #{quoted_true}")
|
12
|
-
|
13
|
-
execute("UPDATE spree_assets SET viewable_type = 'Spree::Variant', viewable_id = #{master_variant_id}
|
14
|
-
WHERE id = #{image['id']}") if master_variant_id
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def down
|
19
|
-
images = select_all("SELECT spree_assets.* FROM spree_assets
|
20
|
-
JOIN spree_variants
|
21
|
-
ON spree_variants.id = spree_assets.viewable_id
|
22
|
-
AND spree_variants.is_master = #{quoted_true}
|
23
|
-
WHERE spree_assets.type = 'Spree::Image'
|
24
|
-
AND spree_assets.viewable_type = 'Spree::Variant'
|
25
|
-
AND spree_assets.viewable_id IS NOT NULL")
|
26
|
-
|
27
|
-
images.each do |image|
|
28
|
-
product_id = select_value("SELECT spree_products.id FROM spree_products
|
29
|
-
JOIN spree_variants
|
30
|
-
ON spree_variants.id = #{image['viewable_id']}
|
31
|
-
AND spree_products.id = spree_variants.product_id")
|
32
|
-
|
33
|
-
execute("UPDATE spree_assets SET viewable_type = 'Spree::Product', viewable_id = #{product_id}
|
34
|
-
WHERE id = #{image['id']}") if product_id
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class IncreaseScaleOfTaxRateAmount < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
change_column :spree_tax_rates, :amount, :decimal, { :scale => 5, :precision => 8 }
|
4
|
-
end
|
5
|
-
|
6
|
-
def down
|
7
|
-
change_column :spree_tax_rates, :amount, :decimal, { :scale => 4, :precision => 8 }
|
8
|
-
end
|
9
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class CreateTokenizedPermissionsTable < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
unless Spree::TokenizedPermission.table_exists?
|
4
|
-
create_table :spree_tokenized_permissions do |t|
|
5
|
-
t.integer :permissable_id
|
6
|
-
t.string :permissable_type
|
7
|
-
t.string :token
|
8
|
-
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
|
12
|
-
add_index :spree_tokenized_permissions, [:permissable_id, :permissable_type], :name => 'index_tokenized_name_and_type'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class ConvertSalesTaxToDefaultTax < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
execute "UPDATE spree_calculators SET type='Spree::Calculator::DefaultTax' WHERE type='Spree::Calculator::SalesTax'"
|
4
|
-
end
|
5
|
-
|
6
|
-
def down
|
7
|
-
execute "UPDATE spree_calculators SET type='Spree::Calculator::SalesTax' WHERE type='Spree::Calculator::DefaultTax'"
|
8
|
-
end
|
9
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class RenameCreditcardsToCreditCards < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
rename_table :spree_creditcards, :spree_credit_cards
|
4
|
-
execute("UPDATE spree_payments SET source_type = 'Spree::CreditCard' WHERE source_type = 'Spree::Creditcard'")
|
5
|
-
end
|
6
|
-
|
7
|
-
def down
|
8
|
-
execute("UPDATE spree_payments SET source_type = 'Spree::Creditcard' WHERE source_type = 'Spree::CreditCard'")
|
9
|
-
rename_table :spree_credit_cards, :spree_creditcards
|
10
|
-
end
|
11
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class AddCounterCacheToZoneMembers < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
add_column :spree_zones, :zone_members_count, :integer, :default => 0
|
4
|
-
|
5
|
-
Spree::Zone.reset_column_information
|
6
|
-
Spree::Zone.find(:all).each do |zone|
|
7
|
-
Spree::Zone.update_counters zone.id, :zone_members_count => zone.zone_members.length
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def down
|
12
|
-
remove_column :spree_zones, :zone_members_count
|
13
|
-
end
|
14
|
-
end
|
@@ -1,871 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
# ==== Customer Information Manager (CIM)
|
4
|
-
#
|
5
|
-
# The Authorize.Net Customer Information Manager (CIM) is an optional additional service that allows you to store sensitive payment information on
|
6
|
-
# Authorize.Net's servers, simplifying payments for returning customers and recurring transactions. It can also help with Payment Card Industry (PCI)
|
7
|
-
# Data Security Standard compliance, since customer data is no longer stored locally.
|
8
|
-
#
|
9
|
-
# To use the AuthorizeNetCimGateway CIM must be enabled for your account.
|
10
|
-
#
|
11
|
-
# Information about CIM is available on the {Authorize.Net website}[http://www.authorize.net/solutions/merchantsolutions/merchantservices/cim/].
|
12
|
-
# Information about the CIM API is available at the {Authorize.Net Integration Center}[http://developer.authorize.net/]
|
13
|
-
#
|
14
|
-
# ==== Login and Password
|
15
|
-
#
|
16
|
-
# The login and password are not the username and password you use to
|
17
|
-
# login to the Authorize.Net Merchant Interface. Instead, you will
|
18
|
-
# use the API Login ID as the login and Transaction Key as the
|
19
|
-
# password.
|
20
|
-
#
|
21
|
-
# ==== How to Get Your API Login ID and Transaction Key
|
22
|
-
#
|
23
|
-
# 1. Log into the Merchant Interface
|
24
|
-
# 2. Select Settings from the Main Menu
|
25
|
-
# 3. Click on API Login ID and Transaction Key in the Security section
|
26
|
-
# 4. Type in the answer to the secret question configured on setup
|
27
|
-
# 5. Click Submit
|
28
|
-
class AuthorizeNetCimGateway < Gateway
|
29
|
-
|
30
|
-
class_attribute :test_url, :live_url
|
31
|
-
|
32
|
-
self.test_url = 'https://apitest.authorize.net/xml/v1/request.api'
|
33
|
-
self.live_url = 'https://api.authorize.net/xml/v1/request.api'
|
34
|
-
|
35
|
-
AUTHORIZE_NET_CIM_NAMESPACE = 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
|
36
|
-
|
37
|
-
CIM_ACTIONS = {
|
38
|
-
:create_customer_profile => 'createCustomerProfile',
|
39
|
-
:create_customer_payment_profile => 'createCustomerPaymentProfile',
|
40
|
-
:create_customer_shipping_address => 'createCustomerShippingAddress',
|
41
|
-
:get_customer_profile => 'getCustomerProfile',
|
42
|
-
:get_customer_payment_profile => 'getCustomerPaymentProfile',
|
43
|
-
:get_customer_shipping_address => 'getCustomerShippingAddress',
|
44
|
-
:delete_customer_profile => 'deleteCustomerProfile',
|
45
|
-
:delete_customer_payment_profile => 'deleteCustomerPaymentProfile',
|
46
|
-
:delete_customer_shipping_address => 'deleteCustomerShippingAddress',
|
47
|
-
:update_customer_profile => 'updateCustomerProfile',
|
48
|
-
:update_customer_payment_profile => 'updateCustomerPaymentProfile',
|
49
|
-
:update_customer_shipping_address => 'updateCustomerShippingAddress',
|
50
|
-
:create_customer_profile_transaction => 'createCustomerProfileTransaction',
|
51
|
-
:validate_customer_payment_profile => 'validateCustomerPaymentProfile'
|
52
|
-
}
|
53
|
-
|
54
|
-
CIM_TRANSACTION_TYPES = {
|
55
|
-
:auth_capture => 'profileTransAuthCapture',
|
56
|
-
:auth_only => 'profileTransAuthOnly',
|
57
|
-
:capture_only => 'profileTransCaptureOnly',
|
58
|
-
:prior_auth_capture => 'profileTransPriorAuthCapture',
|
59
|
-
:refund => 'profileTransRefund',
|
60
|
-
:void => 'profileTransVoid'
|
61
|
-
}
|
62
|
-
|
63
|
-
CIM_VALIDATION_MODES = {
|
64
|
-
:none => 'none',
|
65
|
-
:test => 'testMode',
|
66
|
-
:live => 'liveMode'
|
67
|
-
}
|
68
|
-
|
69
|
-
BANK_ACCOUNT_TYPES = {
|
70
|
-
:checking => 'checking',
|
71
|
-
:savings => 'savings',
|
72
|
-
:business_checking => 'businessChecking'
|
73
|
-
}
|
74
|
-
|
75
|
-
ECHECK_TYPES = {
|
76
|
-
:ccd => 'CCD',
|
77
|
-
:ppd => 'PPD'
|
78
|
-
}
|
79
|
-
|
80
|
-
self.homepage_url = 'http://www.authorize.net/'
|
81
|
-
self.display_name = 'Authorize.Net CIM'
|
82
|
-
self.supported_countries = ['US']
|
83
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
84
|
-
|
85
|
-
# Creates a new AuthorizeNetCimGateway
|
86
|
-
#
|
87
|
-
# The gateway requires that a valid API Login ID and Transaction Key be passed
|
88
|
-
# in the +options+ hash.
|
89
|
-
#
|
90
|
-
# ==== Options
|
91
|
-
#
|
92
|
-
# * <tt>:login</tt> -- The Authorize.Net API Login ID (REQUIRED)
|
93
|
-
# * <tt>:password</tt> -- The Authorize.Net Transaction Key. (REQUIRED)
|
94
|
-
# * <tt>:test</tt> -- +true+ or +false+. If true, perform transactions against the test server.
|
95
|
-
# Otherwise, perform transactions against the production server.
|
96
|
-
def initialize(options = {})
|
97
|
-
requires!(options, :login, :password)
|
98
|
-
@options = options
|
99
|
-
super
|
100
|
-
end
|
101
|
-
|
102
|
-
# Creates a new customer profile along with any customer payment profiles and customer shipping addresses
|
103
|
-
# for the customer profile.
|
104
|
-
#
|
105
|
-
# Returns a Response with the Customer Profile ID of the new customer profile in the authorization field.
|
106
|
-
# It is *CRITICAL* that you save this ID. There is no way to retrieve this through the API. You will not
|
107
|
-
# be able to create another Customer Profile with the same information.
|
108
|
-
#
|
109
|
-
# ==== Options
|
110
|
-
#
|
111
|
-
# TODO
|
112
|
-
def create_customer_profile(options)
|
113
|
-
# TODO Add requires
|
114
|
-
request = build_request(:create_customer_profile, options)
|
115
|
-
commit(:create_customer_profile, request)
|
116
|
-
end
|
117
|
-
|
118
|
-
# Creates a new customer payment profile for an existing customer profile.
|
119
|
-
#
|
120
|
-
# ==== Options
|
121
|
-
#
|
122
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer the payment profile will be added to. (REQUIRED)
|
123
|
-
# * <tt>:payment_profile</tt> -- A hash containing the elements of the new payment profile (REQUIRED)
|
124
|
-
#
|
125
|
-
# ==== Payment Profile
|
126
|
-
#
|
127
|
-
# * <tt>:payment</tt> -- A hash containing information on payment. Either :credit_card or :bank_account (REQUIRED)
|
128
|
-
def create_customer_payment_profile(options)
|
129
|
-
requires!(options, :customer_profile_id)
|
130
|
-
requires!(options, :payment_profile)
|
131
|
-
requires!(options[:payment_profile], :payment)
|
132
|
-
|
133
|
-
request = build_request(:create_customer_payment_profile, options)
|
134
|
-
commit(:create_customer_payment_profile, request)
|
135
|
-
end
|
136
|
-
|
137
|
-
# Creates a new customer shipping address for an existing customer profile.
|
138
|
-
#
|
139
|
-
# ==== Options
|
140
|
-
#
|
141
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer the payment profile will be added to. (REQUIRED)
|
142
|
-
# * <tt>:address</tt> -- A hash containing the elements of the shipping address (REQUIRED)
|
143
|
-
def create_customer_shipping_address(options)
|
144
|
-
requires!(options, :customer_profile_id)
|
145
|
-
requires!(options, :address)
|
146
|
-
|
147
|
-
request = build_request(:create_customer_shipping_address, options)
|
148
|
-
commit(:create_customer_shipping_address, request)
|
149
|
-
end
|
150
|
-
|
151
|
-
# Deletes an existing customer profile along with all associated customer payment profiles and customer shipping addresses.
|
152
|
-
#
|
153
|
-
# ==== Options
|
154
|
-
#
|
155
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer to be deleted. (REQUIRED)
|
156
|
-
def delete_customer_profile(options)
|
157
|
-
requires!(options, :customer_profile_id)
|
158
|
-
|
159
|
-
request = build_request(:delete_customer_profile, options)
|
160
|
-
commit(:delete_customer_profile, request)
|
161
|
-
end
|
162
|
-
|
163
|
-
# Deletes a customer payment profile from an existing customer profile.
|
164
|
-
#
|
165
|
-
# ==== Options
|
166
|
-
#
|
167
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer with the payment profile to be deleted. (REQUIRED)
|
168
|
-
# * <tt>:customer_payment_profile_id</tt> -- The Payment Profile ID of the payment profile to be deleted. (REQUIRED)
|
169
|
-
def delete_customer_payment_profile(options)
|
170
|
-
requires!(options, :customer_profile_id)
|
171
|
-
requires!(options, :customer_payment_profile_id)
|
172
|
-
|
173
|
-
request = build_request(:delete_customer_payment_profile, options)
|
174
|
-
commit(:delete_customer_payment_profile, request)
|
175
|
-
end
|
176
|
-
|
177
|
-
# Deletes a customer shipping address from an existing customer profile.
|
178
|
-
#
|
179
|
-
# ==== Options
|
180
|
-
#
|
181
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer with the payment profile to be deleted. (REQUIRED)
|
182
|
-
# * <tt>:customer_address_id</tt> -- The Shipping Address ID of the shipping address to be deleted. (REQUIRED)
|
183
|
-
def delete_customer_shipping_address(options)
|
184
|
-
requires!(options, :customer_profile_id)
|
185
|
-
requires!(options, :customer_address_id)
|
186
|
-
|
187
|
-
request = build_request(:delete_customer_shipping_address, options)
|
188
|
-
commit(:delete_customer_shipping_address, request)
|
189
|
-
end
|
190
|
-
|
191
|
-
# Retrieves an existing customer profile along with all the associated customer payment profiles and customer shipping addresses.
|
192
|
-
#
|
193
|
-
# Returns a Response whose params hash contains all the profile information.
|
194
|
-
#
|
195
|
-
# ==== Options
|
196
|
-
#
|
197
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer to retrieve. (REQUIRED)
|
198
|
-
def get_customer_profile(options)
|
199
|
-
requires!(options, :customer_profile_id)
|
200
|
-
|
201
|
-
request = build_request(:get_customer_profile, options)
|
202
|
-
commit(:get_customer_profile, request)
|
203
|
-
end
|
204
|
-
|
205
|
-
# Retrieve a customer payment profile for an existing customer profile.
|
206
|
-
#
|
207
|
-
# Returns a Response whose params hash contains all the payment profile information. Sensitive information such as credit card
|
208
|
-
# numbers will be masked.
|
209
|
-
#
|
210
|
-
# ==== Options
|
211
|
-
#
|
212
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer with the payment profile to be retrieved. (REQUIRED)
|
213
|
-
# * <tt>:customer_payment_profile_id</tt> -- The Payment Profile ID of the payment profile to be retrieved. (REQUIRED)
|
214
|
-
def get_customer_payment_profile(options)
|
215
|
-
requires!(options, :customer_profile_id)
|
216
|
-
requires!(options, :customer_payment_profile_id)
|
217
|
-
|
218
|
-
request = build_request(:get_customer_payment_profile, options)
|
219
|
-
commit(:get_customer_payment_profile, request)
|
220
|
-
end
|
221
|
-
|
222
|
-
# Retrieve a customer shipping address for an existing customer profile.
|
223
|
-
#
|
224
|
-
# Returns a Response whose params hash contains all the shipping address information.
|
225
|
-
#
|
226
|
-
# ==== Options
|
227
|
-
#
|
228
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer with the payment profile to be retrieved. (REQUIRED)
|
229
|
-
# * <tt>:customer_address_id</tt> -- The Shipping Address ID of the shipping address to be retrieved. (REQUIRED)
|
230
|
-
def get_customer_shipping_address(options)
|
231
|
-
requires!(options, :customer_profile_id)
|
232
|
-
requires!(options, :customer_address_id)
|
233
|
-
|
234
|
-
request = build_request(:get_customer_shipping_address, options)
|
235
|
-
commit(:get_customer_shipping_address, request)
|
236
|
-
end
|
237
|
-
|
238
|
-
# Updates an existing customer profile.
|
239
|
-
#
|
240
|
-
# Warning: if you do not provide a parameter in the <tt>:payment_profile</tt> hash, it is automatically set to nil at
|
241
|
-
# Authorize.Net. You will most likely want to first get the profile hash using get_customer_profile and then only change the
|
242
|
-
# elements you wish to change.
|
243
|
-
#
|
244
|
-
# ==== Options
|
245
|
-
#
|
246
|
-
# * <tt>:profile</tt> -- A hash containing the values the Customer Profile should be updated to. (REQUIRED)
|
247
|
-
#
|
248
|
-
# ==== Profile
|
249
|
-
#
|
250
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer profile to update. (REQUIRED)
|
251
|
-
def update_customer_profile(options)
|
252
|
-
requires!(options, :profile)
|
253
|
-
requires!(options[:profile], :customer_profile_id)
|
254
|
-
|
255
|
-
request = build_request(:update_customer_profile, options)
|
256
|
-
commit(:update_customer_profile, request)
|
257
|
-
end
|
258
|
-
|
259
|
-
# Updates a customer payment profile for an existing customer profile.
|
260
|
-
#
|
261
|
-
# Warning: if you do not provide a parameter in the <tt>:payment_profile</tt> hash, it is automatically set to nil at
|
262
|
-
# Authorize.Net. You will most likely want to first get the profile hash using get_customer_payment_profile and then only
|
263
|
-
# change the elements you wish to change.
|
264
|
-
#
|
265
|
-
# ==== Options
|
266
|
-
#
|
267
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer with the payment profile to be updated. (REQUIRED)
|
268
|
-
# * <tt>:payment_profile</tt> -- A hash containing the values the Customer Payment Profile should be updated to. (REQUIRED)
|
269
|
-
#
|
270
|
-
# ==== Payment Profile
|
271
|
-
#
|
272
|
-
# * <tt>:customer_payment_profile_id</tt> -- The Customer Payment Profile ID of the Customer Payment Profile to update. (REQUIRED)
|
273
|
-
def update_customer_payment_profile(options)
|
274
|
-
requires!(options, :customer_profile_id, :payment_profile)
|
275
|
-
requires!(options[:payment_profile], :customer_payment_profile_id)
|
276
|
-
|
277
|
-
request = build_request(:update_customer_payment_profile, options)
|
278
|
-
commit(:update_customer_payment_profile, request)
|
279
|
-
end
|
280
|
-
|
281
|
-
# Updates a customer shipping address for an existing customer profile.
|
282
|
-
#
|
283
|
-
# Warning: if you do not provide a parameter in the <tt>:address</tt> hash, it is automatically set to nil at
|
284
|
-
# Authorize.Net. You will most likely want to first get the profile hash using get_customer_shipping_address and then only
|
285
|
-
# change the elements you wish to change.
|
286
|
-
#
|
287
|
-
# ==== Options
|
288
|
-
#
|
289
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer with the payment profile to be updated. (REQUIRED)
|
290
|
-
# * <tt>:address</tt> -- A hash containing the values the Customer Shipping Address should be updated to. (REQUIRED)
|
291
|
-
#
|
292
|
-
# ==== Address
|
293
|
-
#
|
294
|
-
# * <tt>:customer_address_id</tt> -- The Customer Address ID of the Customer Payment Profile to update. (REQUIRED)
|
295
|
-
def update_customer_shipping_address(options)
|
296
|
-
requires!(options, :customer_profile_id, :address)
|
297
|
-
requires!(options[:address], :customer_address_id)
|
298
|
-
|
299
|
-
request = build_request(:update_customer_shipping_address, options)
|
300
|
-
commit(:update_customer_shipping_address, request)
|
301
|
-
end
|
302
|
-
|
303
|
-
# Creates a new payment transaction from an existing customer profile
|
304
|
-
#
|
305
|
-
# This is what is used to charge a customer whose information you have stored in a Customer Profile.
|
306
|
-
#
|
307
|
-
# Returns a Response object that contains the result of the transaction in <tt>params['direct_response']</tt>
|
308
|
-
#
|
309
|
-
# ==== Options
|
310
|
-
#
|
311
|
-
# * <tt>:transaction</tt> -- A hash containing information on the transaction that is being requested. (REQUIRED)
|
312
|
-
#
|
313
|
-
# ==== Transaction
|
314
|
-
#
|
315
|
-
# * <tt>:type</tt> -- The type of transaction. Can be either <tt>:auth_only</tt>, <tt>:capture_only</tt>, <tt>:auth_capture</tt>, <tt>:prior_auth_capture</tt>, <tt>:refund</tt> or <tt>:void</tt>. (REQUIRED)
|
316
|
-
# * <tt>:amount</tt> -- The amount for the tranaction. Formatted with a decimal. For example "4.95" (CONDITIONAL)
|
317
|
-
# - :type == :void (NOT USED)
|
318
|
-
# - :type == (:refund, :auth_only, :capture_only, :auth_capture, :prior_auth_capture) (REQUIRED)
|
319
|
-
#
|
320
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer to use in this transaction. (CONDITIONAL)
|
321
|
-
# - :type == (:void, :prior_auth_capture) (OPTIONAL)
|
322
|
-
# - :type == :refund (CONDITIONAL - required if masked information is not being submitted [see below])
|
323
|
-
# - :type == (:auth_only, :capture_only, :auth_capture) (REQUIRED)
|
324
|
-
#
|
325
|
-
# * <tt>:customer_payment_profile_id</tt> -- The Customer Payment Profile ID of the Customer Payment Profile to use in this transaction. (CONDITIONAL)
|
326
|
-
# - :type == (:void, :prior_auth_capture) (OPTIONAL)
|
327
|
-
# - :type == :refund (CONDITIONAL - required if masked information is not being submitted [see below])
|
328
|
-
# - :type == (:auth_only, :capture_only, :auth_capture) (REQUIRED)
|
329
|
-
#
|
330
|
-
# * <tt>:trans_id</tt> -- The payment gateway assigned transaction ID of the original transaction (CONDITIONAL):
|
331
|
-
# - :type = (:void, :refund, :prior_auth_capture) (REQUIRED)
|
332
|
-
# - :type = (:auth_only, :capture_only, :auth_capture) (NOT USED)
|
333
|
-
#
|
334
|
-
# * <tt>customer_shipping_address_id</tt> -- Payment gateway assigned ID associated with the customer shipping address (CONDITIONAL)
|
335
|
-
# - :type = (:void, :refund) (OPTIONAL)
|
336
|
-
# - :type = (:auth_only, :capture_only, :auth_capture) (NOT USED)
|
337
|
-
# - :type = (:prior_auth_capture) (OPTIONAL)
|
338
|
-
#
|
339
|
-
# ==== For :type == :refund only
|
340
|
-
# * <tt>:credit_card_number_masked</tt> -- (CONDITIONAL - requied for credit card refunds is :customer_profile_id AND :customer_payment_profile_id are missing)
|
341
|
-
# * <tt>:bank_routing_number_masked && :bank_account_number_masked</tt> -- (CONDITIONAL - requied for electronic check refunds is :customer_profile_id AND :customer_payment_profile_id are missing) (NOT ABLE TO TEST - I keep getting "ACH transactions are not accepted by this merchant." when trying to make a payment and, until that's possible I can't refund (wiseleyb@gmail.com))
|
342
|
-
def create_customer_profile_transaction(options)
|
343
|
-
requires!(options, :transaction)
|
344
|
-
requires!(options[:transaction], :type)
|
345
|
-
case options[:transaction][:type]
|
346
|
-
when :void
|
347
|
-
requires!(options[:transaction], :trans_id)
|
348
|
-
when :refund
|
349
|
-
requires!(options[:transaction], :trans_id) &&
|
350
|
-
(
|
351
|
-
(options[:transaction][:customer_profile_id] && options[:transaction][:customer_payment_profile_id]) ||
|
352
|
-
options[:transaction][:credit_card_number_masked] ||
|
353
|
-
(options[:transaction][:bank_routing_number_masked] && options[:transaction][:bank_account_number_masked])
|
354
|
-
)
|
355
|
-
when :prior_auth_capture
|
356
|
-
requires!(options[:transaction], :amount, :trans_id)
|
357
|
-
else
|
358
|
-
requires!(options[:transaction], :amount, :customer_profile_id, :customer_payment_profile_id)
|
359
|
-
end
|
360
|
-
request = build_request(:create_customer_profile_transaction, options)
|
361
|
-
commit(:create_customer_profile_transaction, request)
|
362
|
-
end
|
363
|
-
|
364
|
-
# Creates a new payment transaction for refund from an existing customer profile
|
365
|
-
#
|
366
|
-
# This is what is used to refund a transaction you have stored in a Customer Profile.
|
367
|
-
#
|
368
|
-
# Returns a Response object that contains the result of the transaction in <tt>params['direct_response']</tt>
|
369
|
-
#
|
370
|
-
# ==== Options
|
371
|
-
#
|
372
|
-
# * <tt>:transaction</tt> -- A hash containing information on the transaction that is being requested. (REQUIRED)
|
373
|
-
#
|
374
|
-
# ==== Transaction
|
375
|
-
#
|
376
|
-
# * <tt>:amount</tt> -- The total amount to be refunded (REQUIRED)
|
377
|
-
#
|
378
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer to use in this transaction. (CONDITIONAL :customer_payment_profile_id must be included if used)
|
379
|
-
# * <tt>:customer_payment_profile_id</tt> -- The Customer Payment Profile ID of the Customer Payment Profile to use in this transaction. (CONDITIONAL :customer_profile_id must be included if used)
|
380
|
-
#
|
381
|
-
# * <tt>:credit_card_number_masked</tt> -- Four Xs follwed by the last four digits of the credit card (CONDITIONAL - used if customer_profile_id and customer_payment_profile_id aren't given)
|
382
|
-
#
|
383
|
-
# * <tt>:bank_routing_number_masked</tt> -- The last four gidits of the routing number to be refunded (CONDITIONAL - must be used with :bank_account_number_masked)
|
384
|
-
# * <tt>:bank_account_number_masked</tt> -- The last four digis of the bank account number to be refunded, Ex. XXXX1234 (CONDITIONAL - must be used with :bank_routing_number_masked)
|
385
|
-
def create_customer_profile_transaction_for_refund(options)
|
386
|
-
requires!(options, :transaction)
|
387
|
-
options[:transaction][:type] = :refund
|
388
|
-
requires!(options[:transaction], :trans_id)
|
389
|
-
requires!(options[:transaction], :amount)
|
390
|
-
request = build_request(:create_customer_profile_transaction, options)
|
391
|
-
commit(:create_customer_profile_transaction, request)
|
392
|
-
end
|
393
|
-
|
394
|
-
# Creates a new payment transaction for void from an existing customer profile
|
395
|
-
#
|
396
|
-
# This is what is used to void a transaction you have stored in a Customer Profile.
|
397
|
-
#
|
398
|
-
# Returns a Response object that contains the result of the transaction in <tt>params['direct_response']</tt>
|
399
|
-
#
|
400
|
-
# ==== Options
|
401
|
-
#
|
402
|
-
# * <tt>:transaction</tt> -- A hash containing information on the transaction that is being requested. (REQUIRED)
|
403
|
-
#
|
404
|
-
# ==== Transaction
|
405
|
-
#
|
406
|
-
# * <tt>:trans_id</tt> -- The payment gateway assigned transaction id of the original transaction. (REQUIRED)
|
407
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer to use in this transaction.
|
408
|
-
# * <tt>:customer_payment_profile_id</tt> -- The Customer Payment Profile ID of the Customer Payment Profile to use in this transaction.
|
409
|
-
# * <tt>:customer_shipping_address_id</tt> -- Payment gateway assigned ID associated with the customer shipping address.
|
410
|
-
def create_customer_profile_transaction_for_void(options)
|
411
|
-
requires!(options, :transaction)
|
412
|
-
options[:transaction][:type] = :void
|
413
|
-
requires!(options[:transaction], :trans_id)
|
414
|
-
request = build_request(:create_customer_profile_transaction, options)
|
415
|
-
commit(:create_customer_profile_transaction, request)
|
416
|
-
end
|
417
|
-
|
418
|
-
# Verifies an existing customer payment profile by generating a test transaction
|
419
|
-
#
|
420
|
-
# Returns a Response object that contains the result of the transaction in <tt>params['direct_response']</tt>
|
421
|
-
#
|
422
|
-
# ==== Options
|
423
|
-
#
|
424
|
-
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of the customer to use in this transaction. (REQUIRED)
|
425
|
-
# * <tt>:customer_payment_profile_id</tt> -- The Customer Payment Profile ID of the Customer Payment Profile to be verified. (REQUIRED)
|
426
|
-
# * <tt>:customer_address_id</tt> -- The Customer Address ID of the Customer Shipping Address to be verified.
|
427
|
-
# * <tt>:validation_mode</tt> -- <tt>:live</tt> or <tt>:test</tt> In Test Mode, only field validation is performed.
|
428
|
-
# In Live Mode, a transaction is generated and submitted to the processor with the amount of $0.01. If successful, the transaction is immediately voided. (REQUIRED)
|
429
|
-
def validate_customer_payment_profile(options)
|
430
|
-
requires!(options, :customer_profile_id, :customer_payment_profile_id, :validation_mode)
|
431
|
-
|
432
|
-
request = build_request(:validate_customer_payment_profile, options)
|
433
|
-
commit(:validate_customer_payment_profile, request)
|
434
|
-
end
|
435
|
-
|
436
|
-
private
|
437
|
-
|
438
|
-
def expdate(credit_card)
|
439
|
-
sprintf('%04d-%02d', credit_card.year, credit_card.month)
|
440
|
-
end
|
441
|
-
|
442
|
-
def build_request(action, options = {})
|
443
|
-
unless CIM_ACTIONS.include?(action)
|
444
|
-
raise StandardError, "Invalid Customer Information Manager Action: #{action}"
|
445
|
-
end
|
446
|
-
|
447
|
-
xml = Builder::XmlMarkup.new(:indent => 2)
|
448
|
-
xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
|
449
|
-
xml.tag!("#{CIM_ACTIONS[action]}Request", :xmlns => AUTHORIZE_NET_CIM_NAMESPACE) do
|
450
|
-
add_merchant_authentication(xml)
|
451
|
-
# Merchant-assigned reference ID for the request
|
452
|
-
xml.tag!('refId', options[:ref_id]) if options[:ref_id]
|
453
|
-
send("build_#{action}_request", xml, options)
|
454
|
-
end
|
455
|
-
end
|
456
|
-
|
457
|
-
# Contains the merchant’s payment gateway account authentication information
|
458
|
-
def add_merchant_authentication(xml)
|
459
|
-
xml.tag!('merchantAuthentication') do
|
460
|
-
xml.tag!('name', @options[:login])
|
461
|
-
xml.tag!('transactionKey', @options[:password])
|
462
|
-
end
|
463
|
-
end
|
464
|
-
|
465
|
-
def build_create_customer_profile_request(xml, options)
|
466
|
-
add_profile(xml, options[:profile])
|
467
|
-
|
468
|
-
xml.tag!('validationMode',CIM_VALIDATION_MODES[options[:validation_mode]]) if options[:validation_mode]
|
469
|
-
|
470
|
-
xml.target!
|
471
|
-
end
|
472
|
-
|
473
|
-
def build_create_customer_payment_profile_request(xml, options)
|
474
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
475
|
-
|
476
|
-
xml.tag!('paymentProfile') do
|
477
|
-
add_payment_profile(xml, options[:payment_profile])
|
478
|
-
end
|
479
|
-
|
480
|
-
xml.tag!('validationMode', CIM_VALIDATION_MODES[options[:validation_mode]]) if options[:validation_mode]
|
481
|
-
|
482
|
-
xml.target!
|
483
|
-
end
|
484
|
-
|
485
|
-
def build_create_customer_shipping_address_request(xml, options)
|
486
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
487
|
-
|
488
|
-
xml.tag!('address') do
|
489
|
-
add_address(xml, options[:address])
|
490
|
-
end
|
491
|
-
|
492
|
-
xml.target!
|
493
|
-
end
|
494
|
-
|
495
|
-
def build_delete_customer_profile_request(xml, options)
|
496
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
497
|
-
xml.target!
|
498
|
-
end
|
499
|
-
|
500
|
-
def build_delete_customer_payment_profile_request(xml, options)
|
501
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
502
|
-
xml.tag!('customerPaymentProfileId', options[:customer_payment_profile_id])
|
503
|
-
xml.target!
|
504
|
-
end
|
505
|
-
|
506
|
-
def build_delete_customer_shipping_address_request(xml, options)
|
507
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
508
|
-
xml.tag!('customerAddressId', options[:customer_address_id])
|
509
|
-
xml.target!
|
510
|
-
end
|
511
|
-
|
512
|
-
def build_get_customer_profile_request(xml, options)
|
513
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
514
|
-
xml.target!
|
515
|
-
end
|
516
|
-
|
517
|
-
def build_get_customer_payment_profile_request(xml, options)
|
518
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
519
|
-
xml.tag!('customerPaymentProfileId', options[:customer_payment_profile_id])
|
520
|
-
xml.target!
|
521
|
-
end
|
522
|
-
|
523
|
-
def build_get_customer_shipping_address_request(xml, options)
|
524
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
525
|
-
xml.tag!('customerAddressId', options[:customer_address_id])
|
526
|
-
xml.target!
|
527
|
-
end
|
528
|
-
|
529
|
-
def build_update_customer_profile_request(xml, options)
|
530
|
-
add_profile(xml, options[:profile], true)
|
531
|
-
|
532
|
-
xml.target!
|
533
|
-
end
|
534
|
-
|
535
|
-
def build_update_customer_payment_profile_request(xml, options)
|
536
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
537
|
-
|
538
|
-
xml.tag!('paymentProfile') do
|
539
|
-
add_payment_profile(xml, options[:payment_profile])
|
540
|
-
end
|
541
|
-
|
542
|
-
xml.target!
|
543
|
-
end
|
544
|
-
|
545
|
-
def build_update_customer_shipping_address_request(xml, options)
|
546
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
547
|
-
|
548
|
-
xml.tag!('address') do
|
549
|
-
add_address(xml, options[:address])
|
550
|
-
end
|
551
|
-
|
552
|
-
xml.target!
|
553
|
-
end
|
554
|
-
|
555
|
-
def build_create_customer_profile_transaction_request(xml, options)
|
556
|
-
add_transaction(xml, options[:transaction])
|
557
|
-
xml.tag!('extraOptions', "x_test_request=TRUE") if @options[:test]
|
558
|
-
|
559
|
-
xml.target!
|
560
|
-
end
|
561
|
-
|
562
|
-
def build_validate_customer_payment_profile_request(xml, options)
|
563
|
-
xml.tag!('customerProfileId', options[:customer_profile_id])
|
564
|
-
xml.tag!('customerPaymentProfileId', options[:customer_payment_profile_id])
|
565
|
-
xml.tag!('customerShippingAddressId', options[:customer_address_id]) if options[:customer_address_id]
|
566
|
-
xml.tag!('validationMode', CIM_VALIDATION_MODES[options[:validation_mode]]) if options[:validation_mode]
|
567
|
-
|
568
|
-
xml.target!
|
569
|
-
end
|
570
|
-
|
571
|
-
# :merchant_customer_id (Optional)
|
572
|
-
# :description (Optional)
|
573
|
-
# :email (Optional)
|
574
|
-
# :payment_profiles (Optional)
|
575
|
-
def add_profile(xml, profile, update = false)
|
576
|
-
xml.tag!('profile') do
|
577
|
-
# Merchant assigned ID for the customer. Up to 20 characters. (optional)
|
578
|
-
xml.tag!('merchantCustomerId', profile[:merchant_customer_id]) if profile[:merchant_customer_id]
|
579
|
-
# Description of the customer. Up to 255 Characters (optional)
|
580
|
-
xml.tag!('description', profile[:description]) if profile[:description]
|
581
|
-
# Email Address for the customer. Up to 255 Characters (optional)
|
582
|
-
xml.tag!('email', profile[:email]) if profile[:email]
|
583
|
-
|
584
|
-
if update
|
585
|
-
xml.tag!('customerProfileId', profile[:customer_profile_id])
|
586
|
-
else
|
587
|
-
add_payment_profiles(xml, profile[:payment_profiles]) if profile[:payment_profiles]
|
588
|
-
add_ship_to_list(xml, profile[:ship_to_list]) if profile[:ship_to_list]
|
589
|
-
end
|
590
|
-
end
|
591
|
-
end
|
592
|
-
|
593
|
-
def add_transaction(xml, transaction)
|
594
|
-
unless CIM_TRANSACTION_TYPES.include?(transaction[:type])
|
595
|
-
raise StandardError, "Invalid Customer Information Manager Transaction Type: #{transaction[:type]}"
|
596
|
-
end
|
597
|
-
|
598
|
-
xml.tag!('transaction') do
|
599
|
-
xml.tag!(CIM_TRANSACTION_TYPES[transaction[:type]]) do
|
600
|
-
# The amount to be billed to the customer
|
601
|
-
case transaction[:type]
|
602
|
-
when :void
|
603
|
-
tag_unless_blank(xml,'customerProfileId', transaction[:customer_profile_id])
|
604
|
-
tag_unless_blank(xml,'customerPaymentProfileId', transaction[:customer_payment_profile_id])
|
605
|
-
tag_unless_blank(xml,'customerShippingAddressId', transaction[:customer_shipping_address_id])
|
606
|
-
xml.tag!('transId', transaction[:trans_id])
|
607
|
-
when :refund
|
608
|
-
#TODO - add support for all the other options fields
|
609
|
-
xml.tag!('amount', transaction[:amount])
|
610
|
-
tag_unless_blank(xml, 'customerProfileId', transaction[:customer_profile_id])
|
611
|
-
tag_unless_blank(xml, 'customerPaymentProfileId', transaction[:customer_payment_profile_id])
|
612
|
-
tag_unless_blank(xml, 'customerShippingAddressId', transaction[:customer_shipping_address_id])
|
613
|
-
tag_unless_blank(xml, 'creditCardNumberMasked', transaction[:credit_card_number_masked])
|
614
|
-
tag_unless_blank(xml, 'bankRoutingNumberMasked', transaction[:bank_routing_number_masked])
|
615
|
-
tag_unless_blank(xml, 'bankAccountNumberMasked', transaction[:bank_account_number_masked])
|
616
|
-
xml.tag!('transId', transaction[:trans_id])
|
617
|
-
when :prior_auth_capture
|
618
|
-
xml.tag!('amount', transaction[:amount])
|
619
|
-
xml.tag!('transId', transaction[:trans_id])
|
620
|
-
else
|
621
|
-
xml.tag!('amount', transaction[:amount])
|
622
|
-
xml.tag!('customerProfileId', transaction[:customer_profile_id])
|
623
|
-
xml.tag!('customerPaymentProfileId', transaction[:customer_payment_profile_id])
|
624
|
-
xml.tag!('approvalCode', transaction[:approval_code]) if transaction[:type] == :capture_only
|
625
|
-
end
|
626
|
-
add_order(xml, transaction[:order]) if transaction[:order]
|
627
|
-
end
|
628
|
-
end
|
629
|
-
end
|
630
|
-
|
631
|
-
def add_order(xml, order)
|
632
|
-
xml.tag!('order') do
|
633
|
-
xml.tag!('invoiceNumber', order[:invoice_number]) if order[:invoice_number]
|
634
|
-
xml.tag!('description', order[:description]) if order[:description]
|
635
|
-
xml.tag!('purchaseOrderNumber', order[:purchase_order_number]) if order[:purchase_order_number]
|
636
|
-
end
|
637
|
-
end
|
638
|
-
|
639
|
-
def add_payment_profiles(xml, payment_profiles)
|
640
|
-
xml.tag!('paymentProfiles') do
|
641
|
-
add_payment_profile(xml, payment_profiles)
|
642
|
-
end
|
643
|
-
end
|
644
|
-
|
645
|
-
# :customer_type => 'individual or business', # Optional
|
646
|
-
# :bill_to => @address,
|
647
|
-
# :payment => @payment
|
648
|
-
def add_payment_profile(xml, payment_profile)
|
649
|
-
# 'individual' or 'business' (optional)
|
650
|
-
xml.tag!('customerType', payment_profile[:customer_type]) if payment_profile[:customer_type]
|
651
|
-
|
652
|
-
if payment_profile[:bill_to]
|
653
|
-
xml.tag!('billTo') do
|
654
|
-
add_address(xml, payment_profile[:bill_to])
|
655
|
-
end
|
656
|
-
end
|
657
|
-
|
658
|
-
if payment_profile[:payment]
|
659
|
-
xml.tag!('payment') do
|
660
|
-
add_credit_card(xml, payment_profile[:payment][:credit_card]) if payment_profile[:payment].has_key?(:credit_card)
|
661
|
-
add_bank_account(xml, payment_profile[:payment][:bank_account]) if payment_profile[:payment].has_key?(:bank_account)
|
662
|
-
add_drivers_license(xml, payment_profile[:payment][:drivers_license]) if payment_profile[:payment].has_key?(:drivers_license)
|
663
|
-
# This element is only required for Wells Fargo SecureSource eCheck.Net merchants
|
664
|
-
# The customer's Social Security Number or Tax ID
|
665
|
-
xml.tag!('taxId', payment_profile[:payment]) if payment_profile[:payment].has_key?(:tax_id)
|
666
|
-
end
|
667
|
-
end
|
668
|
-
|
669
|
-
xml.tag!('customerPaymentProfileId', payment_profile[:customer_payment_profile_id]) if payment_profile[:customer_payment_profile_id]
|
670
|
-
end
|
671
|
-
|
672
|
-
def add_ship_to_list(xml, ship_to_list)
|
673
|
-
xml.tag!('shipToList') do
|
674
|
-
add_address(xml, ship_to_list)
|
675
|
-
end
|
676
|
-
end
|
677
|
-
|
678
|
-
def add_address(xml, address)
|
679
|
-
xml.tag!('firstName', address[:first_name])
|
680
|
-
xml.tag!('lastName', address[:last_name])
|
681
|
-
xml.tag!('company', address[:company])
|
682
|
-
xml.tag!('address', address[:address1]) if address[:address1]
|
683
|
-
xml.tag!('address', address[:address]) if address[:address]
|
684
|
-
xml.tag!('city', address[:city])
|
685
|
-
xml.tag!('state', address[:state])
|
686
|
-
xml.tag!('zip', address[:zip])
|
687
|
-
xml.tag!('country', address[:country])
|
688
|
-
xml.tag!('phoneNumber', address[:phone_number]) if address[:phone_number]
|
689
|
-
xml.tag!('faxNumber', address[:fax_number]) if address[:fax_number]
|
690
|
-
|
691
|
-
xml.tag!('customerAddressId', address[:customer_address_id]) if address[:customer_address_id]
|
692
|
-
end
|
693
|
-
|
694
|
-
# Adds customer’s credit card information
|
695
|
-
# Note: This element should only be included
|
696
|
-
# when the payment method is credit card.
|
697
|
-
def add_credit_card(xml, credit_card)
|
698
|
-
return unless credit_card
|
699
|
-
xml.tag!('creditCard') do
|
700
|
-
# The credit card number used for payment of the subscription
|
701
|
-
xml.tag!('cardNumber', credit_card.number)
|
702
|
-
# The expiration date of the credit card used for the subscription
|
703
|
-
xml.tag!('expirationDate', expdate(credit_card))
|
704
|
-
xml.tag!('cardCode', credit_card.verification_value) if credit_card.verification_value?
|
705
|
-
end
|
706
|
-
end
|
707
|
-
|
708
|
-
# Adds customer’s bank account information
|
709
|
-
# Note: This element should only be included
|
710
|
-
# when the payment method is bank account.
|
711
|
-
def add_bank_account(xml, bank_account)
|
712
|
-
raise StandardError, "Invalid Bank Account Type: #{bank_account[:account_type]}" unless BANK_ACCOUNT_TYPES.include?(bank_account[:account_type])
|
713
|
-
raise StandardError, "Invalid eCheck Type: #{bank_account[:echeck_type]}" unless ECHECK_TYPES.include?(bank_account[:echeck_type])
|
714
|
-
|
715
|
-
xml.tag!('bankAccount') do
|
716
|
-
# The type of bank account
|
717
|
-
xml.tag!('accountType', BANK_ACCOUNT_TYPES[bank_account[:account_type]])
|
718
|
-
# The routing number of the customer’s bank
|
719
|
-
xml.tag!('routingNumber', bank_account[:routing_number])
|
720
|
-
# The bank account number
|
721
|
-
xml.tag!('accountNumber', bank_account[:account_number])
|
722
|
-
# The full name of the individual associated
|
723
|
-
# with the bank account number
|
724
|
-
xml.tag!('nameOnAccount', bank_account[:name_on_account])
|
725
|
-
# The type of electronic check transaction
|
726
|
-
xml.tag!('echeckType', ECHECK_TYPES[bank_account[:echeck_type]])
|
727
|
-
# The full name of the individual associated
|
728
|
-
# with the bank account number (optional)
|
729
|
-
xml.tag!('bankName', bank_account[:bank_name]) if bank_account[:bank_name]
|
730
|
-
end
|
731
|
-
end
|
732
|
-
|
733
|
-
# Adds customer’s driver's license information
|
734
|
-
# Note: This element is only required for
|
735
|
-
# Wells Fargo SecureSource eCheck.Net merchants
|
736
|
-
def add_drivers_license(xml, drivers_license)
|
737
|
-
xml.tag!('driversLicense') do
|
738
|
-
# The state of the customer's driver's license
|
739
|
-
# A valid two character state code
|
740
|
-
xml.tag!('state', drivers_license[:state])
|
741
|
-
# The customer’s driver's license number
|
742
|
-
xml.tag!('number', drivers_license[:number])
|
743
|
-
# The date of birth listed on the customer's driver's license
|
744
|
-
# YYYY-MM-DD
|
745
|
-
xml.tag!('dateOfBirth', drivers_license[:date_of_birth])
|
746
|
-
end
|
747
|
-
end
|
748
|
-
|
749
|
-
def commit(action, request)
|
750
|
-
url = test? ? test_url : live_url
|
751
|
-
xml = ssl_post(url, request, "Content-Type" => "text/xml")
|
752
|
-
response_params = parse(action, xml)
|
753
|
-
message = response_params['messages']['message']
|
754
|
-
|
755
|
-
if message.class.is_a? Array
|
756
|
-
text = "#{message[0]['code']} - #{message[0]['text']}"
|
757
|
-
else
|
758
|
-
text = "#{message['code']} - #{message['text']}"
|
759
|
-
end
|
760
|
-
test_mode = test? || text =~ /Test Mode/
|
761
|
-
success = response_params['messages']['result_code'] == 'Ok'
|
762
|
-
|
763
|
-
Rails.logger.error("Gateway Error: #{text}") unless success
|
764
|
-
|
765
|
-
direct_response_params = parse_direct_response(response_params['direct_response'])
|
766
|
-
|
767
|
-
response = Response.new(success, text, response_params,
|
768
|
-
:test => test_mode,
|
769
|
-
:authorization => response_params['customer_profile_id'] || (response_params['profile'] ? response_params['profile']['customer_profile_id'] : direct_response_params['transaction_id']),
|
770
|
-
:avs_result => {:code => direct_response_params['avs_response']}
|
771
|
-
)
|
772
|
-
response.params['direct_response'] = direct_response_params
|
773
|
-
|
774
|
-
# transaction_id from direct response should be used for the authorization option on response
|
775
|
-
if response.authorization.nil? and response.params['direct_response']
|
776
|
-
if !response.params['direct_response']['transaction_id'].blank? and response.params['direct_response']['transaction_id'] != '0'
|
777
|
-
response.authorization = response.params['direct_response']['transaction_id']
|
778
|
-
end
|
779
|
-
end
|
780
|
-
|
781
|
-
response
|
782
|
-
end
|
783
|
-
|
784
|
-
def tag_unless_blank(xml, tag_name, data)
|
785
|
-
xml.tag!(tag_name, data) unless data.blank? || data.nil?
|
786
|
-
end
|
787
|
-
|
788
|
-
def parse_direct_response(raw)
|
789
|
-
return {} if raw.blank?
|
790
|
-
direct_response_fields = raw.split(',')
|
791
|
-
{
|
792
|
-
'raw' => raw,
|
793
|
-
'response_code' => direct_response_fields[0],
|
794
|
-
'response_subcode' => direct_response_fields[1],
|
795
|
-
'response_reason_code' => direct_response_fields[2],
|
796
|
-
'message' => direct_response_fields[3],
|
797
|
-
'approval_code' => direct_response_fields[4],
|
798
|
-
'avs_response' => direct_response_fields[5],
|
799
|
-
'transaction_id' => direct_response_fields[6],
|
800
|
-
'invoice_number' => direct_response_fields[7],
|
801
|
-
'order_description' => direct_response_fields[8],
|
802
|
-
'amount' => direct_response_fields[9],
|
803
|
-
'method' => direct_response_fields[10],
|
804
|
-
'transaction_type' => direct_response_fields[11],
|
805
|
-
'customer_id' => direct_response_fields[12],
|
806
|
-
'first_name' => direct_response_fields[13],
|
807
|
-
'last_name' => direct_response_fields[14],
|
808
|
-
'company' => direct_response_fields[15],
|
809
|
-
'address' => direct_response_fields[16],
|
810
|
-
'city' => direct_response_fields[17],
|
811
|
-
'state' => direct_response_fields[18],
|
812
|
-
'zip_code' => direct_response_fields[19],
|
813
|
-
'country' => direct_response_fields[20],
|
814
|
-
'phone' => direct_response_fields[21],
|
815
|
-
'fax' => direct_response_fields[22],
|
816
|
-
'email_address' => direct_response_fields[23],
|
817
|
-
'ship_to_first_name' => direct_response_fields[24],
|
818
|
-
'ship_to_last_name' => direct_response_fields[25],
|
819
|
-
'ship_to_company' => direct_response_fields[26],
|
820
|
-
'ship_to_address' => direct_response_fields[27],
|
821
|
-
'ship_to_city' => direct_response_fields[28],
|
822
|
-
'ship_to_state' => direct_response_fields[29],
|
823
|
-
'ship_to_zip_code' => direct_response_fields[30],
|
824
|
-
'ship_to_country' => direct_response_fields[31],
|
825
|
-
'tax' => direct_response_fields[32],
|
826
|
-
'duty' => direct_response_fields[33],
|
827
|
-
'freight' => direct_response_fields[34],
|
828
|
-
'tax_exempt' => direct_response_fields[35],
|
829
|
-
'purchase_order_number' => direct_response_fields[36],
|
830
|
-
'md5_hash' => direct_response_fields[37],
|
831
|
-
'card_code' => direct_response_fields[38],
|
832
|
-
'cardholder_authentication_verification_response' => direct_response_fields[39]
|
833
|
-
}
|
834
|
-
end
|
835
|
-
|
836
|
-
def parse(action, xml)
|
837
|
-
xml = REXML::Document.new(xml)
|
838
|
-
root = REXML::XPath.first(xml, "//#{CIM_ACTIONS[action]}Response") ||
|
839
|
-
REXML::XPath.first(xml, "//ErrorResponse")
|
840
|
-
if root
|
841
|
-
response = parse_element(root)
|
842
|
-
end
|
843
|
-
|
844
|
-
response
|
845
|
-
end
|
846
|
-
|
847
|
-
def parse_element(node)
|
848
|
-
if node.has_elements?
|
849
|
-
response = {}
|
850
|
-
node.elements.each{ |e|
|
851
|
-
key = e.name.underscore
|
852
|
-
value = parse_element(e)
|
853
|
-
if response.has_key?(key)
|
854
|
-
if response[key].is_a?(Array)
|
855
|
-
response[key].push(value)
|
856
|
-
else
|
857
|
-
response[key] = [response[key], value]
|
858
|
-
end
|
859
|
-
else
|
860
|
-
response[key] = parse_element(e)
|
861
|
-
end
|
862
|
-
}
|
863
|
-
else
|
864
|
-
response = node.text
|
865
|
-
end
|
866
|
-
|
867
|
-
response
|
868
|
-
end
|
869
|
-
end
|
870
|
-
end
|
871
|
-
end
|