beyonic 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba045d758cffada3c03e193db926d0dea30d631d
4
- data.tar.gz: 54f8895825b1829a8d59d5e151a33fa63d55a3b1
3
+ metadata.gz: aeba5779a730b3dfdd61293744687f12b15bc5dc
4
+ data.tar.gz: 6ffd3ceae3a6f3264357e6ff7265c6dea01b23dd
5
5
  SHA512:
6
- metadata.gz: 1b771536ffab97f8f710fb4f82ffa1f811adf7166f08c1fafa17bb5b0a5f1d4907cfc947d5363eda554c4f163b937276dc15be1f5f97b2854709cf45c105d91c
7
- data.tar.gz: 982184ebb5d88973824a916d7477fcbdb1cf9a2e616381b87f125c5123a8da598c58b62c242fa1a7f2d305a477fb2b50318e2989c72a18ace3a3565a1b1f7ba9
6
+ metadata.gz: 4e34c55a5f250a25e0e84f6c7378c155bf7151bb4825ba51d5b58fee1b39612804b4b42e30c5ba8ceed350d830bb264be6ef7e7ea768a40e22a92d60f3b58d74
7
+ data.tar.gz: 572314f3a1fc9b541b506ab9ace642cd6c0f05cff5df4fa50d8325e3d632209ad98c7fd09e75615e765b4da9705a8370f22b2153dd0a465f51936d27760ed7ef
@@ -0,0 +1,46 @@
1
+ # Gem development
2
+ ## Adding new api model
3
+
4
+ To create new api model you should create new file like lib/beyonic/new_model.rb:
5
+ ```ruby
6
+ require 'ostruct'
7
+ class Beyonic::NewModel < OpenStruct
8
+ # Inherit OpenStruct for the model
9
+ # http://ruby-doc.org/stdlib-2.0/libdoc/ostruct/rdoc/OpenStruct.html
10
+
11
+ include Beyonic::AbstractApi
12
+ # Include AbstractApi module with standard CRUD methods
13
+
14
+ set_endpoint_resource "newmodel"
15
+ # Endpoint defenition in our case resulting endpoint will be
16
+ # https://app.beyonic.com/api/newmodel
17
+ end
18
+ ```
19
+ Also we need to require our model in "lib/beyonic.rb":
20
+ ```ruby
21
+ require "beyonic/new_model"
22
+ ```
23
+
24
+ ## Testing
25
+
26
+ ### Specs execution
27
+ ```sh
28
+ $ rspec
29
+ Run options: include {:focus=>true}
30
+
31
+ All examples were filtered out; ignoring {:focus=>true}
32
+ ...............................................................................
33
+
34
+ Finished in 0.58883 seconds (files took 0.60764 seconds to load)
35
+ 79 examples, 0 failures
36
+
37
+ Coverage report generated for RSpec to ~/beyonic-ruby/coverage. 86 / 86 LOC (100.0%) covered.
38
+ ```
39
+
40
+ You can get detailed coverage report at coverage/index.html, after tests has been ran.
41
+
42
+ ### API mocking
43
+ For mocks [VCR](https://github.com/vcr/vcr) is used.
44
+ All recorded API interactions cassettes located on fixtures/vcr_cassettes/ folder.
45
+
46
+ They can be deleted, in this case on next tests run specs will access to real API and cassettes will be recorded again.
@@ -33,3 +33,4 @@ require "beyonic/abstract_api"
33
33
  require "beyonic/payment"
34
34
  require "beyonic/webhook"
35
35
  require "beyonic/collection"
36
+ require "beyonic/collection_request"
@@ -2,4 +2,15 @@ require 'ostruct'
2
2
  class Beyonic::Collection < OpenStruct
3
3
  include Beyonic::AbstractApi
4
4
  set_endpoint_resource "collections"
5
- end
5
+
6
+ def self.claim(amount, phonenumber, remote_transaction_id)
7
+ self.list(
8
+ {
9
+ claim: true,
10
+ amount: amount,
11
+ phonenumber: phonenumber,
12
+ remote_transaction_id: remote_transaction_id
13
+ }
14
+ )
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ require 'ostruct'
2
+ class Beyonic::CollectionRequest < OpenStruct
3
+ include Beyonic::AbstractApi
4
+ set_endpoint_resource "collectionrequests"
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Beyonic
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
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.6
4
+ version: 0.0.7
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: 2015-02-19 00:00:00.000000000 Z
12
+ date: 2015-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -137,6 +137,20 @@ dependencies:
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
+ - !ruby/object:Gem::Dependency
141
+ name: vcr
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
140
154
  description: 'Beyonic.com makes enterprise payments to mobile easy. Details: http://beyonic.com'
141
155
  email:
142
156
  - oleg.german@gmail.com
@@ -145,10 +159,12 @@ executables: []
145
159
  extensions: []
146
160
  extra_rdoc_files: []
147
161
  files:
162
+ - DEVELOPMENT.md
148
163
  - README.md
149
164
  - lib/beyonic.rb
150
165
  - lib/beyonic/abstract_api.rb
151
166
  - lib/beyonic/collection.rb
167
+ - lib/beyonic/collection_request.rb
152
168
  - lib/beyonic/payment.rb
153
169
  - lib/beyonic/version.rb
154
170
  - lib/beyonic/webhook.rb
@@ -172,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
188
  version: '0'
173
189
  requirements: []
174
190
  rubyforge_project:
175
- rubygems_version: 2.4.3
191
+ rubygems_version: 2.4.6
176
192
  signing_key:
177
193
  specification_version: 4
178
194
  summary: Ruby library for the beyonic.com api