brainblocks-rails 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +42 -40
- data/brainblocks-rails.gemspec +26 -26
- data/lib/brainblocks-rails/brainblocks_rails_helper.rb +11 -1
- data/lib/brainblocks-rails/version.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88cdde1841bdb0e09e1966d3cccf327f32651d9c
|
4
|
+
data.tar.gz: 5e3c4c3921c04e11e46111f01c07fde7fc3b5f38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 054a279e237e588294f559a3a08501b01d3bbb26041f0896a1568acf6f1a6e5cc6f4a55405ea26a5d0d1a697d66b03a65a5e680385ba762a9fb95b3668cec393
|
7
|
+
data.tar.gz: 903891caaf101edc25d2fbe706239c3e32d2503300cf38bbae394378f5a7bd7901388898e4da30960925b0f7af0f714f703da1b1efbc9cb2dabb65314ca86f6f
|
data/README.md
CHANGED
@@ -1,40 +1,42 @@
|
|
1
|
-
# brainblocks-rails
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'brainblocks-rails'
|
11
|
-
```
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install brainblocks-rails
|
20
|
-
|
21
|
-
Include it in your application.js as:
|
22
|
-
|
23
|
-
```
|
24
|
-
//= require brainblocks
|
25
|
-
```
|
26
|
-
|
27
|
-
## Usage
|
28
|
-
|
29
|
-
```
|
30
|
-
brainblocks(wallet, amount, currency, on_success)
|
31
|
-
```
|
32
|
-
|
33
|
-
`on_success` Takes javascript. In the future I hope to support Rails actions.
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
```
|
39
|
-
|
40
|
-
|
1
|
+
# brainblocks-rails
|
2
|
+
|
3
|
+
Simplifies use of Brainblocks in Rails.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'brainblocks-rails'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install brainblocks-rails
|
20
|
+
|
21
|
+
Include it in your application.js as:
|
22
|
+
|
23
|
+
```
|
24
|
+
//= require brainblocks
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
```
|
30
|
+
brainblocks(wallet, amount, currency, on_success)
|
31
|
+
```
|
32
|
+
|
33
|
+
`on_success` Takes javascript. In the future I hope to support Rails actions.
|
34
|
+
|
35
|
+
`amount` Is in Rai; 1000 Rai = 0.001 XRB (or 1 Mxrb)
|
36
|
+
|
37
|
+
Example:
|
38
|
+
```
|
39
|
+
brainblocks("xrb_1rube3u6iyshxpe5g737zkqnmk7jq4whoi76dw1zip5wcy4y4rm84jw3bs79", 1000, "rai", "console.log('Payment successful!', data.token);")
|
40
|
+
```
|
41
|
+
|
42
|
+
https://brainblocks.io/
|
data/brainblocks-rails.gemspec
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "brainblocks-rails/version"
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "brainblocks-rails"
|
8
|
-
spec.version = BrainblocksRails::VERSION
|
9
|
-
spec.authors = ["Mitchel"]
|
10
|
-
spec.email = ["mitchel_jager@hotmail.com"]
|
11
|
-
|
12
|
-
spec.summary = %q{Simplified use of Brainblocks (
|
13
|
-
spec.description = %q{Simplified use of Brainblocks (
|
14
|
-
spec.homepage = ""
|
15
|
-
spec.license = "MIT"
|
16
|
-
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
-
f.match(%r{^(test|spec|features)/})
|
19
|
-
end
|
20
|
-
spec.bindir = "exe"
|
21
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
-
spec.require_paths = ["lib"]
|
23
|
-
|
24
|
-
spec.add_development_dependency "bundler", "~> 1.15"
|
25
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
-
end
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "brainblocks-rails/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "brainblocks-rails"
|
8
|
+
spec.version = BrainblocksRails::VERSION
|
9
|
+
spec.authors = ["Mitchel"]
|
10
|
+
spec.email = ["mitchel_jager@hotmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Simplified use of Brainblocks (Nano payment) in Rails}
|
13
|
+
spec.description = %q{Simplified use of Brainblocks (Nano payment) in Rails}
|
14
|
+
spec.homepage = ""
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module BrainblocksHelper
|
2
|
-
def brainblocks(wallet
|
2
|
+
def brainblocks(wallet: "xrb_1xau1obw9u14ung8okbstmh4wmc63iw9y5cq3way3pbkj4krh9j15f4j7dnz", amount: 1000, currency: "rai", on_success: "console.log('Payment successful!', data.token);")
|
3
3
|
@brainblocks_id ||= -1
|
4
4
|
|
5
5
|
element = "brainblocks-#{@brainblocks_id += 1}"
|
@@ -21,4 +21,14 @@ module BrainblocksHelper
|
|
21
21
|
|
22
22
|
button + script
|
23
23
|
end
|
24
|
+
|
25
|
+
def brainblocks_is_fulfilled?(token)
|
26
|
+
uri = URI.parse("https://brainblocks.io/api/session/#{token}/verify")
|
27
|
+
response = Net::HTTP.get_response(uri)
|
28
|
+
|
29
|
+
# url = "https://brainblocks.io/api/session/#{token}/verify"
|
30
|
+
# data = JSON(open(url).read)
|
31
|
+
|
32
|
+
return true if response[:fulfilled] == true
|
33
|
+
end
|
24
34
|
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
module BrainblocksRails
|
2
|
-
VERSION = "1.0.
|
3
|
-
end
|
1
|
+
module BrainblocksRails
|
2
|
+
VERSION = "1.0.3"
|
3
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brainblocks-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mitchel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description: Simplified use of Brainblocks (
|
41
|
+
description: Simplified use of Brainblocks (Nano payment) in Rails
|
42
42
|
email:
|
43
43
|
- mitchel_jager@hotmail.com
|
44
44
|
executables: []
|
@@ -80,5 +80,5 @@ rubyforge_project:
|
|
80
80
|
rubygems_version: 2.5.2
|
81
81
|
signing_key:
|
82
82
|
specification_version: 4
|
83
|
-
summary: Simplified use of Brainblocks (
|
83
|
+
summary: Simplified use of Brainblocks (Nano payment) in Rails
|
84
84
|
test_files: []
|