solidus_conekta 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +90 -0
  4. data/Rakefile +21 -0
  5. data/app/assets/javascripts/spree/backend/solidus_conekta.js +2 -0
  6. data/app/assets/javascripts/spree/frontend/conekta.js +635 -0
  7. data/app/assets/javascripts/spree/frontend/easyXDM.min.js +25 -0
  8. data/app/assets/javascripts/spree/frontend/printThis.js +146 -0
  9. data/app/assets/javascripts/spree/frontend/solidus_conekta.js.coffee +63 -0
  10. data/app/assets/javascripts/spree/frontend/utils.js.erb +35 -0
  11. data/app/assets/stylesheets/spree/backend/print.css.sass +12 -0
  12. data/app/assets/stylesheets/spree/backend/solidus_conekta.css +3 -0
  13. data/app/assets/stylesheets/spree/frontend/conekta.css.sass +45 -0
  14. data/app/assets/stylesheets/spree/frontend/solidus_conekta.css +4 -0
  15. data/app/controllers/spree/checkout_controller_decorator.rb +30 -0
  16. data/app/controllers/spree/conekta/payments_controller.rb +16 -0
  17. data/app/models/spree/billing_integration/conekta_gateway/bank.rb +30 -0
  18. data/app/models/spree/billing_integration/conekta_gateway/card.rb +35 -0
  19. data/app/models/spree/billing_integration/conekta_gateway/cash.rb +30 -0
  20. data/app/models/spree/billing_integration/conekta_gateway/monthly_payment.rb +35 -0
  21. data/app/models/spree/billing_integration/conekta_gateway.rb +31 -0
  22. data/app/models/spree/conekta_payment.rb +16 -0
  23. data/app/models/spree/credit_card_decorator.rb +8 -0
  24. data/app/models/spree/line_item_decorator.rb +11 -0
  25. data/app/models/spree/order_decorator.rb +19 -0
  26. data/app/models/spree/payment_decorator.rb +18 -0
  27. data/app/models/spree.rb +5 -0
  28. data/app/overrides/add_conekta_scripts_to_the_checkout.rb +4 -0
  29. data/app/views/spree/admin/payments/_banorte.html.erb +32 -0
  30. data/app/views/spree/admin/payments/_oxxo.html.erb +29 -0
  31. data/app/views/spree/admin/payments/_spei.html.erb +30 -0
  32. data/app/views/spree/admin/payments/source_forms/_conekta.html.erb +3 -0
  33. data/app/views/spree/admin/payments/source_forms/_conekta_card.html.erb +3 -0
  34. data/app/views/spree/admin/payments/source_views/_conekta.html.erb +1 -0
  35. data/app/views/spree/admin/payments/source_views/_conekta_card.html.erb +19 -0
  36. data/app/views/spree/checkout/_conekta_scripts.html.erb +17 -0
  37. data/app/views/spree/checkout/existing_payment/_conekta_card.html.erb +9 -0
  38. data/app/views/spree/checkout/payment/_conekta.html.erb +3 -0
  39. data/app/views/spree/checkout/payment/_conekta_card.html.erb +75 -0
  40. data/app/views/spree/conekta/gateway_options.json.jbuilder +34 -0
  41. data/app/views/spree/conekta/payments/_bank.html.erb +0 -0
  42. data/app/views/spree/conekta/payments/_banorte.html.erb +30 -0
  43. data/app/views/spree/conekta/payments/_card.html.erb +0 -0
  44. data/app/views/spree/conekta/payments/_cash.html.erb +0 -0
  45. data/app/views/spree/conekta/payments/_oxxo.html.erb +36 -0
  46. data/app/views/spree/conekta/payments/_spei.html.erb +28 -0
  47. data/app/views/spree/conekta/payments/show.html.erb +25 -0
  48. data/config/locales/en.yml +26 -0
  49. data/config/locales/es-MX.yml +26 -0
  50. data/config/routes.rb +5 -0
  51. data/db/migrate/20130904161251_create_spree_conekta_payments.rb +9 -0
  52. data/db/migrate/20130904172418_rename_type_column_to_conekta_payment.rb +7 -0
  53. data/db/migrate/20140220160614_add_installments_to_spree_credit_card.rb +5 -0
  54. data/db/migrate/20140509145837_add_payment_method_id_to_spree_conekta_payment.rb +6 -0
  55. data/db/migrate/20140509151116_add_user_id_to_spree_conekta_payment.rb +6 -0
  56. data/lib/generators/solidus_conekta/install/install_generator.rb +31 -0
  57. data/lib/solidus_conekta/engine.rb +40 -0
  58. data/lib/solidus_conekta/factories.rb +6 -0
  59. data/lib/solidus_conekta/version.rb +3 -0
  60. data/lib/solidus_conekta.rb +10 -0
  61. data/lib/spree/conekta/client.rb +36 -0
  62. data/lib/spree/conekta/configuration.rb +25 -0
  63. data/lib/spree/conekta/credit_card.rb +42 -0
  64. data/lib/spree/conekta/credit_card_collection.rb +36 -0
  65. data/lib/spree/conekta/customer.rb +39 -0
  66. data/lib/spree/conekta/exchange.rb +30 -0
  67. data/lib/spree/conekta/fake_response.rb +10 -0
  68. data/lib/spree/conekta/monthly_payment_provider.rb +26 -0
  69. data/lib/spree/conekta/payment_notification_handler.rb +36 -0
  70. data/lib/spree/conekta/payment_source/bank.rb +13 -0
  71. data/lib/spree/conekta/payment_source/card.rb +21 -0
  72. data/lib/spree/conekta/payment_source/cash.rb +13 -0
  73. data/lib/spree/conekta/provider.rb +134 -0
  74. data/lib/spree/conekta/response.rb +14 -0
  75. data/lib/tasks/solidus_conekta_tasks.rake +4 -0
  76. metadata +509 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b3a6d0cd2c007b0fe3dd4fa633241dcbcfa7e0b210c8da57888d08a497590fd4
