stay_commerce 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/stay/stripe_concern.rb +99 -64
  3. data/app/controllers/stay/admin/properties_controller.rb +1 -9
  4. data/app/controllers/stay/api/v1/credit_cards_controller.rb +33 -12
  5. data/app/controllers/stay/api/v1/messages_controller.rb +15 -10
  6. data/app/controllers/stay/api/v1/payments_controller.rb +73 -28
  7. data/app/controllers/stay/payments_controller.rb +13 -13
  8. data/app/models/stay/amenity.rb +2 -4
  9. data/app/models/stay/feature.rb +2 -3
  10. data/app/models/stay/property.rb +1 -1
  11. data/app/serializers/credit_card_serializer.rb +1 -2
  12. data/app/serializers/room_serializer.rb +1 -1
  13. data/app/views/stay/admin/amenities/index.html.erb +2 -2
  14. data/app/views/stay/admin/features/index.html.erb +2 -2
  15. data/app/views/stay/admin/properties/_description.html.erb +12 -53
  16. data/app/views/stay/admin/properties/_details.html.erb +2 -26
  17. data/app/views/stay/admin/properties/_form.html.erb +2 -34
  18. data/app/views/stay/admin/properties/_location.html.erb +6 -6
  19. data/app/views/stay/admin/properties/_sidebar.html.erb +7 -7
  20. data/app/views/stay/admin/properties/index.html.erb +0 -4
  21. data/app/views/stay/admin/properties/show.html.erb +0 -78
  22. data/app/views/stay/admin/rooms/_form.html.erb +42 -34
  23. data/app/views/stay/admin/rooms/index.html.erb +14 -14
  24. data/app/views/stay/admin/rooms/show.html.erb +15 -5
  25. data/config/initializers/stripe.rb +6 -6
  26. data/config/routes.rb +5 -1
  27. data/db/migrate/20250123053039_add_stripe_customer_id_to_stay_users.rb +5 -0
  28. data/db/migrate/20250123112636_add_payment_method_id_to_credit_cards.rb +6 -0
  29. data/lib/stay/version.rb +1 -1
  30. metadata +22 -6
@@ -1,8 +1,8 @@
1
- # API_CONFIG = YAML.load_file(Rails.root.join('config', 'api_config.yml'))[Rails.env]
1
+ require "dotenv/load"
2
2
 
3
- # Rails.configuration.stripe = {
4
- # publishable_key: API_CONFIG['stripe_publishable_key'],
5
- # secret_key: API_CONFIG['stripe_secret_key']
6
- # }
3
+ Rails.configuration.stripe = {
4
+ publishable_key: ENV["PUBLISHABLE_KEY"],
5
+ secret_key: ENV["SECRET_KEY"]
6
+ }
7
7
 
8
- # Stripe.api_key = Rails.configuration.stripe[:secret_key]
8
+ Stripe.api_key = Rails.configuration.stripe[:secret_key]
data/config/routes.rb CHANGED
@@ -27,7 +27,11 @@ Stay::Engine.routes.draw do
27
27
  resources :rooms
28
28
  resources :bookings
29
29
  resources :payment_methods
30
- resources :payments
30
+ resources :payments do
31
+ collection do
32
+ post :create_payment_method
33
+ end
34
+ end
31
35
  resources :reviews
32
36
  resources :chats
33
37
  resources :messages
@@ -0,0 +1,5 @@
1
+ class AddStripeCustomerIdToStayUsers < ActiveRecord::Migration[8.0]
2
+ def change
3
+ add_column :stay_users, :stripe_customer_id, :string
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddPaymentMethodIdToCreditCards < ActiveRecord::Migration[8.0]
2
+ def change
3
+ add_column :stay_credit_cards, :payment_method_token, :string, null: true
4
+ add_column :stay_credit_cards, :card_token, :string, null: true
5
+ end
6
+ end
data/lib/stay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Stay
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stay_commerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - w3villa-vikaspal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-17 00:00:00.000000000 Z
11
+ date: 2025-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -422,20 +422,34 @@ dependencies:
422
422
  - - ">="
423
423
  - !ruby/object:Gem::Version
424
424
  version: '0'
425
+ - !ruby/object:Gem::Dependency
426
+ name: dotenv-rails
427
+ requirement: !ruby/object:Gem::Requirement
428
+ requirements:
429
+ - - ">="
430
+ - !ruby/object:Gem::Version
431
+ version: '0'
432
+ type: :runtime
433
+ prerelease: false
434
+ version_requirements: !ruby/object:Gem::Requirement
435
+ requirements:
436
+ - - ">="
437
+ - !ruby/object:Gem::Version
438
+ version: '0'
425
439
  - !ruby/object:Gem::Dependency
426
440
  name: letter_opener
427
441
  requirement: !ruby/object:Gem::Requirement
428
442
  requirements:
429
- - - "~>"
443
+ - - ">="
430
444
  - !ruby/object:Gem::Version
431
- version: '1.10'
445
+ version: '0'
432
446
  type: :development
433
447
  prerelease: false
434
448
  version_requirements: !ruby/object:Gem::Requirement
435
449
  requirements:
436
- - - "~>"
450
+ - - ">="
437
451
  - !ruby/object:Gem::Version
438
- version: '1.10'
452
+ version: '0'
439
453
  description: Description of Stay.
440
454
  email:
441
455
  - vikas.pal@w3villa.com
@@ -936,6 +950,8 @@ files:
936
950
  - db/migrate/20241205092943_create_friendly_id_slugs.rb
937
951
  - db/migrate/20241217044817_add_deleted_atto_stay_property.rb
938
952
  - db/migrate/20241230064432_modify_property_category_on_properties.rb
953
+ - db/migrate/20250123053039_add_stripe_customer_id_to_stay_users.rb
954
+ - db/migrate/20250123112636_add_payment_method_id_to_credit_cards.rb
939
955
  - db/migrate/20250407101335_add_field_to_stay_users.rb
940
956
  - db/seeds.rb
941
957
  - lib/stay.rb