payfast 1.0.1 → 1.0.2
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/lib/generators/payfast/install_generator.rb +54 -0
- metadata +11 -11
- data/lib/generators.rb +0 -56
- /data/lib/{templates → generators/payfast/templates}/config.yml +0 -0
- /data/lib/{templates → generators/payfast/templates}/controller.rb +0 -0
- /data/lib/{templates → generators/payfast/templates}/helper.rb +0 -0
- /data/lib/{templates → generators/payfast/templates}/index.html.erb +0 -0
- /data/lib/{templates → generators/payfast/templates}/make_payment.html.erb +0 -0
- /data/lib/{templates → generators/payfast/templates}/migration.rb +0 -0
- /data/lib/{templates → generators/payfast/templates}/model.rb +0 -0
- /data/lib/{templates → generators/payfast/templates}/routes.rb +0 -0
- /data/lib/{onsite_payments.rb → payfast/onsite_payments.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a4574ba86a681658b8f23c60ffd4139e6d59d6abc5017a78042f05b302624e4
|
4
|
+
data.tar.gz: 47ed239d23fcd5966db19cefdb119ad8b0366e61dfed31c21d80ad848508f4e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3398d67e68303c866e80d60bafe730ee3093d9bddb18ab499d0f50017dc5fb3300ac512597fc7f8d49d73b1cbfdd74c362f881778d314e4845ddc47eb8727661
|
7
|
+
data.tar.gz: ab136a269460fb4d03de079ea2195a5aa9be3d5bea253c3046f948da648ef2e7992b2aa6849a9ddd4832d9d6a8b5c75477834c2cdf0b448a05c049a0446c2847
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require "rails/generators"
|
2
|
+
|
3
|
+
module Payfast
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path("templates", __dir__)
|
6
|
+
|
7
|
+
def modify_routes
|
8
|
+
insert_into_file "config/routes.rb", after: "Rails.application.routes.draw do\n" do
|
9
|
+
# Read and insert the contents of your routes template file
|
10
|
+
File.read(File.join(__dir__, "templates", "routes.rb"))
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_controller
|
15
|
+
template "controller.rb", File.join("app/controllers", "#{controller_file_name}_controller.rb")
|
16
|
+
end
|
17
|
+
|
18
|
+
def create_views
|
19
|
+
actions.each do |action|
|
20
|
+
template "#{action}.html.erb", File.join("app/views", controller_file_name, "#{action}.html.erb")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_view_helper
|
25
|
+
template "helper.rb", "app/helpers/carts_helper.rb"
|
26
|
+
end
|
27
|
+
|
28
|
+
def create_migration
|
29
|
+
template "migration.rb", "db/migrate/#{timestamp}_create_carts.rb"
|
30
|
+
end
|
31
|
+
|
32
|
+
def create_config_file
|
33
|
+
template "config.yml", "config/payfast.yml"
|
34
|
+
end
|
35
|
+
|
36
|
+
def create_model
|
37
|
+
template "model.rb", "app/models/cart.rb"
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def controller_file_name
|
43
|
+
"carts"
|
44
|
+
end
|
45
|
+
|
46
|
+
def timestamp
|
47
|
+
Time.now.strftime("%Y%m%d%H%M%S")
|
48
|
+
end
|
49
|
+
|
50
|
+
def actions
|
51
|
+
%w(index make_payment)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payfast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dellan Muchengapadare
|
@@ -60,16 +60,16 @@ extra_rdoc_files: []
|
|
60
60
|
files:
|
61
61
|
- LICENSE
|
62
62
|
- README.md
|
63
|
-
- lib/generators.rb
|
64
|
-
- lib/
|
65
|
-
- lib/templates/
|
66
|
-
- lib/templates/
|
67
|
-
- lib/templates/
|
68
|
-
- lib/templates/
|
69
|
-
- lib/templates/
|
70
|
-
- lib/templates/
|
71
|
-
- lib/templates/
|
72
|
-
- lib/
|
63
|
+
- lib/generators/payfast/install_generator.rb
|
64
|
+
- lib/generators/payfast/templates/config.yml
|
65
|
+
- lib/generators/payfast/templates/controller.rb
|
66
|
+
- lib/generators/payfast/templates/helper.rb
|
67
|
+
- lib/generators/payfast/templates/index.html.erb
|
68
|
+
- lib/generators/payfast/templates/make_payment.html.erb
|
69
|
+
- lib/generators/payfast/templates/migration.rb
|
70
|
+
- lib/generators/payfast/templates/model.rb
|
71
|
+
- lib/generators/payfast/templates/routes.rb
|
72
|
+
- lib/payfast/onsite_payments.rb
|
73
73
|
homepage: https://github.com/mactunechy/payfast-gem
|
74
74
|
licenses:
|
75
75
|
- MIT
|
data/lib/generators.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
require "rails/generators"
|
2
|
-
|
3
|
-
module Payfast
|
4
|
-
module Generators
|
5
|
-
class InstallGenerator < Rails::Generators::Base
|
6
|
-
source_root File.expand_path("templates", __dir__)
|
7
|
-
|
8
|
-
def modify_routes
|
9
|
-
insert_into_file "config/routes.rb", after: "Rails.application.routes.draw do\n" do
|
10
|
-
# Read and insert the contents of your routes template file
|
11
|
-
File.read(File.join(__dir__, "templates", "routes.rb"))
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def create_controller
|
16
|
-
template "controller.rb", File.join("app/controllers", "#{controller_file_name}_controller.rb")
|
17
|
-
end
|
18
|
-
|
19
|
-
def create_views
|
20
|
-
actions.each do |action|
|
21
|
-
template "#{action}.html.erb", File.join("app/views", controller_file_name, "#{action}.html.erb")
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def create_view_helper
|
26
|
-
template "helper.rb", "app/helpers/carts_helper.rb"
|
27
|
-
end
|
28
|
-
|
29
|
-
def create_migration
|
30
|
-
template "migration.rb", "db/migrate/#{timestamp}_create_carts.rb"
|
31
|
-
end
|
32
|
-
|
33
|
-
def create_config_file
|
34
|
-
template "config.yml", "config/payfast.yml"
|
35
|
-
end
|
36
|
-
|
37
|
-
def create_model
|
38
|
-
template "model.rb", "app/models/cart.rb"
|
39
|
-
end
|
40
|
-
|
41
|
-
private
|
42
|
-
|
43
|
-
def controller_file_name
|
44
|
-
"carts"
|
45
|
-
end
|
46
|
-
|
47
|
-
def timestamp
|
48
|
-
Time.now.strftime("%Y%m%d%H%M%S")
|
49
|
-
end
|
50
|
-
|
51
|
-
def actions
|
52
|
-
%w(index make_payment)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|