payify 0.1.14 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f601e4f2af2f0234b1f350f6104792c7fac0b0ef6ca265e1d38756ca83464dff
4
- data.tar.gz: 30d71b52b41df3111441b53aca66152d1cc7fe17af74aa7c7f0ffef440a2e042
3
+ metadata.gz: 56393fe8599705be8631aa24680881d1616eff58126f505c3e8063a70045b2cc
4
+ data.tar.gz: cc9b67d908c7d8161c511b95293b4e1597a9b082883a814811af9ce1cc3b4304
5
5
  SHA512:
6
- metadata.gz: 270e4f3f37f20e8ddb39ef0514bf610a0c6582704bca0a778395305e04ef6cd81390f3c189fa8b18188a324537b8f894fc85428a497f1fc967ce91a8ae0d57fe
7
- data.tar.gz: 44e716493f072dbb9f0c15add3d90a78b31fc65a6292a09a609d2a703b3750872af15393aac6e4864c3394dfb4d685e1ef9d2e61d28e6b31e05fb41f5f9039c7
6
+ metadata.gz: c26af2fe3d5005bce70b1e2d886faa159b63a536dfe17d229beb9027e9feda17e0e49610c56987350a0b485d4a128d805c01219f5ea622961a6fde7045d56b3d
7
+ data.tar.gz: 1a27db9b14f7d0e90fa9df15270dd77d1a0eb23570f9640c0ff230c512c5ee1e909677abb53bc4f27410a44057f9a2033fecdaa140fab5b5cf66024be763aee7
@@ -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
- before_action :set_object, only: %i[new complete]
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Payify
4
- VERSION = "0.1.14"
4
+ VERSION = "0.1.15"
5
5
  end
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.14
4
+ version: 0.1.15
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