beyonic 0.0.1 → 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
  SHA1:
3
- metadata.gz: a9cb750b8209850df7f7aa7b95776d92af061fda
4
- data.tar.gz: 6323d13294482469a53bccb3616b46a4b94b2be1
3
+ metadata.gz: 09fa19b0fa5e1fe627abcc5b6e1f032c495de202
4
+ data.tar.gz: 9719dff91ad47f731893e9920eba2b130938a1fd
5
5
  SHA512:
6
- metadata.gz: d6591580528bcaf8318a6b1e4dccb473a1f0754d5314d5cf2befc3811bb93155306fba56e1e7d336244c9ce0e0e9379cb028fa39396aaea8afa911ed9b091440
7
- data.tar.gz: 01437d12906e27237ef5908c86655d82993d31866153f7d3644861cfaafdd8f3f55ffad923fc2732c9f695c17b12de8d7371ff6edeee910f1347997c48284201
6
+ metadata.gz: d6777812995cf079a0efc09698c27da56837169bd2ce3c529f1463384d8342b73d51af86c4ecb4bbd461e34ae82debc4bc9c038e89651aa0d4bb6cd8bcffa1be
7
+ data.tar.gz: 743af5e41f94e8fd61e58023f103a4ed350d6c55c7a91bea01163f9a12930088fe8b5524bc32509472d7999dec04b892b45371e6250fbd8cc2b1f205da9cca58
data/README.md CHANGED
@@ -1,63 +1,24 @@
1
- # Beyonic
2
-
3
- Ruby API wrapper for http://beyonic.com
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'beyonic_api', git: 'git@bitbucket.org:ogerman/beyonic_api.git'
11
- ```
12
-
13
- And then execute:
14
-
15
- $ bundle
16
-
17
- ## Usage
18
- To start using API you must setup your api key
19
-
20
- ```ruby
21
- Beyonic.api_key = "my-authorization-token"
22
- ```
23
-
24
- Now you can create payment
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
@@ -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
- "v1"
22
+ @apk_version
19
23
  end
20
24
 
21
25
  def self.endpoint_base
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Beyonic
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
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.1
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-02 00:00:00.000000000 Z
12
+ date: 2014-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client