xendit-rails 0.0.2 → 0.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f23491d5516272d1c6d105f20e04a1be7cf855209a48ec3b5c67963aa0477612
|
4
|
+
data.tar.gz: a24c3250857189f2e48be30dcfaaf61d9c1581da3958dced8b3ee2788fb1b236
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c132337f5c2afcdc7858a93906aefde745581452d23605436cdb256b8828a815428065806fd8ee1ca003b344fa732a90ab0b14cf8f4b62c8ff954efb10a2ed85
|
7
|
+
data.tar.gz: e333d80698781a88e50987bbcaba44475e90b09ec0c3465a6561f3e615ba8229b3e3c131d49250ba08a685b6b42fd322092922fd93b32e4a0764b0a000a471a6
|
@@ -1,7 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Xendit
|
4
|
+
# Xendit's base controller
|
4
5
|
class ApplicationController < ActionController::API
|
5
|
-
|
6
|
+
before_action :verify_token!
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def verify_token!
|
11
|
+
return true if token_valid?
|
12
|
+
|
13
|
+
head :unauthorized
|
14
|
+
false
|
15
|
+
end
|
16
|
+
|
17
|
+
def token_valid?
|
18
|
+
callback_token = Xendit.callback_token
|
19
|
+
if Xendit.callback_token.nil?
|
20
|
+
raise XenditTokenNotConfiguredError, "Callback token is not set."
|
21
|
+
end
|
22
|
+
|
23
|
+
request.headers["x-callback-token"] == callback_token
|
24
|
+
end
|
6
25
|
end
|
26
|
+
class XenditTokenNotConfiguredError < StandardError; end
|
7
27
|
end
|
data/lib/xendit-rails.rb
CHANGED
data/lib/xendit.rb
ADDED
data/lib/xendit/rails/engine.rb
CHANGED
data/lib/xendit/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,49 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xendit-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yana Agun Siswanto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 6.0.2
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
19
|
+
version: 5.2.0
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 6.0.2
|
30
24
|
- - ">="
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
26
|
+
version: 5.2.0
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: sqlite3
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - ">="
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
40
|
-
type: :
|
33
|
+
version: 1.3.13
|
34
|
+
type: :runtime
|
41
35
|
prerelease: false
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
38
|
- - ">="
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
40
|
+
version: 1.3.13
|
47
41
|
description: Quickly add payment to your rails app using xendit.
|
48
42
|
email:
|
49
43
|
- yana.developer@gmail.com
|
@@ -74,6 +68,7 @@ files:
|
|
74
68
|
- db/migrate/20200411160747_create_xendit_recurrings.rb
|
75
69
|
- lib/tasks/xendit/rails_tasks.rake
|
76
70
|
- lib/xendit-rails.rb
|
71
|
+
- lib/xendit.rb
|
77
72
|
- lib/xendit/invoice/payment_receiver.rb
|
78
73
|
- lib/xendit/rails/engine.rb
|
79
74
|
- lib/xendit/rails/version.rb
|