wordjelly-auth 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +35 -0
- data/app/assets/images/auth/activity.jpg +0 -0
- data/app/assets/images/auth/facebook.svg +1 -0
- data/app/assets/images/auth/google_oauth2.svg +1 -0
- data/app/assets/images/auth/js_pic3.jpg +0 -0
- data/app/assets/images/auth/profile.jpg +0 -0
- data/app/assets/javascripts/auth/admin_create_users.js +2 -0
- data/app/assets/javascripts/auth/application.js +20 -0
- data/app/assets/javascripts/auth/auth_dependencies.js +12 -0
- data/app/assets/javascripts/auth/auth_modals_and_navbar.js +218 -0
- data/app/assets/javascripts/auth/clients.js +2 -0
- data/app/assets/javascripts/auth/search.js +2 -0
- data/app/assets/javascripts/auth/shopping/discounts.js +2 -0
- data/app/assets/javascripts/auth/users/profiles.js +188 -0
- data/app/assets/stylesheets/auth/admin_create_users.css +4 -0
- data/app/assets/stylesheets/auth/application.scss +14 -0
- data/app/assets/stylesheets/auth/auth_default_css.scss +13 -0
- data/app/assets/stylesheets/auth/common-styles.scss +579 -0
- data/app/assets/stylesheets/auth/overrides.scss +26 -0
- data/app/assets/stylesheets/auth/search.css +4 -0
- data/app/assets/stylesheets/auth/shopping/discounts.css +4 -0
- data/app/assets/stylesheets/auth/users/profiles.scss +40 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/controllers/auth/admin_create_users_controller.rb +89 -0
- data/app/controllers/auth/application_controller.rb +97 -0
- data/app/controllers/auth/clients_controller.rb +105 -0
- data/app/controllers/auth/concerns/activity_controller_concern.rb +32 -0
- data/app/controllers/auth/concerns/devise_concern.rb +193 -0
- data/app/controllers/auth/concerns/omni_concern.rb +310 -0
- data/app/controllers/auth/concerns/otp_concern.rb +251 -0
- data/app/controllers/auth/concerns/shopping/cart_controller_concern.rb +105 -0
- data/app/controllers/auth/concerns/shopping/cart_item_controller_concern.rb +150 -0
- data/app/controllers/auth/concerns/shopping/discount_controller_concern.rb +97 -0
- data/app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb +38 -0
- data/app/controllers/auth/concerns/shopping/payment_controller_concern.rb +101 -0
- data/app/controllers/auth/concerns/shopping/product_controller_concern.rb +68 -0
- data/app/controllers/auth/concerns/token_concern.rb +187 -0
- data/app/controllers/auth/confirmations_controller.rb +3 -0
- data/app/controllers/auth/mailgun_controller.rb +8 -0
- data/app/controllers/auth/omniauth_callbacks_controller.rb +6 -0
- data/app/controllers/auth/passwords_controller.rb +4 -0
- data/app/controllers/auth/profiles_controller.rb +156 -0
- data/app/controllers/auth/registrations_controller.rb +99 -0
- data/app/controllers/auth/search_controller.rb +61 -0
- data/app/controllers/auth/sessions_controller.rb +20 -0
- data/app/controllers/auth/shopping/cart_items_controller.rb +14 -0
- data/app/controllers/auth/shopping/carts_controller.rb +13 -0
- data/app/controllers/auth/shopping/discounts_controller.rb +19 -0
- data/app/controllers/auth/shopping/payments_controller.rb +13 -0
- data/app/controllers/auth/shopping/products_controller.rb +17 -0
- data/app/controllers/auth/shopping/shopping_controller.rb +86 -0
- data/app/controllers/auth/unlocks_controller.rb +3 -0
- data/app/controllers/auth/webhooks_controller.rb +3 -0
- data/app/helpers/auth/admin_create_users_helper.rb +2 -0
- data/app/helpers/auth/application_helper.rb +136 -0
- data/app/helpers/auth/clients_helper.rb +4 -0
- data/app/helpers/auth/resource_helper.rb +10 -0
- data/app/helpers/auth/search_helper.rb +2 -0
- data/app/helpers/auth/shopping/cart_items/cart_items_helper.rb +29 -0
- data/app/helpers/auth/shopping/carts/carts_helper.rb +25 -0
- data/app/helpers/auth/shopping/discounts/discounts_helper.rb +39 -0
- data/app/helpers/auth/shopping/payments/pay_u_money_helper.rb +56 -0
- data/app/helpers/auth/shopping/payments/payments_helper.rb +54 -0
- data/app/helpers/auth/shopping/products/products_helper.rb +52 -0
- data/app/helpers/auth/shopping/shopping_helper.rb +3 -0
- data/app/helpers/auth/users/profiles_helper.rb +12 -0
- data/app/jobs/otp_job.rb +92 -0
- data/app/mailers/application_mailer.rb +4 -0
- data/app/mailers/auth/notifier.rb +9 -0
- data/app/models/auth/admin_create_user.rb +3 -0
- data/app/models/auth/client.rb +52 -0
- data/app/models/auth/concerns/activity_concern.rb +112 -0
- data/app/models/auth/concerns/chief_model_concern.rb +73 -0
- data/app/models/auth/concerns/es_concern.rb +21 -0
- data/app/models/auth/concerns/notification_concern.rb +232 -0
- data/app/models/auth/concerns/notification_response_concern.rb +71 -0
- data/app/models/auth/concerns/owner_concern.rb +81 -0
- data/app/models/auth/concerns/shopping/cart_concern.rb +329 -0
- data/app/models/auth/concerns/shopping/cart_item_concern.rb +437 -0
- data/app/models/auth/concerns/shopping/discount_concern.rb +482 -0
- data/app/models/auth/concerns/shopping/discount_flow.txt +11 -0
- data/app/models/auth/concerns/shopping/pay_u_money_concern.rb +184 -0
- data/app/models/auth/concerns/shopping/payment_concern.rb +613 -0
- data/app/models/auth/concerns/shopping/product_concern.rb +102 -0
- data/app/models/auth/concerns/sms_otp_concern.rb +68 -0
- data/app/models/auth/concerns/user_concern.rb +788 -0
- data/app/models/auth/identity.rb +23 -0
- data/app/models/auth/shopping/cart.rb +3 -0
- data/app/models/auth/shopping/cart_item.rb +6 -0
- data/app/models/auth/shopping/cart_item_payment_result.rb +7 -0
- data/app/models/auth/shopping/discount.rb +4 -0
- data/app/models/auth/shopping/payment.rb +5 -0
- data/app/models/auth/shopping/product.rb +5 -0
- data/app/models/auth/user.rb +3 -0
- data/app/views/auth/admin_create_users/_admin_actions.html.erb +46 -0
- data/app/views/auth/admin_create_users/_form.html.erb +19 -0
- data/app/views/auth/admin_create_users/edit.html.erb +6 -0
- data/app/views/auth/admin_create_users/index.html.erb +25 -0
- data/app/views/auth/admin_create_users/new.html.erb +5 -0
- data/app/views/auth/admin_create_users/show.html.erb +8 -0
- data/app/views/auth/clients/_form.html.erb +41 -0
- data/app/views/auth/clients/edit.html.erb +6 -0
- data/app/views/auth/clients/index.html.erb +33 -0
- data/app/views/auth/clients/new.html.erb +5 -0
- data/app/views/auth/clients/show.html.erb +21 -0
- data/app/views/auth/confirmations/_enter_otp.html.erb +27 -0
- data/app/views/auth/confirmations/_get_otp_status.html.erb +25 -0
- data/app/views/auth/confirmations/_new_otp_input.js.erb +11 -0
- data/app/views/auth/confirmations/_resend_otp.js.erb +8 -0
- data/app/views/auth/confirmations/_resend_sms_otp.html.erb +18 -0
- data/app/views/auth/confirmations/_verify_otp.js.erb +64 -0
- data/app/views/auth/confirmations/create.js.erb +8 -0
- data/app/views/auth/confirmations/enter_otp.html.erb +7 -0
- data/app/views/auth/confirmations/get_otp_status.html.erb +3 -0
- data/app/views/auth/confirmations/new.html.erb +1 -0
- data/app/views/auth/confirmations/new.js.erb +16 -0
- data/app/views/auth/confirmations/otp_status_result.html.erb +20 -0
- data/app/views/auth/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/auth/mailer/password_change.html.erb +3 -0
- data/app/views/auth/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/auth/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/auth/modals/_ajax_error_modal.html.erb +3 -0
- data/app/views/auth/modals/_ajax_error_modal_content.html.erb +0 -0
- data/app/views/auth/modals/_edit_account_content.html.erb +68 -0
- data/app/views/auth/modals/_edit_account_success_content.html.erb +5 -0
- data/app/views/auth/modals/_error_notification.html.erb +8 -0
- data/app/views/auth/modals/_forgot_password_content.html.erb +18 -0
- data/app/views/auth/modals/_forgot_password_success_content.html.erb +8 -0
- data/app/views/auth/modals/_login_default_content.html.erb +3 -0
- data/app/views/auth/modals/_login_forms.html.erb +13 -0
- data/app/views/auth/modals/_login_navigation_options.html.erb +12 -0
- data/app/views/auth/modals/_new_otp_input.html.erb +28 -0
- data/app/views/auth/modals/_oauth_and_submit.html.erb +21 -0
- data/app/views/auth/modals/_recaptcha_tags.html.erb +4 -0
- data/app/views/auth/modals/_resend_confirmation_content.html.erb +17 -0
- data/app/views/auth/modals/_resend_confirmation_success_content.html.erb +8 -0
- data/app/views/auth/modals/_resend_otp.html.erb +23 -0
- data/app/views/auth/modals/_resource_errors.js.erb +24 -0
- data/app/views/auth/modals/_sign_in_inputs.html.erb +10 -0
- data/app/views/auth/modals/_sign_in_needed_modal.html.erb +3 -0
- data/app/views/auth/modals/_sign_in_success_content.html.erb +5 -0
- data/app/views/auth/modals/_sign_up_inputs.html.erb +9 -0
- data/app/views/auth/modals/_sign_up_success_content.html.erb +1 -0
- data/app/views/auth/modals/_sign_up_success_inactive_content.html.erb +2 -0
- data/app/views/auth/modals/_unlock_content.html.erb +17 -0
- data/app/views/auth/modals/_verify_otp.html.erb +1 -0
- data/app/views/auth/modals/base_modal/_base.html.erb +25 -0
- data/app/views/auth/modals/login.js.erb +120 -0
- data/app/views/auth/modals/unlock_success_content.html.erb +8 -0
- data/app/views/auth/notifier/_email.html.erb +3 -0
- data/app/views/auth/notifier/notification.html.erb +2 -0
- data/app/views/auth/notifier/notification.text.erb +1 -0
- data/app/views/auth/omniauth_callbacks/failure.html.erb +4 -0
- data/app/views/auth/passwords/create.js.erb +12 -0
- data/app/views/auth/passwords/edit.html.erb +25 -0
- data/app/views/auth/passwords/new.html.erb +16 -0
- data/app/views/auth/passwords/new.js.erb +19 -0
- data/app/views/auth/profiles/_proxy_resource.html.erb +5 -0
- data/app/views/auth/profiles/set_proxy_resource.js.erb +1 -0
- data/app/views/auth/profiles/show.html.erb +8 -0
- data/app/views/auth/registrations/create.js.erb +40 -0
- data/app/views/auth/registrations/edit.html.erb +2 -0
- data/app/views/auth/registrations/edit.js.erb +5 -0
- data/app/views/auth/registrations/new.html.erb +33 -0
- data/app/views/auth/registrations/update.js.erb +47 -0
- data/app/views/auth/search/_search_bar.html.erb +11 -0
- data/app/views/auth/search/_search_result.html.erb +7 -0
- data/app/views/auth/search/_search_results.html.erb +4 -0
- data/app/views/auth/search/authenticated_user_search.js.erb +45 -0
- data/app/views/auth/search/authenticated_user_search.json +7 -0
- data/app/views/auth/sessions/create.js.erb +5 -0
- data/app/views/auth/sessions/new.html.erb +4 -0
- data/app/views/auth/sessions/new.js.erb +20 -0
- data/app/views/auth/shared/_devise_error_messages.html.erb +9 -0
- data/app/views/auth/shared/_links.html.erb +25 -0
- data/app/views/auth/shared/_object_errors.html.erb +12 -0
- data/app/views/auth/shared/_proxy_resource.html.erb +18 -0
- data/app/views/auth/shopping/cart_items/_form.html.erb +34 -0
- data/app/views/auth/shopping/cart_items/_show_cart_items_collection.html.erb +31 -0
- data/app/views/auth/shopping/cart_items/create_multiple.html.erb +6 -0
- data/app/views/auth/shopping/cart_items/create_multiple.json.erb +9 -0
- data/app/views/auth/shopping/cart_items/edit.html.erb +6 -0
- data/app/views/auth/shopping/cart_items/index.html.erb +52 -0
- data/app/views/auth/shopping/cart_items/new.html.erb +5 -0
- data/app/views/auth/shopping/cart_items/show.html.erb +13 -0
- data/app/views/auth/shopping/carts/_form.html.erb +35 -0
- data/app/views/auth/shopping/carts/_payment_links.html.erb +27 -0
- data/app/views/auth/shopping/carts/_remove_cart_item.html.erb +11 -0
- data/app/views/auth/shopping/carts/_show_cart_balance_info.html.erb +35 -0
- data/app/views/auth/shopping/carts/edit.html.erb +6 -0
- data/app/views/auth/shopping/carts/index.html.erb +43 -0
- data/app/views/auth/shopping/carts/new.html.erb +5 -0
- data/app/views/auth/shopping/carts/show.html.erb +46 -0
- data/app/views/auth/shopping/discounts/_form.html.erb +18 -0
- data/app/views/auth/shopping/discounts/_form_for_create_multiple_cart_items.html.erb +17 -0
- data/app/views/auth/shopping/discounts/_show_pending_discount_request.html.erb +17 -0
- data/app/views/auth/shopping/discounts/destroy.html.erb +2 -0
- data/app/views/auth/shopping/discounts/edit.html.erb +29 -0
- data/app/views/auth/shopping/discounts/index.html.erb +40 -0
- data/app/views/auth/shopping/discounts/new.html.erb +1 -0
- data/app/views/auth/shopping/discounts/show.html.erb +18 -0
- data/app/views/auth/shopping/discounts/update.html.erb +2 -0
- data/app/views/auth/shopping/payments/_approve_payment.html.erb +7 -0
- data/app/views/auth/shopping/payments/_cash_card_cheque.html.erb +24 -0
- data/app/views/auth/shopping/payments/_create_discount_coupon.html.erb +5 -0
- data/app/views/auth/shopping/payments/_form.html.erb +19 -0
- data/app/views/auth/shopping/payments/_gateway.html.erb +21 -0
- data/app/views/auth/shopping/payments/_proceed_to_gateway_or_verify_payment.html.erb +18 -0
- data/app/views/auth/shopping/payments/_refresh_payment.html.erb +7 -0
- data/app/views/auth/shopping/payments/_refund.html.erb +10 -0
- data/app/views/auth/shopping/payments/_show_payment_receipt.html.erb +12 -0
- data/app/views/auth/shopping/payments/edit.html.erb +6 -0
- data/app/views/auth/shopping/payments/index.html.erb +43 -0
- data/app/views/auth/shopping/payments/new.html.erb +13 -0
- data/app/views/auth/shopping/payments/show.html.erb +36 -0
- data/app/views/auth/shopping/products/_form.html.erb +27 -0
- data/app/views/auth/shopping/products/edit.html.erb +6 -0
- data/app/views/auth/shopping/products/index.html.erb +48 -0
- data/app/views/auth/shopping/products/index.json.erb +7 -0
- data/app/views/auth/shopping/products/new.html.erb +5 -0
- data/app/views/auth/shopping/products/show.html.erb +12 -0
- data/app/views/auth/shopping/products/show.json.erb +1 -0
- data/app/views/auth/unlocks/create.js.erb +12 -0
- data/app/views/auth/unlocks/new.html.erb +14 -0
- data/app/views/auth/unlocks/new.js.erb +17 -0
- data/app/views/auth/users/_search_result.html.erb +8 -0
- data/app/views/auth/users/profiles/_user_data.html.erb +4 -0
- data/app/views/auth/users/profiles/show.html.erb +54 -0
- data/app/views/layouts/auth/_modals.html.erb +2 -0
- data/app/views/layouts/auth/application.html.erb +17 -0
- data/app/views/layouts/auth/navbar/_navbar.html.erb +49 -0
- data/app/views/layouts/auth/navbar/_personalization.html.erb +17 -0
- data/app/views/layouts/auth/navbar/_progress_spinner.html.erb +11 -0
- data/app/views/layouts/mailer.html.erb +5 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/config/initializers/active_model.rb +36 -0
- data/config/initializers/devise.rb +623 -0
- data/config/initializers/json.rb +10 -0
- data/config/initializers/omniauth.rb +447 -0
- data/config/initializers/redis.rb +2 -0
- data/config/initializers/redis.yml +14 -0
- data/config/locales/devise.en.yml +63 -0
- data/config/routes.rb +1 -0
- data/lib/assets/javascripts/data.js +126 -0
- data/lib/assets/javascripts/jquery.calendario.js +394 -0
- data/lib/assets/javascripts/jquery.tagcloud.js +92 -0
- data/lib/assets/javascripts/leanModal.js +236 -0
- data/lib/assets/javascripts/main.js +668 -0
- data/lib/assets/javascripts/modernizr.custom.63321.js +4 -0
- data/lib/assets/javascripts/payumoney.js +9 -0
- data/lib/assets/javascripts/search.js +36 -0
- data/lib/assets/javascripts/spinner.js +77 -0
- data/lib/assets/javascripts/trianglify.min.js +2 -0
- data/lib/assets/javascripts/you_need_to_sign_in.js.erb +478 -0
- data/lib/assets/stylesheets/calendar.css +111 -0
- data/lib/assets/stylesheets/calendar_modifications.scss +276 -0
- data/lib/auth.rb +32 -0
- data/lib/auth/custom_failure.rb +3 -0
- data/lib/auth/engine.rb +231 -0
- data/lib/auth/job_exception_handler.rb +7 -0
- data/lib/auth/mailgun.rb +28 -0
- data/lib/auth/notify.rb +8 -0
- data/lib/auth/omniauth/path.rb +104 -0
- data/lib/auth/partials.rb +12 -0
- data/lib/auth/rails/routes.rb +169 -0
- data/lib/auth/search/main.rb +97 -0
- data/lib/auth/sidekiq_up.rb +16 -0
- data/lib/auth/two_factor_otp.rb +202 -0
- data/lib/auth/url_shortener.rb +29 -0
- data/lib/auth/version.rb +3 -0
- data/lib/tasks/auth_tasks.rake +4 -0
- metadata +863 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Listing Auth Shopping Carts</h1>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<!-- id number, this will also hold links to edit and destroy. -->
|
9
|
+
<th>Number</th>
|
10
|
+
<th>Id Number</th>
|
11
|
+
<!-- get the names of the other fields to be shown-->
|
12
|
+
<% @auth_shopping_carts.first.attributes_to_show.each do |attr| %>
|
13
|
+
<th><%= attr %></th>
|
14
|
+
<% end %>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
|
18
|
+
<tbody>
|
19
|
+
<% @auth_shopping_carts.each_with_index {|auth_shopping_cart,key| %>
|
20
|
+
<tr>
|
21
|
+
<td><%= key + 1 %></td>
|
22
|
+
<td>
|
23
|
+
<div>
|
24
|
+
<%= link_to auth_shopping_cart.id.to_s, cart_path(auth_shopping_cart) %>
|
25
|
+
</div>
|
26
|
+
<div>
|
27
|
+
<!-- add destory and edit options here -->
|
28
|
+
<!-- end -->
|
29
|
+
<span><%= link_to 'Edit', edit_cart_path(auth_shopping_cart) %></span>
|
30
|
+
<span><%= link_to 'Destroy', cart_path(auth_shopping_cart), method: :delete, data: { confirm: 'Are you sure?' } %></span>
|
31
|
+
</div>
|
32
|
+
</td>
|
33
|
+
<% @auth_shopping_carts.first.attributes_to_show.each do |attr| %>
|
34
|
+
<td><%= auth_shopping_cart.send("#{attr}") %></td>
|
35
|
+
<% end %>
|
36
|
+
</tr>
|
37
|
+
<% } %>
|
38
|
+
</tbody>
|
39
|
+
</table>
|
40
|
+
|
41
|
+
<br>
|
42
|
+
|
43
|
+
<%= link_to 'New Cart', new_cart_path %>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<div class="fields">
|
4
|
+
|
5
|
+
<% @auth_shopping_cart.attributes_to_show.each do |attr| %>
|
6
|
+
|
7
|
+
|
8
|
+
<div><%= @auth_shopping_cart.send("#{attr}") %></div>
|
9
|
+
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<h3>Items In Your Cart</h3>
|
13
|
+
|
14
|
+
<%= render :partial => "auth/shopping/cart_items/show_cart_items_collection", locals: {cart_items: @auth_shopping_cart.cart_items, cart: @auth_shopping_cart} %>
|
15
|
+
|
16
|
+
<%= render :partial => "auth/shopping/carts/show_cart_balance_info", locals: {cart: @auth_shopping_cart} %>
|
17
|
+
|
18
|
+
|
19
|
+
<h3>Payments & Refunds</h3>
|
20
|
+
<table>
|
21
|
+
<thead>
|
22
|
+
<th>Payment Id</th>
|
23
|
+
<th>Status</th>
|
24
|
+
<th>Amount</th>
|
25
|
+
<th>Payment Type</th>
|
26
|
+
</thead>
|
27
|
+
<tbody>
|
28
|
+
<% @auth_shopping_cart.cart_payments.each_with_index {|cpayment,key| %>
|
29
|
+
<tr>
|
30
|
+
<td><%= link_to cpayment.id.to_s, payment_path(cpayment) %></td>
|
31
|
+
<td><%= payment_status_to_string(cpayment)%></td>
|
32
|
+
<td><%= cpayment.amount %></td>
|
33
|
+
<td><%= cpayment.payment_type %></td>
|
34
|
+
</tr>
|
35
|
+
<% } %>
|
36
|
+
</tbody>
|
37
|
+
</table>
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
<%= link_to 'Edit', edit_cart_path(@auth_shopping_cart) %> |
|
46
|
+
<%= link_to 'Back', carts_path %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%= form_for(@auth_shopping_discount, url: @auth_shopping_discount.new_record? ? discounts_path : discount_path(@auth_shopping_discount), method: @auth_shopping_discount.new_record? ? :post : :put, as: :discount) do |f| %>
|
2
|
+
<%= render :partial => "auth/shared/object_errors.html.erb", locals: {active_model_object: @auth_shopping_discount} %>
|
3
|
+
|
4
|
+
<div class="form_fields">
|
5
|
+
|
6
|
+
<%= f.text_field :discount_amount %>
|
7
|
+
<%= f.label :discount_amount %>
|
8
|
+
|
9
|
+
<%= f.hidden_field :cart_id, :value => @auth_shopping_discount.cart_id %>
|
10
|
+
|
11
|
+
<!-- add a selection to decide whether this discount option needs a verification or not -->
|
12
|
+
<%= f.select(:requires_verification, [["Verify those who claim this discount", true], ['This discount doesnt need verification', false]],{}, {:class => "browser-default"}) %>
|
13
|
+
|
14
|
+
</div>
|
15
|
+
<div class="actions">
|
16
|
+
<%= f.submit %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_for(@auth_shopping_discount, url: create_multiple_cart_items_path({:id => @auth_shopping_discount.id}), method: :post, as: :discount) do |f| %>
|
2
|
+
<%= render :partial => "auth/shared/object_errors.html.erb", locals: {active_model_object: @auth_shopping_discount} %>
|
3
|
+
|
4
|
+
<div class="form_fields">
|
5
|
+
<div>Add these items to your cart,and get a <%= @auth_shopping_discount.discount_amount %> discount!</div>
|
6
|
+
<% @auth_shopping_discount.product_ids.each do |pr_id| %>
|
7
|
+
|
8
|
+
|
9
|
+
<%= hidden_field_tag("discount[product_ids][]",pr_id.to_s, :id => "#{@auth_shopping_discount.id.to_s}_product_id_#{pr_id.to_s}", :multiple => true) %>
|
10
|
+
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
</div>
|
14
|
+
<div class="actions">
|
15
|
+
<%= f.submit "Use this coupon" %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% payment = Auth.configuration.payment_class.constantize.find(payment_id)
|
2
|
+
|
3
|
+
|
4
|
+
owner_resource = payment.get_resource
|
5
|
+
|
6
|
+
%>
|
7
|
+
<div class="row">
|
8
|
+
<div class="col l4 m4 s4">
|
9
|
+
<% if owner_resource %>
|
10
|
+
<% owner_resource.public_attributes_to_show.each do |p_attr| %>
|
11
|
+
<div>
|
12
|
+
<%= owner_resource.send("#{p_attr}") %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!-- i think it should use, javascript to populate two accessors, add_to_declined,
|
2
|
+
add_to_verified.
|
3
|
+
so on clicking the checkbox, the value of the reject checkbox will be
|
4
|
+
discount[add_to_declined][]
|
5
|
+
|
6
|
+
the value of the accept checkbox will be
|
7
|
+
discount[add_to_verified][] -->
|
8
|
+
<%= form_for(@auth_shopping_discount, url: @auth_shopping_discount.new_record? ? discounts_path : discount_path(@auth_shopping_discount), method: @auth_shopping_discount.new_record? ? :post : :put, as: :discount) do |f| %>
|
9
|
+
<%= render :partial => "auth/shared/object_errors.html.erb", locals: {active_model_object: @auth_shopping_discount} %>
|
10
|
+
<% @auth_shopping_discount.pending.each do |pending_id| %>
|
11
|
+
<%= puts "the pending id is: #{pending_id}" %>
|
12
|
+
<div class="input-field">
|
13
|
+
|
14
|
+
<%= render :partial => "show_pending_discount_request.html.erb", locals: {payment_id: pending_id} %>
|
15
|
+
|
16
|
+
<div class="row">
|
17
|
+
<div class="col l4 m4 s4">
|
18
|
+
<%= check_box_tag("discount[add_verified_ids][]",pending_id,false,{:id => "discount_add_verified_ids_#{pending_id}"}) %>
|
19
|
+
<%= label_tag("discount_add_verified_ids_#{pending_id}","Allow this person to use discount") %>
|
20
|
+
</div>
|
21
|
+
<div class="col l4 m4 s4">
|
22
|
+
<%= check_box_tag("discount[add_declined_ids][]",pending_id,false,{:id => "discount_add_declined_ids_#{pending_id}"}) %>
|
23
|
+
<%= label_tag("discount_add_declined_ids_#{pending_id}","Permission Denied") %>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
<%= f.submit %>
|
29
|
+
<% end %>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Listing Auth Shopping Discounts</h1>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<!-- id number, this will also hold links to edit and destroy. -->
|
9
|
+
<th>Number</th>
|
10
|
+
<th>Id Number</th>
|
11
|
+
<!-- get the names of the other fields to be shown-->
|
12
|
+
<% @auth_shopping_discounts.first.attributes_to_show.each do |attr| %>
|
13
|
+
<%= puts "doing: #{attr}" %>
|
14
|
+
<th><%= attr %></th>
|
15
|
+
<% end %>
|
16
|
+
</tr>
|
17
|
+
</thead>
|
18
|
+
<tbody>
|
19
|
+
<% @auth_shopping_discounts.each_with_index {|auth_shopping_discount,key| %>
|
20
|
+
<tr>
|
21
|
+
<td><%= key + 1 %></td>
|
22
|
+
<td>
|
23
|
+
<div>
|
24
|
+
<%= link_to auth_shopping_discount.id.to_s, discount_path(auth_shopping_discount) %>
|
25
|
+
</div>
|
26
|
+
<div>
|
27
|
+
<!-- add destory and edit options here -->
|
28
|
+
<!-- end -->
|
29
|
+
<span><%= link_to 'Edit', edit_discount_path(auth_shopping_discount) %></span>
|
30
|
+
<span><%= link_to 'Destroy', discount_path(auth_shopping_discount), method: :delete, data: { confirm: 'Are you sure?' } %></span>
|
31
|
+
<!-- here how to show a button, and how to change the form id's so that it uses the object id, -->
|
32
|
+
</div>
|
33
|
+
</td>
|
34
|
+
<% @auth_shopping_discounts.first.attributes_to_show.each do |attr| %>
|
35
|
+
<td><%= auth_shopping_discount.send("#{attr}") %></td>
|
36
|
+
<% end %>
|
37
|
+
</tr>
|
38
|
+
<% } %>
|
39
|
+
</tbody>
|
40
|
+
</table>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render :partial => "form.html.erb" %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
<div class="fields">
|
3
|
+
|
4
|
+
<% @auth_shopping_discount.attributes_to_show.each do |attr| %>
|
5
|
+
|
6
|
+
<div><%= attr %></div>
|
7
|
+
<div><%= @auth_shopping_discount.send("#{attr}") %></div>
|
8
|
+
<% if attr == "pending" %>
|
9
|
+
<%= link_to "Approve pending discount verification requests", edit_discount_path({:id => @auth_shopping_discount.id}) %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% end %>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<%= link_to 'Back', discounts_path %>
|
16
|
+
|
17
|
+
<!-- the user should be able to use the discount to create multiple cart items , so make a form that posts to create_multiple_cart_items -->
|
18
|
+
<%= render :partial => "form_for_create_multiple_cart_items" %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<%= form_for(@auth_shopping_payment, url: @auth_shopping_payment.new_record? ? payments_path : payment_path(@auth_shopping_payment), method: @auth_shopping_payment.new_record? ? :post : :put, as: :payment) do |f| %>
|
2
|
+
|
3
|
+
<%= f.select(:payment_status, [["Disapprove Payment", 0], ['Approve Payment', 1]],{}, {:class => "browser-default"}) %>
|
4
|
+
|
5
|
+
<%= f.submit "Submit" %>
|
6
|
+
|
7
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= form_for(@auth_shopping_payment, as: :payment) do |f| %>
|
2
|
+
<%= render :partial => "auth/shared/object_errors.html.erb", locals: {active_model_object: @auth_shopping_payment} %>
|
3
|
+
<%= f.hidden_field :cart_id, :value => @auth_shopping_payment.cart_id %>
|
4
|
+
|
5
|
+
<% if @auth_shopping_payment.discount_id %>
|
6
|
+
Use Your Discount Token
|
7
|
+
<!-- for the discount type of payment we make hidden field of the amount, type, and discount_id.-->
|
8
|
+
<%= f.hidden_field :amount, :value => 0.0 %>
|
9
|
+
<%= f.hidden_field :discount_id, :value => @auth_shopping_payment.discount_id %>
|
10
|
+
<%= f.hidden_field :payment_type, :value => "cash" %>
|
11
|
+
<% else %>
|
12
|
+
<%= f.label :amount %>
|
13
|
+
<%= f.text_field :amount, :value => @auth_shopping_payment.amount %>
|
14
|
+
<div class="input-field">
|
15
|
+
<%= f.select(:payment_type, [['cash', "cash"], ['card', "card"],["cheque","cheque"]],{} ,{:class => "browser-default"}) %>
|
16
|
+
</div>
|
17
|
+
<!-- add an input for payment status if it is an admin -->
|
18
|
+
<% if current_signed_in_resource.is_admin? %>
|
19
|
+
<%= f.select(:payment_status, [["Payment Not Verified By Cashier", 0], ['Payment Verified By Cashier', 1]],{}, {:class => "browser-default"}) %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
<%= f.submit 'Proceed' %>
|
23
|
+
<% end %>
|
24
|
+
<div class="divider m-40-bottom"></div>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<% if @auth_shopping_payment.payment_status == 1 && @auth_shopping_payment.cart.cart_pending_balance == 0 %>
|
2
|
+
|
3
|
+
<%= link_to "Create Coupons For your Friends/Family/Employees", new_discount_path(:discount => {:cart_id => @auth_shopping_payment.cart.id.to_s}) %>
|
4
|
+
|
5
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= form_for(@auth_shopping_payment, url: @auth_shopping_payment.new_record? ? payments_path : payment_path(@auth_shopping_payment), method: @auth_shopping_payment.new_record? ? :post : :put) do |f| %>
|
2
|
+
<%= render :partial => "auth/shared/object_errors.html.erb", locals: {active_model_object: @auth_shopping_payment} %>
|
3
|
+
|
4
|
+
<div class="form_fields">
|
5
|
+
<% @auth_shopping_payment.class.attribute_names.keep_if{|c| !@auth_shopping_payment.field_names_to_skip_while_making_form.include? c.to_s}.each do |attr| %>
|
6
|
+
|
7
|
+
<%=
|
8
|
+
text_field :payment, attr.to_sym , :value => @auth_shopping_payment.send("#{attr}")
|
9
|
+
%>
|
10
|
+
<%=
|
11
|
+
label :payment, attr.to_sym
|
12
|
+
%>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
</div>
|
16
|
+
<div class="actions">
|
17
|
+
<%= f.submit %>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<% if payment_gateway = Auth.configuration.payment_gateway_info %>
|
2
|
+
|
3
|
+
<% payment_options = payment_options(@auth_shopping_payment,lookup_resource)%>
|
4
|
+
|
5
|
+
<%= form_for(@auth_shopping_payment, as: :payment) do |f| %>
|
6
|
+
<% payment_options[:hidden].each do |k,v| %>
|
7
|
+
<%= f.hidden_field k, :value => v %>
|
8
|
+
<% end %>
|
9
|
+
<% payment_options[:visible].each do |k,v| %>
|
10
|
+
<%= f.label k %>
|
11
|
+
<%= f.text_field k, :value => v %>
|
12
|
+
<% end %>
|
13
|
+
<%= f.hidden_field :payment_type, :value => "gateway" %>
|
14
|
+
<%= f.submit 'Proceed' %>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<% else %>
|
18
|
+
|
19
|
+
You need to configure a payment gateway, Contact the site admin!
|
20
|
+
|
21
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if @auth_shopping_payment.payment_pending %>
|
2
|
+
<!-- if its not a gateway payment. -->
|
3
|
+
<!-- or if its not a gateway payment. -->
|
4
|
+
<% if @auth_shopping_payment.is_gateway? %>
|
5
|
+
<% if @auth_shopping_payment.gateway_callback_called == false %>
|
6
|
+
|
7
|
+
<div>Proceed to PayUMoney By Clicking the button below</div>
|
8
|
+
<%= payment_to_gateway_form(@auth_shopping_payment) %>
|
9
|
+
|
10
|
+
<% else %>
|
11
|
+
<%= render :partial => "refresh_payment.html.erb" %>
|
12
|
+
<% end %>
|
13
|
+
<% else %>
|
14
|
+
<!-- just give the option to refresh the payment, this is something that can be done with refunds or discounts or any other payment. -->
|
15
|
+
<%= render :partial => "refresh_payment.html.erb" %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div>Verify/Refresh Payment Status</div>
|
2
|
+
<%= form_for(@auth_shopping_payment, url: @auth_shopping_payment.new_record? ? payments_path : payment_path(@auth_shopping_payment), method: @auth_shopping_payment.new_record? ? :post : :put) do |f| %>
|
3
|
+
<%= hidden_field :payment, :is_verify_payment, :value => true %>
|
4
|
+
<div class="actions">
|
5
|
+
<%= f.submit "Verify/Refresh Payment Status" %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= form_for(@auth_shopping_payment, url: @auth_shopping_payment.new_record? ? payments_path : payment_path(@auth_shopping_payment), method: @auth_shopping_payment.new_record? ? :post : :put, as: :payment) do |f| %>
|
2
|
+
<%= render :partial => "auth/shared/object_errors.html.erb", locals: {active_model_object: @auth_shopping_payment} %>
|
3
|
+
<%= f.hidden_field :payment_type, :value => "cash" %>
|
4
|
+
<%= f.hidden_field :refund, :value => true %>
|
5
|
+
<%= f.hidden_field :cart_id, :value => @auth_shopping_payment.cart_id.to_s %>
|
6
|
+
<%= f.hidden_field :amount, :value => @auth_shopping_payment.amount %>
|
7
|
+
|
8
|
+
<%= f.submit "Create Refund Request." %>
|
9
|
+
|
10
|
+
<% end %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% if @auth_shopping_payment.payment_status == 1 %>
|
2
|
+
<div class="divider"></div>
|
3
|
+
<h4>Receipt</h4>
|
4
|
+
<!-- show the payment receipt -->
|
5
|
+
<div>The following items have been accepted for processing:</div>
|
6
|
+
<%= puts "the shopping cart is;" %>
|
7
|
+
<%= puts @auth_shopping_payment.cart %>
|
8
|
+
<%= render :partial => "auth/shopping/cart_items/show_cart_items_collection", locals: {cart_items: @auth_shopping_payment.payment_receipt[:current_payment], cart: @auth_shopping_payment.cart} %>
|
9
|
+
<!-- end -->
|
10
|
+
<div>Order Summary</div>
|
11
|
+
<%= render :partial => "auth/shopping/carts/show_cart_balance_info", locals: {cart: @auth_shopping_payment.cart} %>
|
12
|
+
<% end %>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Listing Auth Shopping Payments</h1>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<!-- id number, this will also hold links to edit and destroy. -->
|
9
|
+
<th>Number</th>
|
10
|
+
<th>Id Number</th>
|
11
|
+
<!-- get the names of the other fields to be shown-->
|
12
|
+
<% @auth_shopping_payments.first.attributes_to_show.each do |attr| %>
|
13
|
+
<th><%= attr %></th>
|
14
|
+
<% end %>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
|
18
|
+
<tbody>
|
19
|
+
<% @auth_shopping_payments.each_with_index {|auth_shopping_payment,key| %>
|
20
|
+
<tr>
|
21
|
+
<td><%= key + 1 %></td>
|
22
|
+
<td>
|
23
|
+
<div>
|
24
|
+
<%= link_to auth_shopping_payment.id.to_s, payment_path(auth_shopping_payment) %>
|
25
|
+
</div>
|
26
|
+
<div>
|
27
|
+
<!-- add destory and edit options here -->
|
28
|
+
<!-- end -->
|
29
|
+
<span><%= link_to 'Edit', edit_payment_path(auth_shopping_payment) %></span>
|
30
|
+
<span><%= link_to 'Destroy', payment_path(auth_shopping_payment), medthod: :delete, data: { confirm: 'Are you sure?' } %></span>
|
31
|
+
</div>
|
32
|
+
</td>
|
33
|
+
<% @auth_shopping_payments.first.attributes_to_show.each do |attr| %>
|
34
|
+
<td><%= auth_shopping_payment.send("#{attr}") %></td>
|
35
|
+
<% end %>
|
36
|
+
</tr>
|
37
|
+
<% } %>
|
38
|
+
</tbody>
|
39
|
+
</table>
|
40
|
+
|
41
|
+
<br>
|
42
|
+
|
43
|
+
<%= link_to 'New Payment', new_payment_path %>
|