petra_sdk 0.1.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 +7 -0
- data/.DS_Store +0 -0
- data/.gitignore +9 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/petra.rb +35 -0
- data/lib/petra/error.rb +15 -0
- data/lib/petra/modules/base.rb +105 -0
- data/lib/petra/modules/customer.rb +34 -0
- data/lib/petra/modules/endpoints.rb +3 -0
- data/lib/petra/modules/invoice.rb +38 -0
- data/lib/petra/modules/page.rb +38 -0
- data/lib/petra/modules/transaction.rb +33 -0
- data/lib/petra/version.rb +3 -0
- data/petra.gemspec +39 -0
- metadata +92 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fad54bff793b834174d982ea856c3d3c9b3b24591d6fa9a870b4c7650282f49d
|
4
|
+
data.tar.gz: c5bba13d72e72aafa61fdd4059da446ed519af6555c3e5c3497f4a7217422ba8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 21c990a80c15f0dc981d8e8819b14d77fbf170f31060f334243427be4c5d1e0f007efe4b20151d774003de75059a7ea7f6e263d7486d542f7b720a30986e1c36
|
7
|
+
data.tar.gz: 334a08da3f3d9ba783dad6e02f022d178870676617b78e96a7d7d88853ac6a8a1ece7bfd5d2ba96089a742209724ae5a0cca3ba555e7ee20dd15477d7bc34242
|
data/.DS_Store
ADDED
Binary file
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at Emmanueltolu.adebayo@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 Emmanuel Adebayo
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Petra
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/petra`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'petra'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install petra
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/petra. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
+
|
41
|
+
## Code of Conduct
|
42
|
+
|
43
|
+
Everyone interacting in the Petra project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/petra/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "petra"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lib/petra.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'petra/version'
|
2
|
+
|
3
|
+
class Petra
|
4
|
+
attr_accessor :secret_key, :production, :url
|
5
|
+
|
6
|
+
def initialize(secret_key = nil)
|
7
|
+
@secret_key = secret_key
|
8
|
+
petra_base_url = BASE_ENDPOINTS::PETRA_BASE_URL
|
9
|
+
@url = petra_base_url
|
10
|
+
|
11
|
+
def base_url
|
12
|
+
url
|
13
|
+
end
|
14
|
+
|
15
|
+
@secret_key = if secret_key.nil?
|
16
|
+
ENV['PETRA_SECRET_KEY']
|
17
|
+
else
|
18
|
+
secret_key
|
19
|
+
end
|
20
|
+
warn 'Warning: To ensure your petra account api keys are safe, It is best to always set your keys in the environment variable'
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
# raise this error if no secret key is passed
|
25
|
+
if @secret_key.nil?
|
26
|
+
raise PetraBadKeyError,
|
27
|
+
"No secret key supplied and couldn't find any in environment variables. Make sure to set secret key as an environment variable PETRA_SECRET_KEY"
|
28
|
+
end
|
29
|
+
# raise this error if invalid secret key is passed
|
30
|
+
unless @secret_key[0..7] == 'sk_live' || @secret_key[0..7] == 'sk_test'
|
31
|
+
raise PetraBadKeyError, "Invalid secret key #{@secret_key}"
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
data/lib/petra/error.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
class PetraServerError < StandardError
|
2
|
+
attr_reader :response
|
3
|
+
def initialize(response=nil)
|
4
|
+
@response = response
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
class PetraBadKeyError < StandardError
|
9
|
+
end
|
10
|
+
|
11
|
+
class IncompleteParameterError < StandardError
|
12
|
+
end
|
13
|
+
|
14
|
+
class SuggestedAuthError < StandardError
|
15
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require "json"
|
2
|
+
require_relative '../error'
|
3
|
+
|
4
|
+
class Base
|
5
|
+
|
6
|
+
attr_reader :petra_object
|
7
|
+
|
8
|
+
# method to initialize this class
|
9
|
+
|
10
|
+
def initialize(petra_object=nil)
|
11
|
+
unless !petra_object.nil?
|
12
|
+
raise ArgumentError, "Petra Africa Object is required!!!"
|
13
|
+
end
|
14
|
+
@petra_object = petra_object
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
def get_request(endpoint)
|
19
|
+
# headers = {
|
20
|
+
# "Authorization" => "Bearer #{petra_object.secret_key}"
|
21
|
+
# }
|
22
|
+
begin
|
23
|
+
response = HTTParty.get(endpoint, :headers => { "Authorization" => "Bearer #{petra_object.secret_key}" })
|
24
|
+
unless (response.code == 200 || response.code == 201)
|
25
|
+
raise PetraServerError.new(response), "HTTP Code #{response.code}: #{response.body}"
|
26
|
+
end
|
27
|
+
|
28
|
+
return response
|
29
|
+
|
30
|
+
unless(response.code != 0 )
|
31
|
+
raise PetraServerError.new(response), "Server Message: #{response.message}"
|
32
|
+
end
|
33
|
+
|
34
|
+
rescue JSON::ParserError => jsonerr
|
35
|
+
raise PetraServerError.new(response) , "Invalid result data. Could not parse JSON response body \n #{jsonerr.message}"
|
36
|
+
return response
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
# method to make a post request
|
42
|
+
def post_request(endpoint, data)
|
43
|
+
begin
|
44
|
+
response = HTTParty.post(endpoint, {
|
45
|
+
body: data,
|
46
|
+
headers: {
|
47
|
+
"Content-Type" => "application/json",
|
48
|
+
"Authorization" => "Bearer #{petra_object.secret_key}"
|
49
|
+
}
|
50
|
+
})
|
51
|
+
|
52
|
+
unless (response.code == 200 || response.code == 201)
|
53
|
+
raise PetraServerError.new(response), "HTTP Code #{response.code}: #{response.body}"
|
54
|
+
end
|
55
|
+
return response
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
# method to make a put request
|
60
|
+
def put_request(endpoint, data)
|
61
|
+
begin
|
62
|
+
response = HTTParty.put(endpoint, {
|
63
|
+
body: data,
|
64
|
+
headers: {
|
65
|
+
"Content-Type" => "application/json",
|
66
|
+
"Authorization" => "Bearer #{petra_object.secret_key}"
|
67
|
+
}
|
68
|
+
})
|
69
|
+
|
70
|
+
unless (response.code == 200 || response.code == 201)
|
71
|
+
raise PetraServerError.new(response), "HTTP Code #{response.code}: #{response.body}"
|
72
|
+
end
|
73
|
+
return response
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# method to make a delete request
|
78
|
+
def delete_request(endpoint, data)
|
79
|
+
begin
|
80
|
+
response = HTTParty.delete(endpoint, {
|
81
|
+
body: data,
|
82
|
+
headers: {
|
83
|
+
"Content-Type" => "application/json",
|
84
|
+
"Authorization" => "Bearer #{petra_object.secret_key}"
|
85
|
+
}
|
86
|
+
})
|
87
|
+
|
88
|
+
unless (response.code == 200 || response.code == 201)
|
89
|
+
raise PetraServerError.new(response), "HTTP Code #{response.code}: #{response.body}"
|
90
|
+
end
|
91
|
+
return response
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# method to check if the passed parameters is equal to the expected parameters
|
96
|
+
def check_passed_parameters(required_params, passed_params)
|
97
|
+
|
98
|
+
# This is used to check if the passed authorization parameters matches the required parameters
|
99
|
+
required_params.each do |k, v|
|
100
|
+
if !passed_params.key?(k)
|
101
|
+
raise IncompleteParameterError, "Parameters Incomplete, Missing Parameter: #{k}, Please pass in the complete parameter."
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative 'base'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
|
5
|
+
class Customer < Base
|
6
|
+
|
7
|
+
def create_customer(data)
|
8
|
+
base_url = petra_object.base_url
|
9
|
+
required_parameters = ["email"]
|
10
|
+
check_passed_parameters(required_parameters, data)
|
11
|
+
response = post_request("#{base_url}/customer", data)
|
12
|
+
return response
|
13
|
+
end
|
14
|
+
|
15
|
+
def get_customers(page, per_page)
|
16
|
+
base_url = petra_object.base_url
|
17
|
+
response = get_request("#{base_url}/customer?perPage=#{per_page}&page=#{page}")
|
18
|
+
return response
|
19
|
+
end
|
20
|
+
|
21
|
+
def get_customer(reference)
|
22
|
+
base_url = petra_object.base_url
|
23
|
+
response = get_request("#{base_url}/customer/#{reference}")
|
24
|
+
return response
|
25
|
+
end
|
26
|
+
|
27
|
+
def update_customer(reference, payload)
|
28
|
+
base_url = petra_object.base_url
|
29
|
+
required_parameters = ['first_name','last_name']
|
30
|
+
check_passed_parameters(required_parameters, payload)
|
31
|
+
response = put_request("#{base_url}/customer/#{reference}", payload)
|
32
|
+
return response
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative 'base'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class Invoice < Base
|
5
|
+
|
6
|
+
def create_invoice(data)
|
7
|
+
base_url = petra_object.base_url
|
8
|
+
required_parameters = ["email","amount"]
|
9
|
+
check_passed_parameters(required_parameters, data)
|
10
|
+
response = post_request("#{base_url}/invoice", data)
|
11
|
+
return response
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_invoices(page,per_page)
|
15
|
+
base_url = petra_object.base_url
|
16
|
+
response = get_request("#{base_url}/invoice?perPage=#{per_page}&page=#{page}")
|
17
|
+
return response
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_invoice(id)
|
21
|
+
base_url = petra_object.base_url
|
22
|
+
response = get_request("#{base_url}/invoice/#{id}")
|
23
|
+
return response
|
24
|
+
end
|
25
|
+
|
26
|
+
def archive_invoice(id)
|
27
|
+
base_url = petra_object.base_url
|
28
|
+
response = get_request("#{base_url}/invoice/archive/#{id}")
|
29
|
+
return response
|
30
|
+
end
|
31
|
+
|
32
|
+
def send_notification(id)
|
33
|
+
base_url = petra_object.base_url
|
34
|
+
payload = {}
|
35
|
+
response = post_request("#{base_url}/invoice/notify/#{id}", payload)
|
36
|
+
return response
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative 'base'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class Page < Base
|
5
|
+
|
6
|
+
def create_page(data)
|
7
|
+
base_url = petra_object.base_url
|
8
|
+
required_parameters = ["name","amount","description"]
|
9
|
+
check_passed_parameters(required_parameters, data)
|
10
|
+
response = post_request("#{base_url}/page", data)
|
11
|
+
return response
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_pages(page, per_page)
|
15
|
+
base_url = petra_object.base_url
|
16
|
+
response = get_request("#{base_url}/page?perPage=#{per_page}&page=#{page}")
|
17
|
+
return response
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_page(id)
|
21
|
+
base_url = petra_object.base_url
|
22
|
+
response = get_request("#{base_url}/page/#{id}")
|
23
|
+
return response
|
24
|
+
end
|
25
|
+
|
26
|
+
def update_page(id, payload)
|
27
|
+
base_url = petra_object.base_url
|
28
|
+
required_parameters = ["name"]
|
29
|
+
check_passed_parameters(required_parameters, payload)
|
30
|
+
response = put_request("#{base_url}/page/#{id}", payload)
|
31
|
+
end
|
32
|
+
|
33
|
+
def check_slug_availability(slug)
|
34
|
+
base_url = petra_object.base_url
|
35
|
+
response = get_request("#{base_url}/page/check_slug_availability/#{slug}")
|
36
|
+
return response
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'base'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class Transactions < Base
|
5
|
+
|
6
|
+
def initialize_transaction(data)
|
7
|
+
base_url = petra_object.base_url
|
8
|
+
required_parameters = ["amount", "type", "email"]
|
9
|
+
check_passed_parameters(required_parameters, data)
|
10
|
+
response = post_request("#{base_url}/transaction/initialize", data)
|
11
|
+
return response
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_transactions(page = 1, per_page = 50)
|
15
|
+
base_url = petra_object.base_url
|
16
|
+
response = get_request("#{base_url}/transaction?perPage=#{per_page}&page=#{page}")
|
17
|
+
return response
|
18
|
+
end
|
19
|
+
|
20
|
+
def fetch_transaction(id)
|
21
|
+
base_url = petra_object.base_url
|
22
|
+
response = get_request("#{base_url}/transaction/#{id}")
|
23
|
+
return response
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
def verify_transaction(id)
|
28
|
+
base_url = petra_object.base_url
|
29
|
+
response = get_request("#{base_url}/transaction/verify/#{id}")
|
30
|
+
return response
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
data/petra.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "petra/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "petra_sdk"
|
8
|
+
spec.version = Petra::VERSION
|
9
|
+
spec.authors = ["Emmanuel Adebayo"]
|
10
|
+
spec.email = ["emmanueltolu.adebayo@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Petra Africa Ruby/Rails Gem.}
|
13
|
+
spec.description = %q{This is the official Ruby Gem for Petra Africa.}
|
14
|
+
spec.homepage = "https://github.com/PetraHQ/petra_ruby"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
|
21
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
22
|
+
spec.metadata["source_code_uri"] = "https://github.com/PetraHQ/petra_ruby"
|
23
|
+
else
|
24
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
25
|
+
"public gem pushes."
|
26
|
+
end
|
27
|
+
|
28
|
+
# Specify which files should be added to the gem when it is released.
|
29
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
30
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
31
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
32
|
+
end
|
33
|
+
spec.bindir = "exe"
|
34
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
35
|
+
spec.require_paths = ["lib"]
|
36
|
+
|
37
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
38
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: petra_sdk
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Emmanuel Adebayo
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-08-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.17'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.17'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: This is the official Ruby Gem for Petra Africa.
|
42
|
+
email:
|
43
|
+
- emmanueltolu.adebayo@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".DS_Store"
|
49
|
+
- ".gitignore"
|
50
|
+
- CODE_OF_CONDUCT.md
|
51
|
+
- Gemfile
|
52
|
+
- LICENSE.txt
|
53
|
+
- README.md
|
54
|
+
- Rakefile
|
55
|
+
- bin/console
|
56
|
+
- bin/setup
|
57
|
+
- lib/petra.rb
|
58
|
+
- lib/petra/error.rb
|
59
|
+
- lib/petra/modules/base.rb
|
60
|
+
- lib/petra/modules/customer.rb
|
61
|
+
- lib/petra/modules/endpoints.rb
|
62
|
+
- lib/petra/modules/invoice.rb
|
63
|
+
- lib/petra/modules/page.rb
|
64
|
+
- lib/petra/modules/transaction.rb
|
65
|
+
- lib/petra/version.rb
|
66
|
+
- petra.gemspec
|
67
|
+
homepage: https://github.com/PetraHQ/petra_ruby
|
68
|
+
licenses:
|
69
|
+
- MIT
|
70
|
+
metadata:
|
71
|
+
homepage_uri: https://github.com/PetraHQ/petra_ruby
|
72
|
+
source_code_uri: https://github.com/PetraHQ/petra_ruby
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options: []
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
requirements: []
|
88
|
+
rubygems_version: 3.0.3
|
89
|
+
signing_key:
|
90
|
+
specification_version: 4
|
91
|
+
summary: Petra Africa Ruby/Rails Gem.
|
92
|
+
test_files: []
|