payify 0.1.13 → 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: 96de4a1a033290c2cf4ab8db2370259c90f283eebf1f7d9524db1a5323c4578e
4
- data.tar.gz: 1b21f9a92a1dce9e96d3118fa9c50c865f9ab6d874ac75c4d1627b9954d16b7b
3
+ metadata.gz: 56393fe8599705be8631aa24680881d1616eff58126f505c3e8063a70045b2cc
4
+ data.tar.gz: cc9b67d908c7d8161c511b95293b4e1597a9b082883a814811af9ce1cc3b4304
5
5
  SHA512:
6
- metadata.gz: e71f5acc717c61b67756299441e1776685dd52ff06295d0fd0ba9c69c87ca0af36613d5dbe129629064b46bfb80ca392b5566169a9569d12b4e79a1dbcd35946
7
- data.tar.gz: 4fac2a4b1fb1d5878af81fcf1d22215d5e410e94bcaeb1021639e4da36d1f047bd8b5681ce61b7389f0af1c9b8a68e0b7173f2ed781d48678221c1e86036b0c6
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.13"
4
+ VERSION = "0.1.15"
5
5
  end
@@ -1,3 +1,5 @@
1
+ require "stripe"
2
+
1
3
  module StripeApi
2
4
  class Client
3
5
  def initialize
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.13
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