stannp 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: df463198452eace393468c01970f5a2d5f0aca063bfebd9e98a059b006525e66
4
- data.tar.gz: c0e810b647919ca53513ccb0d35010aeb5afeed348a2c2325d2cdde4ed658fd3
3
+ metadata.gz: 59a7326c7fc932044cc7706a6e13769012cc269b253efa3ec51dae2b7c2517ea
4
+ data.tar.gz: f5cb65cc496bbe21d4657a65053af6518fc812a573590648a5ccb2949e23ce02
5
5
  SHA512:
6
- metadata.gz: f84d3718a853fda778d709769141be754c250f99ee65de980307a98fbf1133b7b68f2d9e8b568007aaf9a4c88684189f38f9714002b6d50ea4c6ba58fc40c1ca
7
- data.tar.gz: 7a5a4e153c5822dcac9888b98bf7560ea7c76895f88fe0df5022596ff4edbe1667a5d09413916370f138b1e80f84bbb53a4944c973248a0fea6ea6f54cb7299f
6
+ metadata.gz: cb4f1277029da2883fc36eea3e5ba72ba7b61d29fe10580f69d98894669952d6581d3208933d5c1ef67934a14ec4881ec194776e83e2a617da1930bb964466c4
7
+ data.tar.gz: 882d0899a9beaaf8877bf944645e76fe3f32c208630da4700e5b4aa7dc26a5a02e0e7c5cbab0aa6b2f98379cc77117ce5a27cd72ef220b98307946b27d5da846
data/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
- ## [Unreleased]
1
+ ## [0.1.0] - 2022-04-10
2
+ - Add the Recipients API
3
+ - Add the User API
2
4
 
3
- ## [0.1.0] - 2022-04-09
4
-
5
- - Initial release
5
+ ## [0.2.0] - 2022-04-11
6
+ - Add support for the complete Account API
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stannp
4
+ class Receipt < Object; end
5
+ end
@@ -6,5 +6,11 @@ module Stannp
6
6
  url = "https://dash.stannp.com/api/v1/accounts/balance?api_key=#{client.api_key}}"
7
7
  get_request(url).body['data']['balance']
8
8
  end
9
+
10
+ def top_up(amount:)
11
+ url = "https://dash.stannp.com/api/v1/accounts/topup?api_key=#{client.api_key}}"
12
+ url = post_request(url, body: { net: amount.to_f.to_s }).body['data']['receipt_pdf']
13
+ Stannp::Receipt.new(url: url)
14
+ end
9
15
  end
10
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stannp
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
data/lib/stannp.rb CHANGED
@@ -15,4 +15,5 @@ module Stannp
15
15
  # objects
16
16
  autoload :User, 'stannp/objects/user'
17
17
  autoload :Recipient, 'stannp/objects/recipient'
18
+ autoload :Receipt, 'stannp/objects/receipt'
18
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stannp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k-p-jones
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-10 00:00:00.000000000 Z
11
+ date: 2022-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -58,6 +58,7 @@ files:
58
58
  - lib/stannp/error.rb
59
59
  - lib/stannp/list.rb
60
60
  - lib/stannp/object.rb
61
+ - lib/stannp/objects/receipt.rb
61
62
  - lib/stannp/objects/recipient.rb
62
63
  - lib/stannp/objects/user.rb
63
64
  - lib/stannp/resource.rb