spree_razorpay_checkout 0.0.2 → 0.0.4
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.
- checksums.yaml +4 -4
- data/README.md +119 -0
- data/lib/generators/spree_razorpay_checkout/install/install_generator.rb +25 -0
- data/lib/spree_razorpay_checkout/engine.rb +29 -0
- data/lib/spree_razorpay_checkout/factories.rb +6 -0
- data/lib/spree_razorpay_checkout/version.rb +11 -0
- data/lib/spree_razorpay_checkout.rb +4 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be049ea4932e3bfa3b1cfd7b0026c99bdcf09b505228259ff2a79873e7ab593e
|
4
|
+
data.tar.gz: 9716bca9cf17adb7dc8ae6f37d3355f1ab3836c8b5e39aa2ea63d69d074b40e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf5f5dd3b13b9f464ab3c94c57ef87ad3c05f201a2dfd98fa4b870361a06a46b8c3cb5040962223056eac59c7d4bf35de37558aa7c7fda106daf2e84e8ba8ae1
|
7
|
+
data.tar.gz: f4703d072832f950dec7bd4edb5c6ab29c2190d40abb597e96dab882f6d239736b9cc07c94d89e85d151563f732abefbf0bbd317872b000eab0c54d5b6e92300
|
data/README.md
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
<img
|
2
|
+
src="https://github.com/user-attachments/assets/3bcca1bd-5d70-4f0e-9c6d-4f99104d0e93"
|
3
|
+
alt="razorpay"
|
4
|
+
style="height: 100px; border-radius: 12em;"
|
5
|
+
/>
|
6
|
+
|
7
|
+
## Razorpay Extension for Spree Commerce v5
|
8
|
+
RazorPay is the only payments solution in India that allows businesses to accept, process and disburse payments with its product suite.
|
9
|
+
|
10
|
+
## Installation (Traditional)
|
11
|
+
|
12
|
+
1. Add this to your Gemfile with this line:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'spree_razorpay_checkout'
|
16
|
+
```
|
17
|
+
|
18
|
+
2. Install the Gem using Bundle Install:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
bundle install
|
22
|
+
```
|
23
|
+
|
24
|
+
3. Copy & Run Migrations:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
bundle exec rails g spree_razorpay_checkout:install
|
28
|
+
```
|
29
|
+
|
30
|
+
4. Compile Assests for Proper Images & JS loading:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
RAILS_ENV=development bin/rails assets:precompile
|
34
|
+
```
|
35
|
+
|
36
|
+
5. Start Server:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
foreman start -f Procfile.dev
|
40
|
+
```
|
41
|
+
|
42
|
+
## Installation (For Docker)
|
43
|
+
|
44
|
+
1. Add this your Gemfile with this line:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
gem 'spree_razorpay_checkout'
|
48
|
+
```
|
49
|
+
|
50
|
+
2. Install the Gem using Docker's Bundle Install:
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
docker compose run web bundle install
|
54
|
+
```
|
55
|
+
|
56
|
+
3. Run Install Generator to Copy Migrations in Docker way:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
docker compose run web bundle exec rails g spree_razorpay_checkout:install
|
60
|
+
```
|
61
|
+
|
62
|
+
4. Compile Assests for Razorpay logo & assets (Recommended):
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
docker compose run web bundle exec rails assets:precompile
|
66
|
+
```
|
67
|
+
|
68
|
+
5. Re-Start Server (Recommended):
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
docker compose down
|
72
|
+
docker compose up -d
|
73
|
+
```
|
74
|
+
|
75
|
+
## Plugin Configuration
|
76
|
+
6. Get keys from Razorpay Dashboard [here](https://dashboard.razorpay.com/app/website-app-settings/api-keys).
|
77
|
+
|
78
|
+
<img width="1186" height="735" alt="razorpay dashboard" src="https://github.com/user-attachments/assets/f390685d-550b-4814-8785-4fcc32746f15" />
|
79
|
+
|
80
|
+
7. Make Sure to include both Razorpay Live & Test Keys from Razorpay Dashboard:
|
81
|
+
|
82
|
+
<img width="1121" height="736" alt="Admin Dashboard - Razorpay Plugin" src="https://github.com/user-attachments/assets/f45efc43-b1db-4c79-9ad3-e3d672014676" />
|
83
|
+
|
84
|
+
|
85
|
+
8. Drag Razorpay to Top in Payment Methods to make it Default:
|
86
|
+
|
87
|
+
<img width="1121" height="726" alt="Payment Methods - Razorpay Plugin" src="https://github.com/user-attachments/assets/8e39086d-85a6-42a2-b9fb-75299044e6d6" />
|
88
|
+
|
89
|
+
## Checkout View
|
90
|
+
|
91
|
+
9. Checkout Page:
|
92
|
+
|
93
|
+
<img width="507" height="639" alt="Razorpay Checkout Page" src="https://github.com/user-attachments/assets/ddca8536-fa94-4502-96fa-4cd2219f3c17" />
|
94
|
+
|
95
|
+
10. Razorpay Modal to Capture Payments:
|
96
|
+
|
97
|
+
<img width="767" height="728" alt="Razorpay Modal" src="https://github.com/user-attachments/assets/da83105f-8510-44ae-ac7c-28960cf3a0b3" />
|
98
|
+
|
99
|
+
11. Order Page (Customer View):
|
100
|
+
|
101
|
+
<img width="863" height="733" alt="Razorpay in Order Page Client" src="https://github.com/user-attachments/assets/51b80fe6-4007-4223-b978-8ce65a3238de" />
|
102
|
+
|
103
|
+
12. Order Page (Admin View):
|
104
|
+
|
105
|
+
<img width="820" height="543" alt="Admin Orders Page Razorpay" src="https://github.com/user-attachments/assets/6d95d1ab-83a0-4ad8-9528-353cc7315630" />
|
106
|
+
|
107
|
+
Thankyou for supporting this plugin. if you find any issues related to plugin you are open to contribute and support which can help more Spree users in India.
|
108
|
+
|
109
|
+
## Gem Info
|
110
|
+
|
111
|
+
- [RubyGems Page](https://rubygems.org/gems/spree_razorpay_checkout)
|
112
|
+
- [Source Code](https://github.com/umeshravani/spree_razorpay)
|
113
|
+
- [Bug Reports](https://github.com/umeshravani/spree_razorpay/issues)
|
114
|
+
|
115
|
+
---
|
116
|
+
|
117
|
+
### Contributing
|
118
|
+
|
119
|
+
Contributions are welcome! Please open issues or submit pull requests to help improve this plugin for the Spree + Razorpay community in India.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module SpreeRazorpayCheckout
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path('templates', __dir__) # if you use templates
|
5
|
+
class_option :migrate, type: :boolean, default: true
|
6
|
+
|
7
|
+
def add_javascripts
|
8
|
+
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/spree_razorpay\n"
|
9
|
+
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/process_razorpay\n"
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_migrations
|
13
|
+
run 'bin/rails railties:install:migrations FROM=spree_razorpay_checkout'
|
14
|
+
end
|
15
|
+
|
16
|
+
def run_migrations
|
17
|
+
if options[:migrate]
|
18
|
+
run 'bin/rails db:migrate'
|
19
|
+
else
|
20
|
+
say_status :skip, "Skipped running migrations. You can run them later with `bin/rails db:migrate`.", :yellow
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module SpreeRazorpayCheckout
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
require 'spree/core'
|
4
|
+
isolate_namespace Spree
|
5
|
+
engine_name 'spree_razorpay'
|
6
|
+
|
7
|
+
# use rspec for tests
|
8
|
+
config.generators do |g|
|
9
|
+
g.test_framework :rspec
|
10
|
+
end
|
11
|
+
|
12
|
+
config.after_initialize do |_app|
|
13
|
+
SpreeRazorpayCheckout::Config = SpreeRazorpay::Configuration.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.activate
|
17
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
18
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
config.after_initialize do |app|
|
23
|
+
app.config.spree.payment_methods ||= []
|
24
|
+
app.config.spree.payment_methods << ::Spree::Gateway::RazorpayGateway
|
25
|
+
end
|
26
|
+
|
27
|
+
config.to_prepare(&method(:activate).to_proc)
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
# Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them.
|
3
|
+
#
|
4
|
+
# Example adding this to your spec_helper will load these Factories for use:
|
5
|
+
# require 'spree_razorpay/factories'
|
6
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_razorpay_checkout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Umesh Ravani
|
@@ -100,7 +100,13 @@ email:
|
|
100
100
|
executables: []
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
|
-
files:
|
103
|
+
files:
|
104
|
+
- README.md
|
105
|
+
- lib/generators/spree_razorpay_checkout/install/install_generator.rb
|
106
|
+
- lib/spree_razorpay_checkout.rb
|
107
|
+
- lib/spree_razorpay_checkout/engine.rb
|
108
|
+
- lib/spree_razorpay_checkout/factories.rb
|
109
|
+
- lib/spree_razorpay_checkout/version.rb
|
104
110
|
homepage: https://github.com/umeshravani/spree_razorpay
|
105
111
|
licenses:
|
106
112
|
- BSD-3-Clause
|