4
+ data.tar.gz: 546f9cb6815b12a876ecfea07a7f6a6f58787f7ab35a21287490625191a8d4ee
5
+ SHA512:
6
+ metadata.gz: 57163d09f3769d5683e790147bafb30118db3fc97d3957938530f40ef8e8455b2fccf42a1fd19a85d6df7f994aea109c787e0d8a42f0a883a1c05b7d83626f9c
7
+ data.tar.gz: 21fe129cb31476788e9c0a3895844475a78dc61fecc222b20ee1d4c7a55f678e2a20486b18ce7c121c4c9e8a7bcb06bc90ffe8d9c6135a45278a20238bf850b3
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013-2015 Crowd Interactive
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # Solidus Conekta
2
+ Credit to https://github.com/InstafitGlobal/spree_conekta
3
+ https://github.com/AgilTec/spree_conekta
4
+ https://github.com/crowdint/spree_conekta
5
+
6
+ Setup
7
+ -----
8
+
9
+ Add this extension to your Gemfile:
10
+
11
+ ```ruby
12
+ gem 'solidus_conekta', github: 'jtapia/solidus_conekta'
13
+ ```
14
+
15
+ Then run:
16
+
17
+ ```
18
+ bundle
19
+ rails g solidus_conekta:install
20
+ ```
21
+
22
+ ##Setup Conekta Payments
23
+
24
+ 1. You need to go to [Conekta](https://www.conekta.io/), create an account and retrieve your private and public api keys.
25
+
26
+ 2. On the spree application admin side go to:
27
+ ```
28
+ /admin/payment_methods/new
29
+ ```
30
+
31
+ 3. In the provider box,choose one of the following options depending on your needs:
32
+
33
+ Spree::BillingIntegration::ConektaGateway::Card
34
+
35
+ Spree::BillingIntegration::ConektaGateway::Cash
36
+
37
+ Spree::BillingIntegration::ConektaGateway::Bank
38
+
39
+ Spree::BillingIntegration::ConektaGateway::MonthlyPayment
40
+
41
+ 4. On the auth token field, add your Conekta private key.
42
+ 5. On the public auth token field, add your Conekta public private key.
43
+
44
+ ###Source Methods
45
+
46
+ Conekta currently supports four different methods:
47
+
48
+ ####Card
49
+ >Card method will let you pay using your credit or debit card. More info: [Conekta Card](https://www.conekta.io/es/docs/tutoriales/pagos-con-tarjeta)
50
+
51
+ ####Cash
52
+ >Cash method will generate a bar code with the order information so you'll be able to take it to your nearest OXXO store to pay it. More info: [Conekta Cash](https://www.conekta.io/es/docs/tutoriales/pagos-en-efectivo)
53
+
54
+ ####Bank
55
+ >Bank method will let you generate a deposit or transfer reference. More info: [Conekta Bank](https://www.conekta.io/es/docs/tutoriales/pago-con-transferencia)
56
+
57
+ ####Monthly Payment
58
+ >This method will let you pay using your credit card with a monthly payment schema. More info: [Conekta Monthly Payments](https://admin.conekta.io/es/docs/tutoriales/meses-sin-intereses)
59
+ You can configurate the options for number of installements and default creating an initializer in your app and writing code as this example:
60
+ ```ruby
61
+ Spree::Conekta.configure do |config|
62
+ config.installment_options = [3] # [3, 6] , [3, 6, 12]
63
+ config.installment_default = 3 # 6 12
64
+ end
65
+ ```
66
+
67
+ **Important Note:** If you want to support all source methods, you'll need to create a payment method for each one.
68
+
69
+ **Important Note:** This extension only works with ruby 2.0+.
70
+
71
+ ## Contributors
72
+ * Jonathan Tapia
73
+ * Jonathan Garay
74
+ * Fernando Cuauhtemoc Barajas Chavez
75
+ * Herman Moreno
76
+ * Edwin Cruz
77
+ * Carlos A. Muñiz Moreno
78
+ * Chalo Fernandez
79
+ * Guillermo Siliceo
80
+ * Jaime Victoria
81
+ * Jorge Pardiñas
82
+ * Juan Carlos Rojas
83
+ * Leo Fischer
84
+ * Manuel Vidaurre
85
+ * Marco Medina
86
+ * Mumo Carlos
87
+ * Sergio Morales
88
+ * Steven Barragan
89
+ * Ulices Barajas
90
+ * bishma-stornelli
data/Rakefile ADDED
@@ -0,0 +1,21 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ require 'spree/testing_support/extension_rake'
6
+
7
+ RSpec::Core::RakeTask.new
8
+
9
+ task :default do
10
+ if Dir["spec/dummy"].empty?
11
+ Rake::Task[:test_app].invoke
12
+ Dir.chdir("../../")
13
+ end
14
+ Rake::Task[:spec].invoke
15
+ end
16
+
17
+ desc 'Generates a dummy app for testing'
18
+ task :test_app do
19
+ ENV['LIB_NAME'] = 'solidus_conekta'
20
+ Rake::Task['extension:test_app'].invoke
21
+ end
@@ -0,0 +1,2 @@
1
+ // Placeholder manifest file.
2
+ // the installer will append this file to the app vendored assets here: vendor/assets/javascripts/spree/backend/all.js'