payify 0.1.14 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/payify/payments_controller_concern.rb +33 -0
- data/app/controllers/payify/payments_controller.rb +1 -25
- data/app/models/payify/payment.rb +2 -0
- data/config/routes.rb +1 -1
- data/lib/payify/engine.rb +0 -1
- data/lib/payify/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a9d1ca2475c701c3c4c52cf336fe15f4c4af67bd0bda8881f3e46c6138d4e4b
|
4
|
+
data.tar.gz: 5b860f6d917cdf5d8b5c488ff178b4543fe944abafc2678a373a93af2004e9ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad029b4c099016f6d332d1174323f8a7a2dc68e43173690651959d20e80310a8feb8d6794b88149608861035d61f1b9decfc1ebd059a2eca97b4fcff797f3a99
|
7
|
+
data.tar.gz: 1378445bd65037c4b0593387d25efb9cce4ee738d4546da5f4f8a08105317dbd174deb512b7cb636dc10354df239c072872dd82be4475452548a629512d7c3ff
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Payify
|
2
|
+
module PaymentsControllerConcern
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
before_action :set_object, only: %i[new complete]
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
@payment.stripe_init_intent
|
11
|
+
|
12
|
+
respond_to do |format|
|
13
|
+
format.html
|
14
|
+
format.json { render json: @payment }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def complete
|
19
|
+
@payment.stripe_confirm_payment unless @payment.paid?
|
20
|
+
|
21
|
+
respond_to do |format|
|
22
|
+
format.html
|
23
|
+
format.json { render json: @payment }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def set_object
|
30
|
+
@payment = Payment.find(params[:id])
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -1,29 +1,5 @@
|
|
1
1
|
module Payify
|
2
2
|
class PaymentsController < ActionController::Base
|
3
|
-
|
4
|
-
|
5
|
-
def new
|
6
|
-
@payment.stripe_init_intent
|
7
|
-
|
8
|
-
respond_to do |format|
|
9
|
-
format.html
|
10
|
-
format.json { render json: @payment }
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def complete
|
15
|
-
@payment.stripe_confirm_payment unless @payment.paid?
|
16
|
-
|
17
|
-
respond_to do |format|
|
18
|
-
format.html
|
19
|
-
format.json { render json: @payment }
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def set_object
|
26
|
-
@payment = Payment.find(params[:id])
|
27
|
-
end
|
3
|
+
include ::Payify::PaymentsControllerConcern
|
28
4
|
end
|
29
5
|
end
|
data/config/routes.rb
CHANGED
data/lib/payify/engine.rb
CHANGED
data/lib/payify/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Lopez
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- app/assets/images/payify/screenshot.png
|
80
80
|
- app/assets/images/payify/vat.png
|
81
81
|
- app/assets/stylesheets/payify/application.css
|
82
|
+
- app/controllers/concerns/payify/payments_controller_concern.rb
|
82
83
|
- app/controllers/payify/payments_controller.rb
|
83
84
|
- app/helpers/payify/application_helper.rb
|
84
85
|
- app/jobs/payify/application_job.rb
|