monopay-ruby 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/.rspec +3 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +81 -0
- data/LICENSE.txt +21 -0
- data/README.md +99 -0
- data/Rakefile +8 -0
- data/lib/monopay-ruby/configuration.rb +7 -0
- data/lib/monopay-ruby/invoices/simple_invoice.rb +81 -0
- data/lib/monopay-ruby/version.rb +5 -0
- data/lib/monopay-ruby/webhooks/public_key.rb +42 -0
- data/lib/monopay-ruby/webhooks/validator.rb +80 -0
- data/lib/monopay-ruby.rb +30 -0
- data/monopay-ruby.gemspec +49 -0
- data/sig/monopay_ruby.rbs +4 -0
- metadata +182 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 41fd7749af56a446e34fc1062984cc1c08800180128cf24d839d27a7ba5d23a2
|
4
|
+
data.tar.gz: feae13953aa57ed285104d43d952498f56a5fed2a7038446d132ab02d00dd31b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3ea0a349f488c37fb62678f781d5190b5be574a4c243e328c19687ac54a2fa83041c807846b35784e9426a18a1ab9b0e76b5bf6590f420e318246e7dade5c3c8
|
7
|
+
data.tar.gz: 2f7f47cd045e28f826b03347490d5c0d1fbe042ec28916a0cb4c1c9292e3ed1963aeb0a29bc1e76a72d8fb5e2c1b1c33bec12b68e65d887907b680cabf7ccfb7
|
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.2.2
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
monopay-ruby (0.1.0)
|
5
|
+
base64 (~> 0.1.1)
|
6
|
+
json (~> 2.5)
|
7
|
+
money (~> 6.13)
|
8
|
+
openssl (~> 2.1)
|
9
|
+
rest-client (~> 2.1)
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
base64 (0.1.1)
|
15
|
+
coderay (1.1.3)
|
16
|
+
concurrent-ruby (1.2.2)
|
17
|
+
diff-lcs (1.5.0)
|
18
|
+
docile (1.4.0)
|
19
|
+
domain_name (0.5.20190701)
|
20
|
+
unf (>= 0.0.5, < 1.0.0)
|
21
|
+
http-accept (1.7.0)
|
22
|
+
http-cookie (1.0.5)
|
23
|
+
domain_name (~> 0.5)
|
24
|
+
i18n (1.14.1)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
ipaddr (1.2.5)
|
27
|
+
json (2.6.3)
|
28
|
+
method_source (1.0.0)
|
29
|
+
mime-types (3.4.1)
|
30
|
+
mime-types-data (~> 3.2015)
|
31
|
+
mime-types-data (3.2023.0218.1)
|
32
|
+
money (6.16.0)
|
33
|
+
i18n (>= 0.6.4, <= 2)
|
34
|
+
netrc (0.11.0)
|
35
|
+
openssl (2.2.3)
|
36
|
+
ipaddr
|
37
|
+
pry (0.14.2)
|
38
|
+
coderay (~> 1.1)
|
39
|
+
method_source (~> 1.0)
|
40
|
+
rake (13.0.6)
|
41
|
+
rest-client (2.1.0)
|
42
|
+
http-accept (>= 1.7.0, < 2.0)
|
43
|
+
http-cookie (>= 1.0.2, < 2.0)
|
44
|
+
mime-types (>= 1.16, < 4.0)
|
45
|
+
netrc (~> 0.8)
|
46
|
+
rspec (3.12.0)
|
47
|
+
rspec-core (~> 3.12.0)
|
48
|
+
rspec-expectations (~> 3.12.0)
|
49
|
+
rspec-mocks (~> 3.12.0)
|
50
|
+
rspec-core (3.12.2)
|
51
|
+
rspec-support (~> 3.12.0)
|
52
|
+
rspec-expectations (3.12.3)
|
53
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
+
rspec-support (~> 3.12.0)
|
55
|
+
rspec-mocks (3.12.5)
|
56
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
+
rspec-support (~> 3.12.0)
|
58
|
+
rspec-support (3.12.0)
|
59
|
+
simplecov (0.22.0)
|
60
|
+
docile (~> 1.1)
|
61
|
+
simplecov-html (~> 0.11)
|
62
|
+
simplecov_json_formatter (~> 0.1)
|
63
|
+
simplecov-html (0.12.3)
|
64
|
+
simplecov_json_formatter (0.1.4)
|
65
|
+
unf (0.1.4)
|
66
|
+
unf_ext
|
67
|
+
unf_ext (0.0.8.2)
|
68
|
+
|
69
|
+
PLATFORMS
|
70
|
+
arm64-darwin-21
|
71
|
+
x86_64-linux
|
72
|
+
|
73
|
+
DEPENDENCIES
|
74
|
+
monopay-ruby!
|
75
|
+
pry (~> 0.14.2)
|
76
|
+
rake (~> 13.0)
|
77
|
+
rspec (~> 3.0)
|
78
|
+
simplecov (~> 0.22.0)
|
79
|
+
|
80
|
+
BUNDLED WITH
|
81
|
+
2.4.13
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2023 loqimean
|
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,99 @@
|
|
1
|
+
# MonopayRuby
|
2
|
+
|
3
|
+
The "monopay-ruby" gem simplifies Monobank payment integration in Ruby and Rails applications. It provides an intuitive interface and essential functionalities for generating payment requests, verifying transactions, handling callbacks, and ensuring data integrity. With this gem, you can quickly and securely implement Monobank payments, saving development time and delivering a seamless payment experience to your users.
|
4
|
+
|
5
|
+
This gem was developed for Monobank API [https://api.monobank.ua/docs/acquiring.html](https://api.monobank.ua/docs/acquiring.html)
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Install the gem and add to the application's Gemfile by executing:
|
10
|
+
|
11
|
+
```bash
|
12
|
+
bundle add "monopay-ruby"
|
13
|
+
```
|
14
|
+
|
15
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
gem install "monopay-ruby"
|
19
|
+
```
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Add API token. There are two ways:
|
24
|
+
First - add to the initializer file:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
# config/initializers/monopay-ruby.rb
|
28
|
+
MonopayRuby.configure do |config|
|
29
|
+
config.api_token = "your_api_token"
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
The second one - add to the environment variable:
|
34
|
+
|
35
|
+
```bash
|
36
|
+
# .env
|
37
|
+
MONOPAY_API_TOKEN=your_api_token
|
38
|
+
```
|
39
|
+
|
40
|
+
You can get the API token depending on the environment:
|
41
|
+
Development: [https://api.monobank.ua/](https://api.monobank.ua/)
|
42
|
+
Production: [https://fop.monobank.ua/](https://fop.monobank.ua/)
|
43
|
+
|
44
|
+
Just get the token and go to earn moneys! 🚀
|
45
|
+
|
46
|
+
### Generate payment request
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
# app/controllers/payments_controller.rb
|
50
|
+
class PaymentsController < ApplicationController
|
51
|
+
def create
|
52
|
+
payment = MonopayRuby::Invoices::SimpleInvoice.new(
|
53
|
+
redirect_url: "https://example.com",
|
54
|
+
webhook_url: "https://example.com/payments/webhook"
|
55
|
+
)
|
56
|
+
|
57
|
+
if payment.create(amount: 100, description: "Payment description",)
|
58
|
+
# your success code processing
|
59
|
+
else
|
60
|
+
# your error code processing
|
61
|
+
# flash[:error] = payment.error_messages
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
### Verify transaction
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
# app/controllers/payments_controller.rb
|
71
|
+
class PaymentsController < ApplicationController
|
72
|
+
skip_before_action :verify_authenticity_token, only: :webhook
|
73
|
+
|
74
|
+
def webhook
|
75
|
+
webhook_validator = MonopayRuby::Webhooks::Validator.new(request)
|
76
|
+
|
77
|
+
if webhook_validator.valid?
|
78
|
+
# your success code processing
|
79
|
+
else
|
80
|
+
# your error code processing
|
81
|
+
# flash[:error] = webhook_validator.error_messages
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
```
|
86
|
+
|
87
|
+
## Development
|
88
|
+
|
89
|
+
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.
|
90
|
+
|
91
|
+
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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
92
|
+
|
93
|
+
## Contributing
|
94
|
+
|
95
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/loqimean/monopay-ruby.
|
96
|
+
|
97
|
+
## License
|
98
|
+
|
99
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
require "bigdecimal"
|
2
|
+
require "money"
|
3
|
+
|
4
|
+
module MonopayRuby
|
5
|
+
module Invoices
|
6
|
+
class SimpleInvoice < MonopayRuby::Base
|
7
|
+
attr_reader :invoice_id, :page_url, :error_messages, :amount, :destination, :redirect_url, :webhook_url
|
8
|
+
|
9
|
+
API_CREATE_INVOICE_URL = "#{API_URL}/merchant/invoice/create".freeze
|
10
|
+
|
11
|
+
CURRENCY = "UAH".freeze
|
12
|
+
|
13
|
+
PAGE_URL_KEY = "pageUrl".freeze
|
14
|
+
INVOICE_ID_KEY = "invoiceId".freeze
|
15
|
+
|
16
|
+
# Initialize SimpleInvoice
|
17
|
+
#
|
18
|
+
# @param [String] redirect_url - url where user will be redirected after payment
|
19
|
+
# @param [String] webhook_url - url where Monobank will send webhook after payment
|
20
|
+
def initialize(redirect_url = nil, webhook_url = nil)
|
21
|
+
@redirect_url = redirect_url
|
22
|
+
@webhook_url = webhook_url
|
23
|
+
|
24
|
+
@error_messages = []
|
25
|
+
end
|
26
|
+
|
27
|
+
# Create invoice
|
28
|
+
#
|
29
|
+
# @param [BigDecimal,Integer] amount in UAH (cents) to request payment
|
30
|
+
# @param [String] destination - additional info about payment
|
31
|
+
# @return [Boolean] true if invoice was created successfully, false otherwise
|
32
|
+
def create(amount, destination = nil)
|
33
|
+
begin
|
34
|
+
@amount = convert_to_cents(amount)
|
35
|
+
@destination = destination
|
36
|
+
|
37
|
+
response = RestClient.post(API_CREATE_INVOICE_URL, request_body, headers)
|
38
|
+
response_body = JSON.parse(response.body)
|
39
|
+
|
40
|
+
@page_url = JSON.parse(response.body)[PAGE_URL_KEY]
|
41
|
+
@invoice_id = JSON.parse(response.body)[INVOICE_ID_KEY]
|
42
|
+
|
43
|
+
true
|
44
|
+
rescue Exception => e
|
45
|
+
response_body = JSON.parse(e.response.body)
|
46
|
+
@error_messages << [e.message, response_body].join(", ")
|
47
|
+
# TODO: use errors and full_messages like rails
|
48
|
+
# TODO: use logger to log errors or successful invoice creation
|
49
|
+
|
50
|
+
false
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
# Request body required for Monobank API
|
57
|
+
#
|
58
|
+
# @return [Hash] request body
|
59
|
+
def request_body
|
60
|
+
# TODO: add "ccy" and another missing params
|
61
|
+
# TODO: remove nil valued params
|
62
|
+
{
|
63
|
+
amount: amount,
|
64
|
+
redirectUrl: redirect_url,
|
65
|
+
webHookUrl: webhook_url,
|
66
|
+
merchantPaymInfo: {
|
67
|
+
destination: destination
|
68
|
+
}
|
69
|
+
}.to_json
|
70
|
+
end
|
71
|
+
|
72
|
+
def convert_to_cents(amount)
|
73
|
+
if amount.is_a?(BigDecimal)
|
74
|
+
Money.from_amount(amount, CURRENCY).cents
|
75
|
+
else
|
76
|
+
amount
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require "rest-client"
|
2
|
+
require "base64"
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
require "pry"
|
6
|
+
module MonopayRuby
|
7
|
+
module Webhooks
|
8
|
+
class PublicKey < MonopayRuby::Base
|
9
|
+
attr_reader :error_messages, :key
|
10
|
+
|
11
|
+
API_GET_KEY_URL = "#{API_URL}/merchant/pubkey".freeze
|
12
|
+
PUBLIC_KEY_KEY = "key".freeze
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
@error_messages = []
|
16
|
+
end
|
17
|
+
|
18
|
+
# Get public key from Monobank API
|
19
|
+
#
|
20
|
+
# @return [Boolean] true if key was successfully received, false otherwise
|
21
|
+
def request_key
|
22
|
+
begin
|
23
|
+
response = RestClient.get(API_GET_KEY_URL, headers)
|
24
|
+
response_body = JSON.parse(response.body)
|
25
|
+
base64_key = JSON.parse(response.body)[PUBLIC_KEY_KEY]
|
26
|
+
|
27
|
+
@key = Base64.decode64(base64_key)
|
28
|
+
|
29
|
+
true
|
30
|
+
rescue Exception => e
|
31
|
+
# TODO: Check how for example Stripe or Liqpay handle errors
|
32
|
+
response_body = JSON.parse(e.response.body)
|
33
|
+
error_message = [e.message, response_body].join(", ")
|
34
|
+
|
35
|
+
error_messages << error_message
|
36
|
+
|
37
|
+
false
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
module MonopayRuby
|
2
|
+
module Webhooks
|
3
|
+
class Validator
|
4
|
+
attr_reader :error_messages
|
5
|
+
|
6
|
+
# Initialize service
|
7
|
+
#
|
8
|
+
# @param [ActionDispatch::Request] request
|
9
|
+
# @example Usage
|
10
|
+
# class SomeController < ApplicationController
|
11
|
+
# skip_before_action :verify_authenticity_token, only: [:webhook]
|
12
|
+
#
|
13
|
+
# def webhook
|
14
|
+
# validator = MonopayRuby::Webhooks::Validator.new(request)
|
15
|
+
#
|
16
|
+
# if validator.valid?
|
17
|
+
# # do something with webhook data
|
18
|
+
#
|
19
|
+
# head :ok
|
20
|
+
# else
|
21
|
+
# flash[:error] = validator.error_messages.join(", ")
|
22
|
+
#
|
23
|
+
# # do something
|
24
|
+
#
|
25
|
+
# head :unprocessable_entity
|
26
|
+
# end
|
27
|
+
# end
|
28
|
+
# end
|
29
|
+
def initialize(request)
|
30
|
+
@request = request
|
31
|
+
@webhook_data = @request.raw_post
|
32
|
+
# @key = Rails.cache.fetch(:monobank_webhook_key) do
|
33
|
+
# Monobank::Webhooks::KeyService.new.key
|
34
|
+
# end
|
35
|
+
@public_key_service = MonopayRuby::Webhooks::PublicKey.new
|
36
|
+
|
37
|
+
@error_messages = []
|
38
|
+
end
|
39
|
+
|
40
|
+
# Validate webhook data signature with public key
|
41
|
+
#
|
42
|
+
# @return [Boolean] true if valid, false if not valid
|
43
|
+
def valid?
|
44
|
+
return false if @webhook_data.nil?
|
45
|
+
return false if signature.nil?
|
46
|
+
|
47
|
+
if @public_key_service.request_key
|
48
|
+
@public_key ||= @public_key_service.key
|
49
|
+
|
50
|
+
openssl_ec = OpenSSL::PKey::EC.new(@public_key)
|
51
|
+
openssl_ec.check_key
|
52
|
+
|
53
|
+
return true if openssl_ec.verify(digest, signature, @webhook_data)
|
54
|
+
|
55
|
+
@error_messages << "Webhook aren't authorized. Might be signature is invalid or webhook data is modified."
|
56
|
+
else
|
57
|
+
@error_messages << @public_key_service.error_messages
|
58
|
+
end
|
59
|
+
|
60
|
+
false
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
# Get signature from request headers
|
66
|
+
#
|
67
|
+
# @return [String] signature
|
68
|
+
def signature
|
69
|
+
@signature ||= Base64.decode64(@request.headers["X-Sign"])
|
70
|
+
end
|
71
|
+
|
72
|
+
# Get digest from OpenSSL
|
73
|
+
#
|
74
|
+
# @return [OpenSSL::Digest] digest
|
75
|
+
def digest
|
76
|
+
@digest ||= OpenSSL::Digest.new("SHA256")
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
data/lib/monopay-ruby.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MonopayRuby
|
4
|
+
class Base
|
5
|
+
API_URL = "https://api.monobank.ua/api".freeze
|
6
|
+
|
7
|
+
protected
|
8
|
+
|
9
|
+
# Required headers for Monobank API
|
10
|
+
#
|
11
|
+
# @return [Hash] headers
|
12
|
+
def headers
|
13
|
+
{
|
14
|
+
content_type: :json,
|
15
|
+
accept: :json,
|
16
|
+
"X-Token": MonopayRuby.configuration.api_token
|
17
|
+
}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.configuration
|
22
|
+
@configuration ||= MonopayRuby::Configuration.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.configure
|
26
|
+
yield(configuration)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
Dir.glob(File.join(__dir__, "monopay-ruby", "/**/*.rb")).sort.each { |file| require file }
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# to load all /lib files
|
4
|
+
$LOAD_PATH.push File.expand_path("lib", __dir__)
|
5
|
+
|
6
|
+
require_relative "lib/monopay-ruby/version"
|
7
|
+
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = "monopay-ruby"
|
10
|
+
spec.version = MonopayRuby::VERSION
|
11
|
+
spec.authors = ["loqimean"]
|
12
|
+
spec.email = ["vanuha277@gmail.com"]
|
13
|
+
|
14
|
+
spec.summary = "The \"monopay-ruby\" gem is a powerful Ruby library designed for seamless integration with Monobank's payment system. It provides a convenient way to handle Monobank payments within Ruby and Rails applications, simplifying the process and saving you valuable development time."
|
15
|
+
spec.description = "The \"monopay-ruby\" gem simplifies Monobank payment integration in Ruby and Rails applications. It provides an intuitive interface and essential functionalities for generating payment requests, verifying transactions, handling callbacks, and ensuring data integrity. With this gem, you can quickly and securely implement Monobank payments, saving development time and delivering a seamless payment experience to your users."
|
16
|
+
spec.homepage = "https://github.com/loqimean/monopay-ruby"
|
17
|
+
spec.license = "MIT"
|
18
|
+
spec.required_ruby_version = ">= 2.6.0"
|
19
|
+
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
21
|
+
spec.metadata["source_code_uri"] = "https://github.com/loqimean/monopay-ruby"
|
22
|
+
spec.metadata["changelog_uri"] = "https://github.com/loqimean/monopay-ruby/blob/master/CHANGELOG.md"
|
23
|
+
|
24
|
+
# Specify which files should be added to the gem when it is released.
|
25
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
26
|
+
spec.files = Dir.chdir(__dir__) do
|
27
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
28
|
+
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
spec.bindir = "exe"
|
32
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
33
|
+
spec.require_paths = ["lib"]
|
34
|
+
|
35
|
+
# Uncomment to register a new dependency of your gem
|
36
|
+
# TODO: Use metal versions of gems where possible to avoid unnecessary extra
|
37
|
+
spec.add_dependency "rest-client", "~> 2.1"
|
38
|
+
spec.add_dependency "base64", "~> 0.1.1"
|
39
|
+
spec.add_dependency "json", "~> 2.5"
|
40
|
+
spec.add_dependency "openssl", "~> 2.1"
|
41
|
+
spec.add_dependency "money", "~> 6.13"
|
42
|
+
|
43
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
44
|
+
spec.add_development_dependency "pry", "~> 0.14.2"
|
45
|
+
spec.add_development_dependency "simplecov", "~> 0.22.0"
|
46
|
+
|
47
|
+
# For more information and examples about making a new gem, check out our
|
48
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: monopay-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- loqimean
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-06-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: base64
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.1.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.1.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: json
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.5'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: openssl
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: money
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '6.13'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '6.13'
|
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: pry
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.14.2
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.14.2
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.22.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.22.0
|
125
|
+
description: The "monopay-ruby" gem simplifies Monobank payment integration in Ruby
|
126
|
+
and Rails applications. It provides an intuitive interface and essential functionalities
|
127
|
+
for generating payment requests, verifying transactions, handling callbacks, and
|
128
|
+
ensuring data integrity. With this gem, you can quickly and securely implement Monobank
|
129
|
+
payments, saving development time and delivering a seamless payment experience to
|
130
|
+
your users.
|
131
|
+
email:
|
132
|
+
- vanuha277@gmail.com
|
133
|
+
executables: []
|
134
|
+
extensions: []
|
135
|
+
extra_rdoc_files: []
|
136
|
+
files:
|
137
|
+
- ".rspec"
|
138
|
+
- ".ruby-version"
|
139
|
+
- CHANGELOG.md
|
140
|
+
- Gemfile
|
141
|
+
- Gemfile.lock
|
142
|
+
- LICENSE.txt
|
143
|
+
- README.md
|
144
|
+
- Rakefile
|
145
|
+
- lib/monopay-ruby.rb
|
146
|
+
- lib/monopay-ruby/configuration.rb
|
147
|
+
- lib/monopay-ruby/invoices/simple_invoice.rb
|
148
|
+
- lib/monopay-ruby/version.rb
|
149
|
+
- lib/monopay-ruby/webhooks/public_key.rb
|
150
|
+
- lib/monopay-ruby/webhooks/validator.rb
|
151
|
+
- monopay-ruby.gemspec
|
152
|
+
- sig/monopay_ruby.rbs
|
153
|
+
homepage: https://github.com/loqimean/monopay-ruby
|
154
|
+
licenses:
|
155
|
+
- MIT
|
156
|
+
metadata:
|
157
|
+
homepage_uri: https://github.com/loqimean/monopay-ruby
|
158
|
+
source_code_uri: https://github.com/loqimean/monopay-ruby
|
159
|
+
changelog_uri: https://github.com/loqimean/monopay-ruby/blob/master/CHANGELOG.md
|
160
|
+
post_install_message:
|
161
|
+
rdoc_options: []
|
162
|
+
require_paths:
|
163
|
+
- lib
|
164
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: 2.6.0
|
169
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
requirements: []
|
175
|
+
rubygems_version: 3.3.7
|
176
|
+
signing_key:
|
177
|
+
specification_version: 4
|
178
|
+
summary: The "monopay-ruby" gem is a powerful Ruby library designed for seamless integration
|
179
|
+
with Monobank's payment system. It provides a convenient way to handle Monobank
|
180
|
+
payments within Ruby and Rails applications, simplifying the process and saving
|
181
|
+
you valuable development time.
|
182
|
+
test_files: []
|