propay_client 0.1.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: ead245ef93985c246dce17b84397971f9578f231b4ba39ef0de8dc554f756fb6
4
+ data.tar.gz: bc26c4e6e2f60e28e0febebc8f01e61df5a5bed4cbafe59207f7eacbb1cbabd7
5
+ SHA512:
6
+ metadata.gz: 793472fcd86a37e91f616105579e2563304a7ba99fd822a8a0be0fc10fcfed436be1113779a2dfb88fe3a4f1bda643f81004ea6ccb669ebf55af32f4f6157d6f
7
+ data.tar.gz: 3c8bee500f1121241a485e03567785ad3c9045656186c30fc676e81cd7526373fec356c84a05b60b3d284715cb3ae3a6d3fe83efb2e14720b641e0cee482a033
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ .development.env
14
+ .test.env
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.7.1
6
+ before_install: gem install bundler -v 2.1.4
@@ -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 rozenkin@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 [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in propay_client.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
8
+ gem "excon", "~> 0.75.0"
9
+ gem "factory_bot"
10
+ gem "dotenv-rails", groups: [:development, :test]
11
+ gem "vcr", "~> 6.0", groups: [:development, :test]
@@ -0,0 +1,98 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ propay_client (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actionpack (6.0.3.2)
10
+ actionview (= 6.0.3.2)
11
+ activesupport (= 6.0.3.2)
12
+ rack (~> 2.0, >= 2.0.8)
13
+ rack-test (>= 0.6.3)
14
+ rails-dom-testing (~> 2.0)
15
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
16
+ actionview (6.0.3.2)
17
+ activesupport (= 6.0.3.2)
18
+ builder (~> 3.1)
19
+ erubi (~> 1.4)
20
+ rails-dom-testing (~> 2.0)
21
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
22
+ activesupport (6.0.3.2)
23
+ concurrent-ruby (~> 1.0, >= 1.0.2)
24
+ i18n (>= 0.7, < 2)
25
+ minitest (~> 5.1)
26
+ tzinfo (~> 1.1)
27
+ zeitwerk (~> 2.2, >= 2.2.2)
28
+ builder (3.2.4)
29
+ concurrent-ruby (1.1.6)
30
+ crass (1.0.6)
31
+ diff-lcs (1.4.4)
32
+ dotenv (2.7.6)
33
+ dotenv-rails (2.7.6)
34
+ dotenv (= 2.7.6)
35
+ railties (>= 3.2)
36
+ erubi (1.9.0)
37
+ excon (0.75.0)
38
+ factory_bot (6.1.0)
39
+ activesupport (>= 5.0.0)
40
+ i18n (1.8.3)
41
+ concurrent-ruby (~> 1.0)
42
+ loofah (2.6.0)
43
+ crass (~> 1.0.2)
44
+ nokogiri (>= 1.5.9)
45
+ method_source (1.0.0)
46
+ mini_portile2 (2.4.0)
47
+ minitest (5.14.1)
48
+ nokogiri (1.10.10)
49
+ mini_portile2 (~> 2.4.0)
50
+ rack (2.2.3)
51
+ rack-test (1.1.0)
52
+ rack (>= 1.0, < 3)
53
+ rails-dom-testing (2.0.3)
54
+ activesupport (>= 4.2.0)
55
+ nokogiri (>= 1.6)
56
+ rails-html-sanitizer (1.3.0)
57
+ loofah (~> 2.3)
58
+ railties (6.0.3.2)
59
+ actionpack (= 6.0.3.2)
60
+ activesupport (= 6.0.3.2)
61
+ method_source
62
+ rake (>= 0.8.7)
63
+ thor (>= 0.20.3, < 2.0)
64
+ rake (12.3.3)
65
+ rspec (3.9.0)
66
+ rspec-core (~> 3.9.0)
67
+ rspec-expectations (~> 3.9.0)
68
+ rspec-mocks (~> 3.9.0)
69
+ rspec-core (3.9.2)
70
+ rspec-support (~> 3.9.3)
71
+ rspec-expectations (3.9.2)
72
+ diff-lcs (>= 1.2.0, < 2.0)
73
+ rspec-support (~> 3.9.0)
74
+ rspec-mocks (3.9.1)
75
+ diff-lcs (>= 1.2.0, < 2.0)
76
+ rspec-support (~> 3.9.0)
77
+ rspec-support (3.9.3)
78
+ thor (1.0.1)
79
+ thread_safe (0.3.6)
80
+ tzinfo (1.2.7)
81
+ thread_safe (~> 0.1)
82
+ vcr (6.0.0)
83
+ zeitwerk (2.4.0)
84
+
85
+ PLATFORMS
86
+ ruby
87
+
88
+ DEPENDENCIES
89
+ dotenv-rails
90
+ excon (~> 0.75.0)
91
+ factory_bot
92
+ propay_client!
93
+ rake (~> 12.0)
94
+ rspec (~> 3.0)
95
+ vcr (~> 6.0)
96
+
97
+ BUNDLED WITH
98
+ 2.1.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Denis Rozenkin
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,80 @@
1
+ # PropayClient
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/propay_client`. 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 'propay_client'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install propay_client
22
+
23
+ ## Usage
24
+
25
+ ```
26
+ # config/initializers/propay_client.rb
27
+
28
+ require 'propay_client'
29
+
30
+ PropayClient.configure do |config|
31
+ config.api_key = ENV['API_KEY']
32
+ config.endpoint = ENV['ENDPOINT']
33
+ end
34
+ ```
35
+
36
+ ### API Authorization.
37
+ You will need to get personal certificate. Convert this to token and use for API requests.
38
+ [Documentation](https://www.propay.com/en-US/Documents/API-Docs/ProtectPay-API-Manual-REST "ProtectPay-API-Manual-REST")
39
+
40
+ ```
41
+ The REST interface uses Basic HTTP Authentication for API requests, with the CertStr as the username and the TermId as the password. This must be added to the HTTP header as the value of the ‘Authorization’ field. Creating the Authorization Header value requires the following steps:
42
+ 1. Combine the CertStr, a Colon, and the termId (MyCertStr:MyTermId). If a termId has not been provided only use the CertStr without a colon
43
+ (MyCertStr).
44
+ 2. Convert the Result of Step 1 to an ASCII Byte Array
45
+ 3. Base 64 Encode the Result of Step 2
46
+ 4. Prepend “Basic “ to the Result of Step 3
47
+ 5. Add ‘Authorization’ as an HTTP header and set its value to the result of Step 4
48
+ ```
49
+
50
+ ### API Authentication
51
+ [Documentation](https://www.propay.com/en-US/Documents/API-Docs/ProtectPay-API-Manual-REST "ProtectPay-API-Manual-REST")
52
+
53
+ ```
54
+ The REST interface uses Basic HTTP Authentication to authenticate API requests using the BillerId as the username and the Authentication Token as the password. This must be added to the HTTP header as the value of the ‘Authorization’ field.
55
+ Creating the Authorization Header value requires the following steps:
56
+ 1. Combine the BillerID, a Colon, and the AuthToken (MyBillerId:MyAuthToken)
57
+ 2. Convert the Result of Step 1 to an ASCII Byte Array
58
+ 3. Base 64 Encode the Result of Step 2
59
+ 4. Prepend “Basic “ to the Result of Step 3
60
+ 5. Add ‘Authorization’ as an HTTP header and set its value to the result of Step 4
61
+ ```
62
+
63
+ ## Development
64
+
65
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
66
+
67
+ 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).
68
+
69
+ ## Contributing
70
+
71
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/propay_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/propay_client/blob/master/CODE_OF_CONDUCT.md).
72
+
73
+
74
+ ## License
75
+
76
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
77
+
78
+ ## Code of Conduct
79
+
80
+ Everyone interacting in the PropayClient project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/propay_client/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "propay_client"
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__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://xmltestapi.propay.com/propayapi/signup
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Authorization:
13
+ - Basic <API_KEY>
14
+ response:
15
+ status:
16
+ code: 400
17
+ message:
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Type:
22
+ - text/html
23
+ Server:
24
+ - Microsoft-IIS/10.0
25
+ Set-Cookie:
26
+ - ASP.NET_SessionId=rsvompj1c3kpyldhhdsefmnw; path=/; HttpOnly
27
+ X-AspNet-Version:
28
+ - 4.0.30319
29
+ X-Powered-By:
30
+ - ASP.NET
31
+ Date:
32
+ - Wed, 15 Jul 2020 16:35:38 GMT
33
+ Content-Length:
34
+ - '4529'
35
+ body:
36
+ encoding: ASCII-8BIT
37
+ string: !binary |-
38
+ 77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4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lcnZpY2VNb2RlbC5EaXNwYXRjaGVyLkRpc3BhdGNoT3BlcmF0aW9uUnVudGltZS5EZXNlcmlhbGl6ZUlucHV0cyhNZXNzYWdlUnBjJmFtcDsgcnBjKQ0KICAgYXQgU3lzdGVtLlNlcnZpY2VNb2RlbC5EaXNwYXRjaGVyLkRpc3BhdGNoT3BlcmF0aW9uUnVudGltZS5JbnZva2VCZWdpbihNZXNzYWdlUnBjJmFtcDsgcnBjKQ0KICAgYXQgU3lzdGVtLlNlcnZpY2VNb2RlbC5EaXNwYXRjaGVyLkltbXV0YWJsZURpc3BhdGNoUnVudGltZS5Qcm9jZXNzTWVzc2FnZTUoTWVzc2FnZVJwYyZhbXA7IHJwYykNCiAgIGF0IFN5c3RlbS5TZXJ2aWNlTW9kZWwuRGlzcGF0Y2hlci5JbW11dGFibGVEaXNwYXRjaFJ1bnRpbWUuUHJvY2Vzc01lc3NhZ2UxMShNZXNzYWdlUnBjJmFtcDsgcnBjKQ0KICAgYXQgU3lzdGVtLlNlcnZpY2VNb2RlbC5EaXNwYXRjaGVyLk1lc3NhZ2VScGMuUHJvY2VzcyhCb29sZWFuIGlzT3BlcmF0aW9uQ29udGV4dFNldCk8L3A+DQogICAgPC9kaXY+DQogIDwvYm9keT4NCjwvaHRtbD4=
39
+ recorded_at: Wed, 15 Jul 2020 16:35:38 GMT
40
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,44 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://xmltestapi.propay.com/propayapi/signup
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"PersonalData":{"FirstName":"First","MiddleInitial":"X","LastName":"Last","DateOfBirth":"01-01-1981","SocialSecurityNumber":"123456789","SourceEmail":"ProPaytest@test.com","NotificationEmail":"Partner@Partner.com","PhoneInformation":{"DayPhone":"8888888888","EveningPhone":"8888888888"}},"SignupAccountData":{"CurrencyCode":"USD","Tier":"Test"},"BusinessData":{"BusinessLegalName":"Merchantile
9
+ Parent, Inc.","DoingBusinessAs":"Merchantile ABC","EIN":"121232343","MerchantCategoryCode":"5999","WebsiteURL":"http://Propay.com","BusinessDescription":"Accounting
10
+ Services","MonthlyBankCardVolume":10000,"AverageTicket":100,"HighestTicket":250},"Address":{"ApartmentNumber":"1","Address1":"3400
11
+ N Ashton Blvd","Address2":"Suite 200","City":"Lehi","State":"UT","Country":"USA","Zip":"84043"},"BusinessAddress":{"ApartmentNumber":"200","Address1":"RR
12
+ 123445","Address2":"SW","City":"Tooele","State":"UT","Country":"USA","Zip":"84074"},"BankAccount":{"AccountCountryCode":"USA","BankAccountNumber":"123456789","RoutingNumber":"011306829","AccountOwnershipType":"Business","BankName":"MERCHANTILE
13
+ BANK UT","AccountType":"Checking","AccountName":null,"Description":null},"BeneficialOwnerData":{"OwnerCount":"1","Owners":[{"FirstName":"First1","LastName":"Last1","SSN":"123456789","DateOfBirth":"01-01-1981","Email":"test1@qamail.com","Address":"Address","City":"Lehi","State":"UT","Zip":"84010","Country":"USA","Title":"CEO","Percentage":"100"}]}}'
14
+ headers:
15
+ Content-Type:
16
+ - application/json
17
+ Authorization:
18
+ - Basic <API_KEY>
19
+ response:
20
+ status:
21
+ code: 200
22
+ message:
23
+ headers:
24
+ Cache-Control:
25
+ - private
26
+ Content-Type:
27
+ - application/json; charset=utf-8
28
+ Server:
29
+ - Microsoft-IIS/10.0
30
+ Set-Cookie:
31
+ - ASP.NET_SessionId=yenumsz1kcrnyf5z4bobiuj0; path=/; HttpOnly
32
+ X-AspNet-Version:
33
+ - 4.0.30319
34
+ X-Powered-By:
35
+ - ASP.NET
36
+ Date:
37
+ - Wed, 15 Jul 2020 16:33:22 GMT
38
+ Content-Length:
39
+ - '111'
40
+ body:
41
+ encoding: ASCII-8BIT
42
+ string: '{"AccountNumber":123456,"BeneficialOwnerDataResult":[{"FirstName":"First1","LastName":"Last1","Status":"Validated"}],"Password":"TempPassw0rd","SourceEmail":"ProPaytest@test.com","Status":"00","Tier":"Test"}'
43
+ recorded_at: Wed, 15 Jul 2020 16:33:22 GMT
44
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,19 @@
1
+ require 'propay_client/configuration'
2
+ require 'propay_client/api'
3
+ require 'propay_client/version'
4
+
5
+ module PropayClient
6
+ class << self
7
+ attr_accessor :configuration, :initialized
8
+ end
9
+
10
+ def self.configuration
11
+ raise "You need to configure PropayClient first!" unless @initialized
12
+ @configuration ||= Configuration.new
13
+ end
14
+
15
+ def self.configure
16
+ @initialized = true
17
+ yield(configuration)
18
+ end
19
+ end
@@ -0,0 +1,4 @@
1
+ require "propay_client/api/merchant"
2
+
3
+ module PropayClient::API
4
+ end
@@ -0,0 +1,14 @@
1
+ module PropayClient::API
2
+ class Merchant
3
+ # build(:propay_account_request_data)
4
+ def self.create(params)
5
+ headers = {
6
+ 'Content-Type'=> 'application/json',
7
+ 'Authorization' => "Basic #{PropayClient.configuration.api_key}"
8
+ }
9
+ response = Excon.put("#{PropayClient.configuration.endpoint}/propayapi/signup", body: params.to_json, headers: headers)
10
+ return JSON.parse(response.body) if response.status == 200
11
+ response.body
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ module PropayClient
2
+ class Configuration
3
+ attr_accessor :endpoint, :api_key
4
+
5
+ def initialize
6
+ @endpoint = nil
7
+ @api_key = nil
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ module PropayClient
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,27 @@
1
+ require_relative 'lib/propay_client/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "propay_client"
5
+ spec.version = PropayClient::VERSION
6
+ spec.authors = ["Denis Rozenkin"]
7
+ spec.email = ["rozenkin@gmail.com"]
8
+
9
+ spec.summary = %q{This is a gem wrapper for ProPay API}
10
+ spec.description = %q{There is no another API gems, so I decided to create one}
11
+ spec.homepage = "https://github.com/nikneroz/propay_client"
12
+ spec.license = "MIT"
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
+
15
+ spec.metadata["homepage_uri"] = spec.homepage
16
+ spec.metadata["source_code_uri"] = "https://github.com/nikneroz/propay_client"
17
+ spec.metadata["changelog_uri"] = "https://github.com/nikneroz/propay_client/blob/master/CHANGELOG.md"
18
+
19
+ # Specify which files should be added to the gem when it is released.
20
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
+ end
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ["lib"]
27
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: propay_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Denis Rozenkin
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-07-15 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: There is no another API gems, so I decided to create one
14
+ email:
15
+ - rozenkin@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".gitignore"
21
+ - ".rspec"
22
+ - ".travis.yml"
23
+ - CODE_OF_CONDUCT.md
24
+ - Gemfile
25
+ - Gemfile.lock
26
+ - LICENSE.txt
27
+ - README.md
28
+ - Rakefile
29
+ - bin/console
30
+ - bin/setup
31
+ - fixtures/vcr_cassettes/create_merchant_failure.yml
32
+ - fixtures/vcr_cassettes/create_merchant_success.yml
33
+ - lib/propay_client.rb
34
+ - lib/propay_client/api.rb
35
+ - lib/propay_client/api/merchant.rb
36
+ - lib/propay_client/configuration.rb
37
+ - lib/propay_client/version.rb
38
+ - propay_client.gemspec
39
+ homepage: https://github.com/nikneroz/propay_client
40
+ licenses:
41
+ - MIT
42
+ metadata:
43
+ homepage_uri: https://github.com/nikneroz/propay_client
44
+ source_code_uri: https://github.com/nikneroz/propay_client
45
+ changelog_uri: https://github.com/nikneroz/propay_client/blob/master/CHANGELOG.md
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 2.3.0
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubygems_version: 3.1.2
62
+ signing_key:
63
+ specification_version: 4
64
+ summary: This is a gem wrapper for ProPay API
65
+ test_files: []