payhere-sdk 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3c2da7cafb60413230a7d7135758eb5c1d96a5f469fe79e943e577346297289f
4
+ data.tar.gz: 444026bef1620c5f79b5f8f2ba2d1b894ccca2b85b9e40356bbd3d9a4162778d
5
+ SHA512:
6
+ metadata.gz: 849f2576def9a7a470aa7a1a38d1e1cbcacd7721a75d7c85962d96cb592c036e5fb3342b69e02ca01e04a2a141a03e4a1bb4883bf8fff93d94cf6fb1f7253e62
7
+ data.tar.gz: c6144e7ed456b3b743870791697935425fdeccef5b04dbd37e32a9e3ec0f0830cc99bc46f0d72a1b12f1add4f82b7fa2428d7dea20f5b94131aef4d18cefc7fb
@@ -0,0 +1 @@
1
+ repo_token: 788j9999999
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/cassettes/
9
+ /tmp/
10
+ Gemfile.lock
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,18 @@
1
+ Documentation:
2
+ Enabled: false
3
+ Naming/FileName:
4
+ Enabled: false
5
+ Metrics/MethodLength:
6
+ Max: 25
7
+ Metrics/BlockLength:
8
+ Max: 35
9
+ Metrics/ParameterLists:
10
+ Max: 8
11
+ Lint/DuplicateMethods:
12
+ Enabled: false
13
+ Naming/AccessorMethodName:
14
+ Enabled: false
15
+ Naming/PredicateName:
16
+ Enabled: false
17
+ Style/AsciiComments:
18
+ Enabled: false
@@ -0,0 +1,10 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.3
7
+ before_install: gem install bundler -v 2.0.2
8
+ git:
9
+ depth: 25
10
+ quiet: true
@@ -0,0 +1,128 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, religion, or sexual identity
11
+ and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the
27
+ overall community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or
32
+ advances of any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email
36
+ address, without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at `acellam.guy@gmail.com`
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in payhere-sdk.gemspec
6
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Riley Digital Services
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.
@@ -0,0 +1,122 @@
1
+ # Payhere API Ruby Gem
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/payhere-sdk.svg)](https://badge.fury.io/rb/payhere-sdk)
4
+ [![Build Status](https://travis-ci.org/rileydigitalservices/payhere-sdk.svg?branch=master)](https://travis-ci.org/rileydigitalservices/payhere-sdk)
5
+ [![Coverage Status](https://coveralls.io/repos/github/rileydigitalservices/payhere-sdk/badge.svg?branch=master)](https://coveralls.io/github/rileydigitalservices/payhere-sdk?branch=master)
6
+ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)
7
+ [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/payhere-api-sdk/)
8
+
9
+ ## Usage
10
+
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'payhere-sdk'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ $ bundle install
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install payhere-sdk
26
+
27
+ ## Using credentials
28
+ Add the following configurations in an initializer file (for example, `config/initializers/payhere-sdk.rb` in a Rails app):
29
+
30
+ ```
31
+ Payhere.configure do |config|
32
+ config.version = 'Payhere API version you plan to use'
33
+ config.envrionment = 'Specify if your testing the API or you are ready to do business'
34
+ config.app_id = 'Payhere application id'
35
+ config.username = 'Payhere username'
36
+ config.password = 'Payhere password'
37
+ end
38
+ ```
39
+
40
+ ## Inpayments
41
+ Used to create an instance of inpayment
42
+
43
+
44
+ You can create an inpayment client with the following:
45
+
46
+ ```ruby
47
+ require 'payhere-sdk'
48
+
49
+ inpayment = Payhere::Inpayments.new
50
+ ```
51
+
52
+ ### Methods
53
+ 1. `request_to_pay`: This operation is used to request a payment from a Payer. The payer will be asked to authorize the payment. The transaction is executed once the payer has authorized the payment. The transaction will be in status PENDING until it is authorized or declined by the payer or it is timed out by the system. The status of the transaction can be validated by using `get_transaction_status`.
54
+
55
+ 2. `get_transaction_status`: Retrieve transaction information using the `transaction_reference` returned by `request_to_pay`. You can invoke it at intervals until the transaction fails or succeeds. If the transaction has failed, it will throw an appropriate error.
56
+
57
+ ## Outpayments
58
+ Used to create an instance of outpayment
59
+
60
+ You can create an outpayment client with the following:
61
+
62
+ ```ruby
63
+ require 'payhere-sdk'
64
+
65
+ outpayment = Payhere::Outpayments.new
66
+ ```
67
+
68
+ ### Methods
69
+ 1. `transfer`: Used to transfer an amount from the owner’s account to a payee account. The status of the transaction can be validated by using the `get_transaction_status` method.
70
+
71
+ 2. `get_transaction_status`: Retrieve transaction information using the `transaction_reference` returned by `transfer`. You can invoke it at intervals until the transaction fails or succeeds. If the transaction has failed, it will throw an appropriate error.
72
+
73
+ ## Sample Code
74
+
75
+ ```ruby
76
+ require 'payhere-sdk'
77
+
78
+ inpayment = Payhere::Inpayment.new
79
+
80
+ transaction = inpayment.request_to_pay(
81
+ phone_number="256772123456", amount=600,
82
+ procession_number="123456789", narration="dd")
83
+
84
+ transaction_ref = transaction[:transaction_reference]
85
+
86
+ inpayment.get_transaction_status(transaction_ref)
87
+
88
+ ```
89
+
90
+ ### Points to note:
91
+ All methods for Outpayments follow the same format as the examples shown above for Inpayments
92
+
93
+ The 'transfer' method for Outpayemts follows the same format as 'request_to_pay' above.
94
+
95
+ ## Additional documentation
96
+ For additional documentation, please refer to this link: https://apidocs.payhere.africa
97
+
98
+ ## Contributing
99
+ Bug reports and pull requests are welcome on GitHub at https://github.com/rileydigitalservices/payhere-ruby-sdk. 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.
100
+
101
+ ## Development
102
+
103
+ Install the gems using bundler
104
+
105
+ ```bash
106
+ bundle install
107
+ ```
108
+
109
+ Run the the unit tests:
110
+
111
+ ```bash
112
+ rspec
113
+ ```
114
+
115
+
116
+ ## License
117
+
118
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
119
+
120
+ ## Code of Conduct
121
+
122
+ Everyone interacting in the Payhere::Ruby project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rileydigitalservices/payhere-ruby-sdk/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'payhere-sdk'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ IRB.start(__FILE__)
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'payhere-sdk'
6
+ require 'optparse'
7
+ require_relative '../lib/payhere-sdk/cli'
8
+
9
+ options = {}
10
+ OptionParser.new do |opts|
11
+ opts.banner = 'Usage: Payhere --host host --key key'
12
+
13
+ opts.on('-h', '--host=HOST', String,
14
+ 'Provider callback host') do |v|
15
+ options[:host] = v
16
+ end
17
+
18
+ opts.on('-k', '--key=KEY', String,
19
+ 'Subscription key') do |v|
20
+ options[:key] = v
21
+ end
22
+ end.parse!
23
+
24
+ Payhere::CLI.new(options)
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'payhere-sdk/config'
4
+ require 'payhere-sdk/version'
5
+ require 'payhere-sdk/inpayments'
6
+ require 'payhere-sdk/outpayments'
7
+
8
+ module Payhere
9
+ class << self
10
+ attr_accessor :config
11
+ end
12
+
13
+ def self.config
14
+ @config ||= Config.new
15
+ end
16
+
17
+ def self.reset
18
+ @config = Config.new
19
+ end
20
+
21
+ def self.configure
22
+ yield(config)
23
+ end
24
+ end
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Base implementation of the Payhere API client
4
+
5
+ # Includes methods common to inpayments, outpayments
6
+
7
+ require 'faraday'
8
+
9
+ require 'payhere-sdk/config'
10
+ require 'payhere-sdk/errors'
11
+
12
+ module Payhere
13
+ class Client
14
+ def send_request(method, path, body = {})
15
+ begin
16
+ conn = create_connection
17
+ relative_path = "/api/#{Payhere.config.version}#{path}"
18
+
19
+ case method
20
+ when 'get'
21
+ response = conn.get(relative_path)
22
+ when 'post'
23
+ response = conn.post(relative_path, body.to_json)
24
+ end
25
+ rescue ArgumentError
26
+ raise "Missing configuration key(s)"
27
+ end
28
+ interpret_response(response)
29
+ end
30
+
31
+ def interpret_response(resp)
32
+ body = resp.body.empty? ? '' : JSON.parse(resp.body)
33
+
34
+ response = {
35
+ body: body,
36
+ code: resp.status
37
+ }
38
+ unless resp.status >= 200 && resp.status < 300
39
+ handle_error(response[:body], response[:code])
40
+ end
41
+
42
+ body
43
+ end
44
+
45
+ def handle_error(response_body, response_code)
46
+ raise Payhere::Error.new(response_body, response_code)
47
+ end
48
+
49
+ # set authorization and authentication
50
+ def create_connection
51
+ url = "https://api.payhere.africa" if Payhere.config.environment.eql?"production"
52
+ url = "https://api-sandbox.payhere.africa/api" if Payhere.config.environment.eql?"sandbox"
53
+
54
+ headers = {
55
+ "Content-Type": 'application/json'
56
+ }
57
+
58
+ conn = Faraday.new(url: url)
59
+ conn.headers = headers
60
+
61
+ get_credentials
62
+ conn.basic_auth(@username, @password)
63
+
64
+ conn
65
+ end
66
+
67
+ def get_credentials
68
+ @username = Payhere.config.username
69
+ @password = Payhere.config.password
70
+ end
71
+
72
+ # retrieve transaction information
73
+ def get_transaction_status(path)
74
+ send_request('get', path)
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Configurations are set up in this file
4
+ # for a user's Payhere API user credentials
5
+
6
+ module Payhere
7
+ class Config
8
+ attr_accessor :environment, :version, :app_id,
9
+ :username, :password, :version
10
+
11
+ def initialize
12
+ @environment = nil
13
+ @version = nil
14
+ @app_id = nil
15
+ @username = nil
16
+ @password = nil
17
+ end
18
+
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Error handling for unsuccessful responses from Payhere API
4
+
5
+ module Payhere
6
+ class Error < StandardError
7
+ def initialize(message, code)
8
+ @code = code
9
+ super("Error code #{code} #{message}")
10
+ end
11
+ end
12
+
13
+ class ValidationError < StandardError
14
+ def initialize(msg = message)
15
+ super(msg)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Implementation of the Payhere API inpayments client
4
+
5
+ require 'securerandom'
6
+
7
+ require 'payhere-sdk/config'
8
+ require 'payhere-sdk/client'
9
+ require 'payhere-sdk/validate'
10
+
11
+ module Payhere
12
+ class Inpayments < Client
13
+ def get_transaction_status(transaction_id)
14
+ path = "/inpayments/#{transaction_id}"
15
+ super(path)
16
+ end
17
+
18
+ # This method is used to request a payment from a Payer
19
+ # The payer will be asked to authorize the payment. The transaction will
20
+ # be executed once the payer has authorized the payment.
21
+ # The requesttopay will be in status PENDING until the transaction
22
+ # is authorized or declined by the payer or it is timed out by the system.
23
+ # The status of the transaction can be validated
24
+ # by using `get_transation_status`
25
+ def request_to_pay(phone_number, amount, processing_number = '', narration = '')
26
+ Payhere::Validate.new.validate(phone_number, amount)
27
+ processing_number = SecureRandom.uuid unless processing_number.blank?
28
+
29
+ body = {
30
+ "msisdn": phone_number,
31
+ "narration": narration,
32
+ "processingNumber": processing_number,
33
+ "amount": amount.to_i
34
+ }
35
+ path = '/inpayments'
36
+ send_request('post', path, body)
37
+ { transaction_reference: uuid }
38
+ end
39
+
40
+ end
41
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Implementation of Payhere API outpayments client
4
+
5
+ require 'payhere-sdk/config'
6
+ require 'payhere-sdk/client'
7
+
8
+ module Payhere
9
+ class Outpayments < Client
10
+ def get_transaction_status(transaction_id)
11
+ path = "/outpayments/#{transaction_id}"
12
+ super(path)
13
+ end
14
+
15
+ # The transfer operation is used to transfer an amount from the payer's
16
+ # account to a payee account.
17
+ # The status of the transaction can be validated
18
+ # by using `get_transation_status`
19
+ def transfer(phone_number, amount, processing_number = '', narration = '')
20
+ Payhere::Validate.new.validate(phone_number, amount)
21
+ processing_number = SecureRandom.uuid unless processing_number.blank?
22
+
23
+ body = {
24
+ "msisdn": phone_number,
25
+ "narration": narration,
26
+ "processingNumber": processing_number,
27
+ "amount": amount.to_i
28
+ }
29
+ path = '/outpayments'
30
+
31
+ send_request('post', path, body)
32
+ { processing_number: processing_number }
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Validations for parameters passed into client methods
4
+
5
+ require 'payhere-sdk/errors'
6
+
7
+ module Payhere
8
+ class Validate
9
+ def validate(phone_number, amount)
10
+ validate_string?(phone_number, 'Phone number')
11
+ validate_numeric?(amount, 'Amount')
12
+ end
13
+
14
+ def validate_numeric?(num, field)
15
+ return true if num.is_a? Numeric
16
+
17
+ raise Payhere::ValidationError, "#{field} should be a number"
18
+ end
19
+
20
+ def validate_string?(str, field)
21
+ return true if str.is_a? String
22
+
23
+ raise Payhere::ValidationError, "#{field} should be a string"
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payhere
4
+ VERSION = '1.0.0'
5
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'payhere-sdk/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'payhere-sdk'
9
+ spec.version = Payhere::VERSION
10
+ spec.authors = ['Acellam Guy']
11
+ spec.email = ['acellam.guy@gmail.com']
12
+ spec.summary = 'Riley Digital Services Payhere gem'
13
+ spec.description = 'Riley Digital Services Payhere API Client for Ruby'
14
+ spec.license = 'MIT'
15
+
16
+ # Specify which files should be added to the gem when it is released.
17
+ # The `git ls-files -z` loads the files in the
18
+ # RubyGem that have been added into git.
19
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
20
+ `git ls-files -z`.split("\x0")
21
+ .reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ end
23
+ spec.bindir = 'bin'
24
+ spec.executables = 'payhere-sdk'
25
+ spec.require_paths = ['lib']
26
+ spec.required_ruby_version = '>= 2.3'
27
+
28
+ spec.add_dependency 'faraday', '~> 1.0'
29
+ spec.add_development_dependency 'bundler', '1.17.3'
30
+ spec.add_development_dependency 'coveralls', '~> 0.8.15'
31
+ spec.add_development_dependency 'pry', '~> 0.12'
32
+ spec.add_development_dependency 'rake', '~> 13.0'
33
+ spec.add_development_dependency 'rspec', '~> 3.0'
34
+ spec.add_development_dependency 'vcr', '~> 5.1'
35
+ spec.add_development_dependency 'webmock', '~> 2.1'
36
+ end
metadata ADDED
@@ -0,0 +1,178 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: payhere-sdk
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Acellam Guy
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-07-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 1.17.3
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 1.17.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: coveralls
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.8.15
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.8.15
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.12'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.12'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '13.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '13.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: vcr
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '5.1'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '5.1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: webmock
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.1'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.1'
125
+ description: Riley Digital Services Payhere API Client for Ruby
126
+ email:
127
+ - acellam.guy@gmail.com
128
+ executables:
129
+ - payhere-sdk
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - ".coveralls.yml"
134
+ - ".gitignore"
135
+ - ".rspec"
136
+ - ".rubocop.yml"
137
+ - ".travis.yml"
138
+ - CODE_OF_CONDUCT.md
139
+ - Gemfile
140
+ - LICENSE.txt
141
+ - README.md
142
+ - Rakefile
143
+ - bin/console
144
+ - bin/payhere-sdk
145
+ - bin/setup
146
+ - lib/payhere-sdk.rb
147
+ - lib/payhere-sdk/client.rb
148
+ - lib/payhere-sdk/config.rb
149
+ - lib/payhere-sdk/errors.rb
150
+ - lib/payhere-sdk/inpayments.rb
151
+ - lib/payhere-sdk/outpayments.rb
152
+ - lib/payhere-sdk/validate.rb
153
+ - lib/payhere-sdk/version.rb
154
+ - payhere-sdk.gemspec
155
+ homepage:
156
+ licenses:
157
+ - MIT
158
+ metadata: {}
159
+ post_install_message:
160
+ rdoc_options: []
161
+ require_paths:
162
+ - lib
163
+ required_ruby_version: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '2.3'
168
+ required_rubygems_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ requirements: []
174
+ rubygems_version: 3.0.6
175
+ signing_key:
176
+ specification_version: 4
177
+ summary: Riley Digital Services Payhere gem
178
+ test_files: []