bwclient 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +43 -1
- data/bwclient.gemspec +2 -2
- data/lib/bwclient.rb +4 -4
- data/lib/bwclient/version.rb +1 -1
- 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: f26f25d1ad32725aac3d7d4a5c16e2edf5c5d8b3
|
4
|
+
data.tar.gz: facbde86a4b6da8f7d628c4ba88164b637d04cd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 503c717149713de5fc3ee53f56e5fa50dc83f6834faba80e510faaec0f335ff32f7b9640c6b34816c1d55e12ad9f8a82b6a0bdab65836ca4ce4a6a3ae6b76a33
|
7
|
+
data.tar.gz: b1ca1d812ddef7888422d0934177d7fb58cbd8785035255d913c87b53bdb919d3d491b5c2c41f67d8a3db516e842e38a17cac965e8be16d209bc22d4cb98bba1
|
data/README.md
CHANGED
@@ -20,7 +20,49 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
Setup BW API ID in application, by adding "bw_api_id" variable in secrets.yml file with your BW API ID.
|
24
|
+
|
25
|
+
config/secrets.yml
|
26
|
+
|
27
|
+
development:
|
28
|
+
bw_api_id: YOUR_BW_API_ID
|
29
|
+
production:
|
30
|
+
bw_api_id: YOUR_BW_API_ID
|
31
|
+
|
32
|
+
Method Calls :
|
33
|
+
|
34
|
+
1. To create an account on BW:
|
35
|
+
|
36
|
+
client = Bwclient::BwApi.new
|
37
|
+
client.create_account(user_object)
|
38
|
+
|
39
|
+
Pass user object with "create_account" method.
|
40
|
+
|
41
|
+
Response will be in following JSON format for success and failure:
|
42
|
+
|
43
|
+
Success Response:
|
44
|
+
|
45
|
+
[
|
46
|
+
{
|
47
|
+
"status"=>201
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"message"=>"Account Created message",
|
51
|
+
"acc_id"=>User account ID,
|
52
|
+
"api_key"=>User Api key
|
53
|
+
}
|
54
|
+
]
|
55
|
+
|
56
|
+
Failure Response:
|
57
|
+
|
58
|
+
[
|
59
|
+
{
|
60
|
+
"status"=>422
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"error"=>"Error Message"
|
64
|
+
}
|
65
|
+
]
|
24
66
|
|
25
67
|
## Contributing
|
26
68
|
|
data/bwclient.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'bwclient/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "bwclient"
|
8
8
|
spec.version = Bwclient::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email = ["
|
9
|
+
spec.authors = ["Kumar"]
|
10
|
+
spec.email = [""]
|
11
11
|
spec.summary = %q{BW ruby client.}
|
12
12
|
spec.description = %q{CRUD and operation for BW}
|
13
13
|
spec.homepage = ""
|
data/lib/bwclient.rb
CHANGED
@@ -6,9 +6,9 @@ module Bwclient
|
|
6
6
|
class BwApi
|
7
7
|
|
8
8
|
def create_account(user)
|
9
|
-
address = user.
|
9
|
+
address = "#{user.address_1}, #{user.address_2}, #{user.city}, #{user.state}, #{user.postal_code}" ,
|
10
10
|
response = RestClient.post('https://paybits.binarywallet.com/api/createaccount/new.php',
|
11
|
-
:api_id =>
|
11
|
+
:api_id => Rails.application.secrets[:bw_api_id],
|
12
12
|
:fname => user.first_name,
|
13
13
|
:lname => user.last_name,
|
14
14
|
:dob => '',
|
@@ -87,7 +87,7 @@ module Bwclient
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
-
def
|
90
|
+
def suspend_account(user)
|
91
91
|
response = RestClient.post('https://paybits.binarywallet.com/api/accountstatus/chngestatus.php',
|
92
92
|
:api_key => user.api_key,
|
93
93
|
:acc_id => user.acc_id,
|
@@ -118,7 +118,7 @@ module Bwclient
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
|
-
def
|
121
|
+
def resume_account(user)
|
122
122
|
response = RestClient.post('https://paybits.binarywallet.com/api/accountstatus/chngestatus.php',
|
123
123
|
:api_key => user.api_key,
|
124
124
|
:acc_id => user.acc_id,
|
data/lib/bwclient/version.rb
CHANGED
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bwclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Kumar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
description: CRUD and operation for BW
|
56
56
|
email:
|
57
|
-
-
|
57
|
+
- ''
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.4.1
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: BW ruby client.
|