beyonic 0.0.1 → 0.0.3
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 +24 -63
- data/lib/beyonic.rb +6 -2
- data/lib/beyonic/abstract_api.rb +1 -1
- data/lib/beyonic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09fa19b0fa5e1fe627abcc5b6e1f032c495de202
|
4
|
+
data.tar.gz: 9719dff91ad47f731893e9920eba2b130938a1fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6777812995cf079a0efc09698c27da56837169bd2ce3c529f1463384d8342b73d51af86c4ecb4bbd461e34ae82debc4bc9c038e89651aa0d4bb6cd8bcffa1be
|
7
|
+
data.tar.gz: 743af5e41f94e8fd61e58023f103a4ed350d6c55c7a91bea01163f9a12930088fe8b5524bc32509472d7999dec04b892b45371e6250fbd8cc2b1f205da9cca58
|
data/README.md
CHANGED
@@ -1,63 +1,24 @@
|
|
1
|
-
# Beyonic
|
2
|
-
|
3
|
-
Ruby
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
```ruby
|
27
|
-
Beyonic::Payment.create(
|
28
|
-
phonenumber: "+256773712831",
|
29
|
-
amount: "100.2",
|
30
|
-
currency: "UGX",
|
31
|
-
description: "Per diem payment",
|
32
|
-
payment_type: "money",
|
33
|
-
callback_url: "https://my.website/payments/callback",
|
34
|
-
metadata: "{'id': '1234', 'name': 'Lucy'}"
|
35
|
-
)
|
36
|
-
```
|
37
|
-
|
38
|
-
After successeful creation you will get object Payment with id.
|
39
|
-
|
40
|
-
Also you can list all your payments or get one by id
|
41
|
-
|
42
|
-
```ruby
|
43
|
-
Beyonic::Payment.list
|
44
|
-
Beyonic::Payment.get(123)
|
45
|
-
```
|
46
|
-
|
47
|
-
Apart from everything else, you can manage Webohooks to define URLs on your server that notifications should be sent to.
|
48
|
-
```ruby
|
49
|
-
#Create
|
50
|
-
Beyonic::Webhook.create(
|
51
|
-
event: "payment.status.changed",
|
52
|
-
target: "https://my.callback.url/"
|
53
|
-
)
|
54
|
-
|
55
|
-
#Update by id
|
56
|
-
Beyonic::Webhook.update(2,
|
57
|
-
target: "https://mynew.callback.url/")
|
58
|
-
|
59
|
-
#Delete by id
|
60
|
-
Beyonic::Webhook.delete(2)
|
61
|
-
```
|
62
|
-
|
63
|
-
You can find more detailed API description here http://support.beyonic.com/category/api/
|
1
|
+
# Beyonic Ruby Library
|
2
|
+
|
3
|
+
Ruby gem for the http://beyonic.com API
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
If you just want to use the ruby library, you don't need to download the source code. Just run the following command:
|
8
|
+
```ruby
|
9
|
+
gem install beyonic
|
10
|
+
```
|
11
|
+
|
12
|
+
For access via bundler, use:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'beyonic', :git => 'https://bitbucket.org/beyonic/beyonic-ruby.git'
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Please visit http://support.beyonic.com/api for usage documentation
|
data/lib/beyonic.rb
CHANGED
@@ -5,7 +5,7 @@ module Beyonic
|
|
5
5
|
|
6
6
|
#Fixme! remove me after getting new cert
|
7
7
|
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
|
8
|
-
|
8
|
+
|
9
9
|
def self.api_key=(key)
|
10
10
|
@api_key = key
|
11
11
|
end
|
@@ -14,8 +14,12 @@ module Beyonic
|
|
14
14
|
@api_key
|
15
15
|
end
|
16
16
|
|
17
|
+
def self.api_version=(version)
|
18
|
+
@apk_version = version
|
19
|
+
end
|
20
|
+
|
17
21
|
def self.api_version
|
18
|
-
|
22
|
+
@apk_version
|
19
23
|
end
|
20
24
|
|
21
25
|
def self.endpoint_base
|
data/lib/beyonic/abstract_api.rb
CHANGED
@@ -42,7 +42,7 @@ module Beyonic::AbstractApi
|
|
42
42
|
def headers
|
43
43
|
headers_hash = {}
|
44
44
|
headers_hash.merge!({"Authorization" => "Token #{Beyonic.api_key}"}) if Beyonic.api_key
|
45
|
-
headers_hash.merge!({"Beyonic-Version" => Beyonic.api_version})
|
45
|
+
headers_hash.merge!({"Beyonic-Version" => Beyonic.api_version}) if Beyonic.api_version
|
46
46
|
headers_hash
|
47
47
|
end
|
48
48
|
|
data/lib/beyonic/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beyonic
|
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
|
- Oleg German
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|